mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Setup Thread and timer for settings
This commit is contained in:
parent
2b3f12a7c4
commit
77bab2a8c2
2 changed files with 12 additions and 1 deletions
|
@ -451,7 +451,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
}
|
||||
|
||||
loadSettings();
|
||||
|
||||
int SAVE_SETTINGS_INTERVAL = 10 * MSECS_PER_SECOND; // Let's save every seconds for now
|
||||
connect(&_settingsTimer, &QTimer::timeout, this, &Application::saveSettings);
|
||||
connect(&_settingsThread, SIGNAL(started), &_settingsTimer, SLOT(start));
|
||||
connect(&_settingsThread, &QThread::finished, &_settingsTimer, &QTimer::deleteLater);
|
||||
_settingsTimer.moveToThread(&_settingsThread);
|
||||
_settingsTimer.setSingleShot(false);
|
||||
_settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL);
|
||||
_settingsThread.start();
|
||||
|
||||
_trayIcon->show();
|
||||
|
||||
// set the local loopback interface for local sounds from audio scripts
|
||||
|
|
|
@ -586,6 +586,9 @@ private:
|
|||
bool _aboutToQuit;
|
||||
|
||||
Bookmarks* _bookmarks;
|
||||
|
||||
QThread _settingsThread;
|
||||
QTimer _settingsTimer;
|
||||
};
|
||||
|
||||
#endif // hifi_Application_h
|
||||
|
|
Loading…
Reference in a new issue