mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
Compare commits
1 Commits
4.8.15.0
...
fix_backup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88e3e2bcb4 |
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user