mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-28 08:49:42 -05:00
Abort closing the app if saving a database failed.
This commit is contained in:
parent
b9fe2c1bf9
commit
c6fe0da569
@ -234,7 +234,9 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
|
|||||||
}
|
}
|
||||||
if (dbStruct.modified) {
|
if (dbStruct.modified) {
|
||||||
if (config()->get("AutoSaveOnExit").toBool()) {
|
if (config()->get("AutoSaveOnExit").toBool()) {
|
||||||
saveDatabase(db);
|
if (!saveDatabase(db)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QMessageBox::StandardButton result =
|
QMessageBox::StandardButton result =
|
||||||
@ -243,7 +245,9 @@ bool DatabaseTabWidget::closeDatabase(Database* db)
|
|||||||
tr("\"%1\" was modified.\nSave changes?").arg(dbName),
|
tr("\"%1\" was modified.\nSave changes?").arg(dbName),
|
||||||
QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes);
|
QMessageBox::Yes | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Yes);
|
||||||
if (result == QMessageBox::Yes) {
|
if (result == QMessageBox::Yes) {
|
||||||
saveDatabase(db);
|
if (!saveDatabase(db)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (result == QMessageBox::Cancel) {
|
else if (result == QMessageBox::Cancel) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user