summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-04-11 13:29:51 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-04-11 13:29:51 +0200
commit735a3e9d7721de483fca0eb9d815bf12925e674f (patch)
tree7d879fcfaef86ad93f677646de5c27d8afb9f11e
parentd15cb6c0fc28704bf98c974c7422097476aa7487 (diff)
config.h: Add MIXXX_ prefix to settings path/file
-rw-r--r--src/config.h.in4
-rw-r--r--src/controllers/defs_controllers.h2
-rw-r--r--src/preferences/upgrade.cpp13
-rw-r--r--src/util/cmdlineargs.cpp4
4 files changed, 13 insertions, 10 deletions
diff --git a/src/config.h.in b/src/config.h.in
index 612161ff31..bba756ec4c 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -1,4 +1,4 @@
-#define SETTINGS_FILE "mixxx.cfg"
+#define MIXXX_SETTINGS_FILE "mixxx.cfg"
-#cmakedefine SETTINGS_PATH "@MIXXX_SETTINGS_PATH@"
+#cmakedefine MIXXX_SETTINGS_PATH "@MIXXX_SETTINGS_PATH@"
#cmakedefine MIXXX_INSTALL_DOCDIR_RELATIVE_TO_DATADIR "@MIXXX_INSTALL_DOCDIR_RELATIVE_TO_DATADIR@"
diff --git a/src/controllers/defs_controllers.h b/src/controllers/defs_controllers.h
index 49e36a8823..79a524e633 100644
--- a/src/controllers/defs_controllers.h
+++ b/src/controllers/defs_controllers.h
@@ -9,7 +9,7 @@ inline QString resourcePresetsPath(UserSettingsPointer pConfig) {
return dir.absolutePath().append("/");
}
-// Prior to Mixxx 1.11.0 presets were stored in ${SETTINGS_PATH}/midi.
+// Prior to Mixxx 1.11.0 presets were stored in ${MIXXX_SETTINGS_PATH}/midi.
inline QString legacyUserPresetsPath(UserSettingsPointer pConfig) {
QString presetsPath = pConfig->getSettingsPath();
QDir dir(presetsPath.append("/midi/"));
diff --git a/src/preferences/upgrade.cpp b/src/preferences/upgrade.cpp
index cc58c00717..afc8961b1b 100644
--- a/src/preferences/upgrade.cpp
+++ b/src/preferences/upgrade.cpp
@@ -144,7 +144,7 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) {
#else
oldFilePath = oldLocation.filePath(".mixxx.cfg");
#endif
- newFilePath = newLocation.filePath(SETTINGS_FILE);
+ newFilePath = newLocation.filePath(MIXXX_SETTINGS_FILE);
oldFile = new QFile(oldFilePath);
if (oldFile->copy(newFilePath)) {
oldFile->remove();
@@ -177,7 +177,7 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) {
// Read the config file from home directory
UserSettingsPointer config(new ConfigObject<ConfigValue>(
- QDir(settingsPath).filePath(SETTINGS_FILE)));
+ QDir(settingsPath).filePath(MIXXX_SETTINGS_FILE)));
QString configVersion = config->getValueString(ConfigKey("[Config]","Version"));
@@ -189,7 +189,8 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) {
QScopedPointer<QFile> oldConfigFile(new QFile(QDir::homePath().append("/").append(".mixxx/mixxx.cfg")));
if (oldConfigFile->exists() && ! CmdlineArgs::Instance().getSettingsPathSet()) {
qDebug() << "Found pre-1.9.0 config for OS X";
- // Note: We changed SETTINGS_PATH in 1.9.0 final on OS X so it must be hardcoded to ".mixxx" here for legacy.
+ // Note: We changed MIXXX_SETTINGS_PATH in 1.9.0 final on OS X so
+ // it must be hardcoded to ".mixxx" here for legacy.
config = UserSettingsPointer(new ConfigObject<ConfigValue>(
QDir::homePath().append("/.mixxx/mixxx.cfg")));
// Just to be sure all files like logs and soundconfig go with mixxx.cfg
@@ -205,7 +206,9 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) {
QScopedPointer<QFile> oldConfigFile(new QFile(QDir::homePath().append("/Local Settings/Application Data/Mixxx/mixxx.cfg")));
if (oldConfigFile->exists() && ! CmdlineArgs::Instance().getSettingsPathSet()) {
qDebug() << "Found pre-1.12.0 config for Windows";
- // Note: We changed SETTINGS_PATH in 1.12.0 final on Windows so it must be hardcoded to "Local Settings/Application Data/Mixxx/" here for legacy.
+ // Note: We changed MIXXX_SETTINGS_PATH in 1.12.0 final on Windows
+ // so it must be hardcoded to "Local Settings/Application
+ // Data/Mixxx/" here for legacy.
config = UserSettingsPointer(new ConfigObject<ConfigValue>(
QDir::homePath().append("/Local Settings/Application Data/Mixxx/mixxx.cfg")));
// Just to be sure all files like logs and soundconfig go with mixxx.cfg
@@ -318,7 +321,7 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) {
// Reload the configuration file from the new location.
// (We want to make sure we save to the new location...)
config = UserSettingsPointer(new ConfigObject<ConfigValue>(
- QDir(settingsPath).filePath(SETTINGS_FILE)));
+ QDir(settingsPath).filePath(MIXXX_SETTINGS_FILE)));
#endif
configVersion = "1.9.0";
config->set(ConfigKey("[Config]","Version"), ConfigValue("1.9.0"));
diff --git a/src/util/cmdlineargs.cpp b/src/util/cmdlineargs.cpp
index 83f2fd9486..027027978e 100644
--- a/src/util/cmdlineargs.cpp
+++ b/src/util/cmdlineargs.cpp
@@ -18,8 +18,8 @@ CmdlineArgs::CmdlineArgs()
m_logLevel(mixxx::kLogLevelDefault),
m_logFlushLevel(mixxx::kLogFlushLevelDefault),
// We are not ready to switch to XDG folders under Linux, so keeping $HOME/.mixxx as preferences folder. see lp:1463273
-#ifdef SETTINGS_PATH
- m_settingsPath(QDir::homePath().append("/").append(SETTINGS_PATH)) {
+#ifdef MIXXX_SETTINGS_PATH
+ m_settingsPath(QDir::homePath().append("/").append(MIXXX_SETTINGS_PATH)) {
#else
// TODO(XXX) Trailing slash not needed anymore as we switches from String::append
// to QDir::filePath elsewhere in the code. This is candidate for removal.