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

View File

@@ -178,12 +178,11 @@ void SettingsController::backupAppConfig(const QString &fileName)
void SettingsController::restoreAppConfig(const QString &fileName)
{
QFile file(fileName);
file.open(QIODevice::ReadOnly);
QByteArray data = file.readAll();
QByteArray data;
if (!SystemController::readFile(fileName, data)) {
emit changeSettingsErrorOccurred(tr("Can't open file: %1").arg(fileName));
return;
}
restoreAppConfigFromData(data);
}

View File

@@ -169,6 +169,27 @@ PageType {
var noButtonFunction = function() {
}
showQuestionDrawer(headerText, descriptionText, yesButtonText, noButtonText, yesButtonFunction, noButtonFunction)
var showDialog = function() {
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()
}
}
}
}