66#include < QBuffer>
77
88#include " flipperzero/flipperzero.h"
9- #include " flipperzero/operations/wirelessstackdownloadoperation.h"
10- #include " flipperzero/operations/firmwaredownloadoperation.h"
11- #include " flipperzero/operations/fixoptionbytesoperation.h"
12- #include " flipperzero/operations/assetsdownloadoperation.h"
9+ #include " flipperzero/operations/userbackupoperation.h"
10+ #include " flipperzero/operations/userrestoreoperation.h"
1311#include " flipperzero/operations/fixbootissuesoperation.h"
12+ #include " flipperzero/operations/assetsdownloadoperation.h"
13+ #include " flipperzero/operations/fixoptionbytesoperation.h"
14+ #include " flipperzero/operations/firmwaredownloadoperation.h"
15+ #include " flipperzero/operations/wirelessstackdownloadoperation.h"
1416
1517#include " remotefilefetcher.h"
1618#include " macros.h"
@@ -90,6 +92,16 @@ void FirmwareDownloader::downloadAssets(FlipperZero *device, const QString &file
9092 enqueueOperation (new Flipper::Zero::AssetsDownloadOperation (device, file, this ));
9193}
9294
95+ void FirmwareDownloader::backupUserData (FlipperZero *device, const QString &backupPath)
96+ {
97+ enqueueOperation (new Flipper::Zero::UserBackupOperation (device, backupPath, this ));
98+ }
99+
100+ void FirmwareDownloader::restoreUserData (FlipperZero *device, const QString &backupPath)
101+ {
102+ enqueueOperation (new Flipper::Zero::UserRestoreOperation (device, backupPath, this ));
103+ }
104+
93105void FirmwareDownloader::processQueue ()
94106{
95107 if (m_operationQueue.isEmpty ()) {
@@ -102,7 +114,8 @@ void FirmwareDownloader::processQueue()
102114 connect (currentOperation, &AbstractOperation::finished, this , [=]() {
103115 info_msg (QStringLiteral (" Operation '%1' finished with status: %2." ).arg (currentOperation->description (), currentOperation->errorString ()));
104116 currentOperation->deleteLater ();
105- processQueue ();
117+
118+ QTimer::singleShot (0 , this , &FirmwareDownloader::processQueue);
106119 });
107120
108121 currentOperation->start ();
0 commit comments