Compare commits

...

1 Commits

Author SHA1 Message Date
NickVs2015 88e3e2bcb4 fix backup restore 2026-02-26 16:24:55 +03:00
2 changed files with 27 additions and 7 deletions
+5 -6
View File
@@ -178,12 +178,11 @@ void SettingsController::backupAppConfig(const QString &fileName)
void SettingsController::restoreAppConfig(const QString &fileName) void SettingsController::restoreAppConfig(const QString &fileName)
{ {
QFile file(fileName); QByteArray data;
if (!SystemController::readFile(fileName, data)) {
file.open(QIODevice::ReadOnly); emit changeSettingsErrorOccurred(tr("Can't open file: %1").arg(fileName));
return;
QByteArray data = file.readAll(); }
restoreAppConfigFromData(data); restoreAppConfigFromData(data);
} }
@@ -169,6 +169,27 @@ PageType {
var noButtonFunction = function() { var noButtonFunction = function() {
} }
var showDialog = function() {
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction) showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
} }
if (GC.isMobile() && Qt.platform.os === "android") {
restoreBackupDelayTimer.dialogCallback = showDialog
restoreBackupDelayTimer.restart()
} else {
showDialog()
}
}
Timer {
id: restoreBackupDelayTimer
interval: 500
repeat: false
property var dialogCallback
onTriggered: {
if (dialogCallback && typeof dialogCallback === "function") {
dialogCallback()
}
}
}
} }