diff options
-rw-r--r-- | src/core/function/GlobalSettingStation.cpp | 22 | ||||
-rw-r--r-- | src/ui/dialog/WaitingDialog.cpp | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/core/function/GlobalSettingStation.cpp b/src/core/function/GlobalSettingStation.cpp index 594b6661..7b21ebca 100644 --- a/src/core/function/GlobalSettingStation.cpp +++ b/src/core/function/GlobalSettingStation.cpp @@ -59,12 +59,26 @@ class GlobalSettingStation::Impl { GF_CORE_LOG_INFO("app data path: {}", app_data_path_); GF_CORE_LOG_INFO("app log path: {}", app_log_path_); +#ifdef WINDOWS + GF_CORE_LOG_INFO("app config path: {}", app_config_path_); +#endif + +#ifdef WINDOWS + if (!QDir(app_config_path_).exists()) QDir(app_config_path_).mkpath("."); +#endif + if (!QDir(app_data_path_).exists()) QDir(app_data_path_).mkpath("."); if (!QDir(app_log_path_).exists()) QDir(app_log_path_).mkpath("."); } [[nodiscard]] auto GetSettings() -> QSettings { - if (!portable_mode_) return QSettings(); + if (!portable_mode_) { +#ifdef WINDOWS + return QSettings(app_config_target_path_, QSettings::IniFormat); +#else + return QSettings(); +#endif + } return {app_portable_config_path_, QSettings::IniFormat}; } @@ -116,11 +130,17 @@ class GlobalSettingStation::Impl { QString app_data_path_ = QString{QStandardPaths::writableLocation( QStandardPaths::AppLocalDataLocation)}; ///< Program Data Location + QString app_config_path_ = QString{ + QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)}; + QString app_log_path_ = app_data_path_ + "/logs"; ///< Program Data Location QString app_data_objs_path_ = app_data_path_ + "/data_objs"; ///< Object storage path + QString app_config_target_path_ = + app_config_path_ + "/config.ini"; ///< take effect only in portable mode + bool portable_mode_ = false; ///< QString app_portable_config_path_ = working_path_ + "/config.ini"; ///< take effect only in portable mode diff --git a/src/ui/dialog/WaitingDialog.cpp b/src/ui/dialog/WaitingDialog.cpp index 4b1a908f..87ac0fe5 100644 --- a/src/ui/dialog/WaitingDialog.cpp +++ b/src/ui/dialog/WaitingDialog.cpp @@ -48,6 +48,7 @@ WaitingDialog::WaitingDialog(const QString& title, QWidget* parent) Qt::CustomizeWindowHint); this->setWindowTitle(title); this->setAttribute(Qt::WA_DeleteOnClose); + this->setFixedSize(240, 42); this->movePosition2CenterOfParent(); this->show(); |