mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
FEAT(client): Immediately save settings
Previously settings were only saved upon Mumble's exit. This commit makes sure that the settings are also saved to file every time, the user accepts the settings window. That way settings are guaranteed to survive potential crashes or other hard-exits of Mumble (e.g. Ctrl+C, Task manager, etc.).
This commit is contained in:
parent
d0628628d3
commit
20f47f1bbf
@ -268,5 +268,8 @@ void ConfigDialog::accept() {
|
||||
#endif
|
||||
Global::get().s.qbaConfigGeometry = saveGeometry();
|
||||
|
||||
// Save settings to disk
|
||||
Global::get().s.save();
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#include "Database.h"
|
||||
#include "EnvUtils.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ServerHandler.h"
|
||||
#include "Global.h"
|
||||
#include "GlobalShortcutButtons.h"
|
||||
|
||||
@ -721,6 +722,16 @@ void GlobalShortcutConfig::save() const {
|
||||
if (s.bEnableUIAccess != oldUIAccess || s.bEnableGKey != oldGKey || s.bEnableXboxInput != oldXboxInput) {
|
||||
s.requireRestartToApply = true;
|
||||
}
|
||||
|
||||
if (Global::get().sh && Global::get().sh->hasSynchronized()) {
|
||||
// If we are connected to a server (that has finished synchronizing) there is the change, the user has
|
||||
// configured server-specific shortcuts, which we save in the DB instead of in the regular settings. Thus we
|
||||
// have to explicitly save them here.
|
||||
// Note that the server needs to have finished synchronizing, since only then did we load any previously
|
||||
// configured shortcuts from the DB in the first place. Otherwise, "saving" the shortcuts (which are not
|
||||
// loaded yet) would effectively delete them.
|
||||
Global::get().db->setShortcuts(Global::get().sh->qbaDigest, s.qlShortcuts);
|
||||
}
|
||||
}
|
||||
|
||||
QTreeWidgetItem *GlobalShortcutConfig::itemForShortcut(const Shortcut &sc) const {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user