Skip to content

Commit

Permalink
fix: Fixed the issue that settings were not saved when exiting
Browse files Browse the repository at this point in the history
Fixed the issue that settings were not saved when exiting

Log: Fixed the issue that settings were not saved when exiting
  • Loading branch information
pengfeixx authored and deepin-bot[bot] committed Dec 13, 2024
1 parent d83c424 commit ae6903e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/libdmusic/presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ void Presenter::setEffectImage(const QImage &img)
void Presenter::forceExit()
{
saveDataToDB();
qApp->processEvents();
QCoreApplication::exit(0);
_Exit(0);
}
Expand Down
6 changes: 3 additions & 3 deletions src/music-player/mainwindow/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ ApplicationWindow {
}
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit()
onTriggered: Presenter.forceExit();
}
}
}
Expand Down Expand Up @@ -270,7 +270,7 @@ ApplicationWindow {
globalVariant.closeConfirmDlgLoader.item.isMinimize = false
} else if (closeAction == 1) {
//退出
Qt.quit()
Presenter.forceExit();
} else {
//询问
globalVariant.closeConfirmDlgLoader.item.isClose = Presenter.valueFromSettings("base.close.is_close")
Expand Down Expand Up @@ -389,7 +389,7 @@ ApplicationWindow {
}
}
function onQuitRequested() {
Qt.quit()
Presenter.forceExit();
}
function onRaiseRequested() {
//console.log("onRaiseRequested......................", rootWindow.visibility, rootWindow.visible)
Expand Down

0 comments on commit ae6903e

Please sign in to comment.