mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Ref T228, some renamings
This commit is contained in:
@@ -523,9 +523,9 @@ namespace BlackCore
|
||||
return !this->getUnsavedSettingsKeys().isEmpty();
|
||||
}
|
||||
|
||||
void CApplication::setSettingsAutoSave(bool autoSave)
|
||||
void CApplication::saveSettingsOnShutdown(bool saveSettings)
|
||||
{
|
||||
m_autoSaveSettings = autoSave;
|
||||
m_saveSettingsOnShutdown = saveSettings;
|
||||
}
|
||||
|
||||
QStringList CApplication::getUnsavedSettingsKeys() const
|
||||
@@ -948,18 +948,11 @@ namespace BlackCore
|
||||
m_shutdown = true;
|
||||
|
||||
// save settings (but only when application was really alive)
|
||||
CStatusMessage m;
|
||||
if (m_parsed)
|
||||
if (m_parsed && m_saveSettingsOnShutdown)
|
||||
{
|
||||
if (this->supportsContexts() && m_autoSaveSettings)
|
||||
{
|
||||
// this will eventually also call saveToStore
|
||||
m = this->getIContextApplication()->saveSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
m = CSettingsCache::instance()->saveToStore();
|
||||
}
|
||||
const CStatusMessage m = this->supportsContexts() ?
|
||||
this->getIContextApplication()->saveSettings() :
|
||||
CSettingsCache::instance()->saveToStore();
|
||||
CLogMessage(getLogCategories()).preformatted(m);
|
||||
}
|
||||
|
||||
|
||||
@@ -221,8 +221,8 @@ namespace BlackCore
|
||||
//! Unsaved settings
|
||||
bool hasUnsavedSettings() const;
|
||||
|
||||
//! Automatically and always save settings
|
||||
void setSettingsAutoSave(bool autoSave);
|
||||
//! Save settings on shutdown
|
||||
void saveSettingsOnShutdown(bool saveSettings);
|
||||
|
||||
//! All unsaved settings
|
||||
QStringList getUnsavedSettingsKeys() const;
|
||||
@@ -598,25 +598,25 @@ namespace BlackCore
|
||||
//! Write meta information into the application directory so other swift versions can display them
|
||||
void tagApplicationDataDirectory();
|
||||
|
||||
QNetworkAccessManager *m_accessManager = nullptr; //!< single network access manager
|
||||
BlackMisc::CApplicationInfo m_applicationInfo; //!< Application if specified
|
||||
QScopedPointer<CCoreFacade> m_coreFacade; //!< core facade if any
|
||||
QScopedPointer<CSetupReader> m_setupReader; //!< setup reader
|
||||
QScopedPointer<CWebDataServices> m_webDataServices; //!< web data services
|
||||
QScopedPointer<Db::CNetworkWatchdog> m_networkWatchDog; //!< checking DB/internet access
|
||||
QScopedPointer<BlackMisc::CFileLogger> m_fileLogger; //!< file logger
|
||||
CCookieManager m_cookieManager; //!< single cookie manager for our access manager
|
||||
const QString m_applicationName; //!< application name
|
||||
QReadWriteLock m_accessManagerLock; //!< lock to make access manager access threadsafe
|
||||
CCoreFacadeConfig m_coreFacadeConfig; //!< Core facade config if any
|
||||
CWebReaderFlags::WebReader m_webReadersUsed; //!< Readers to be used
|
||||
Db::CDatabaseReaderConfigList m_dbReaderConfig; //!< Load or used caching?
|
||||
std::atomic<bool> m_shutdown { false }; //!< is being shutdown?
|
||||
bool m_useContexts = false; //!< use contexts
|
||||
bool m_useWebData = false; //!< use web data
|
||||
bool m_signalStartup = true; //!< signal startup automatically
|
||||
bool m_devEnv = false; //!< dev. environment
|
||||
bool m_autoSaveSettings = true; //!< automatically saving all settings
|
||||
QNetworkAccessManager *m_accessManager = nullptr; //!< single network access manager
|
||||
BlackMisc::CApplicationInfo m_applicationInfo; //!< Application if specified
|
||||
QScopedPointer<CCoreFacade> m_coreFacade; //!< core facade if any
|
||||
QScopedPointer<CSetupReader> m_setupReader; //!< setup reader
|
||||
QScopedPointer<CWebDataServices> m_webDataServices; //!< web data services
|
||||
QScopedPointer<Db::CNetworkWatchdog> m_networkWatchDog; //!< checking DB/internet access
|
||||
QScopedPointer<BlackMisc::CFileLogger> m_fileLogger; //!< file logger
|
||||
CCookieManager m_cookieManager; //!< single cookie manager for our access manager
|
||||
const QString m_applicationName; //!< application name
|
||||
QReadWriteLock m_accessManagerLock; //!< lock to make access manager access threadsafe
|
||||
CCoreFacadeConfig m_coreFacadeConfig; //!< Core facade config if any
|
||||
CWebReaderFlags::WebReader m_webReadersUsed; //!< Readers to be used
|
||||
Db::CDatabaseReaderConfigList m_dbReaderConfig; //!< Load or used caching?
|
||||
std::atomic<bool> m_shutdown { false }; //!< is being shutdown?
|
||||
bool m_useContexts = false; //!< use contexts
|
||||
bool m_useWebData = false; //!< use web data
|
||||
bool m_signalStartup = true; //!< signal startup automatically
|
||||
bool m_devEnv = false; //!< dev. environment
|
||||
bool m_saveSettingsOnShutdown = true; //!< saving all settings on shutdown
|
||||
|
||||
// -------------- crashpad -----------------
|
||||
BlackMisc::CStatusMessageList initCrashHandler();
|
||||
|
||||
@@ -189,6 +189,7 @@ namespace BlackGui
|
||||
virtual bool parseAndSynchronizeSetup(int timeoutMs = BlackMisc::Network::CNetworkUtils::getLongTimeoutMs()) override;
|
||||
|
||||
//! Show close dialog
|
||||
//! \remark will modify CApplication::saveSettingsOnShutdown
|
||||
QDialog::DialogCode showCloseDialog(QMainWindow *mainWindow, QCloseEvent *closeEvent);
|
||||
|
||||
//! Trigger new version check
|
||||
|
||||
@@ -73,7 +73,7 @@ void CSwiftData::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (sGui)
|
||||
{
|
||||
// save settings
|
||||
// save settings?
|
||||
if (sGui->showCloseDialog(this, event) == QDialog::Rejected) { return; }
|
||||
}
|
||||
this->performGracefulShutdown();
|
||||
|
||||
Reference in New Issue
Block a user