Still need to figure out how to behave correctly on Mac. To not break Mac builds
until that's sorted, this should restore the old behavior.
Disabling migration code on Mac as well.
_configDirPath = Quassel::optionValue("configdir");
} else {
_configDirPath = Quassel::optionValue("configdir");
} else {
- // We abuse QSettings to find us a sensible path on all platforms
-#ifdef Q_WS_WIN
+#ifdef Q_WS_MAC
+ // On Mac, the path is always the same
+ _configDirPath = QDir::homePath() + "/Library/Application Support/Quassel/";
+#else
+ // We abuse QSettings to find us a sensible path on the other platforms
+# ifdef Q_WS_WIN
// don't use the registry
QSettings::Format format = QSettings::IniFormat;
// don't use the registry
QSettings::Format format = QSettings::IniFormat;
QSettings::Format format = QSettings::NativeFormat;
QSettings::Format format = QSettings::NativeFormat;
QSettings s(format, QSettings::UserScope, QCoreApplication::organizationDomain(), buildInfo().applicationName);
QFileInfo fileInfo(s.fileName());
_configDirPath = fileInfo.dir().absolutePath();
}
QSettings s(format, QSettings::UserScope, QCoreApplication::organizationDomain(), buildInfo().applicationName);
QFileInfo fileInfo(s.fileName());
_configDirPath = fileInfo.dir().absolutePath();
}
if(!_configDirPath.endsWith(QDir::separator()) && !_configDirPath.endsWith('/'))
_configDirPath += QDir::separator();
if(!_configDirPath.endsWith(QDir::separator()) && !_configDirPath.endsWith('/'))
_configDirPath += QDir::separator();
QHash<QString, QHash<QString, QVariant> > Settings::settingsCache;
QHash<QString, QHash<QString, SettingsChangeNotifier *> > Settings::settingsChangeNotifier;
QHash<QString, QHash<QString, QVariant> > Settings::settingsCache;
QHash<QString, QHash<QString, SettingsChangeNotifier *> > Settings::settingsChangeNotifier;
+#ifdef Q_WS_MAC
+# define create_qsettings QSettings s(QCoreApplication::organizationDomain(), appName)
+#else
+# define create_qsettings QSettings s(fileName(), format())
+#endif
+
// Settings::Settings(QString group_, QString appName_)
// : group(group_),
// appName(appName_)
// Settings::Settings(QString group_, QString appName_)
// : group(group_),
// appName(appName_)
}
QStringList Settings::allLocalKeys() {
}
QStringList Settings::allLocalKeys() {
- QSettings s(fileName(), format());
s.beginGroup(group);
QStringList res = s.allKeys();
s.endGroup();
s.beginGroup(group);
QStringList res = s.allKeys();
s.endGroup();
else
g = QString("%1/%2").arg(group, rootkey);
else
g = QString("%1/%2").arg(group, rootkey);
- QSettings s(fileName(), format());
s.beginGroup(g);
QStringList res = s.childKeys();
s.endGroup();
s.beginGroup(g);
QStringList res = s.childKeys();
s.endGroup();
else
g = QString("%1/%2").arg(group, rootkey);
else
g = QString("%1/%2").arg(group, rootkey);
- QSettings s(fileName(), format());
s.beginGroup(g);
QStringList res = s.childGroups();
s.endGroup();
s.beginGroup(g);
QStringList res = s.childGroups();
s.endGroup();
}
void Settings::setLocalValue(const QString &key, const QVariant &data) {
}
void Settings::setLocalValue(const QString &key, const QVariant &data) {
- QSettings s(fileName(), format());
s.beginGroup(group);
s.setValue(key, data);
s.endGroup();
s.beginGroup(group);
s.setValue(key, data);
s.endGroup();
const QVariant &Settings::localValue(const QString &key, const QVariant &def) {
if(!isCached(group, key)) {
const QVariant &Settings::localValue(const QString &key, const QVariant &def) {
if(!isCached(group, key)) {
- QSettings s(fileName(), format());
s.beginGroup(group);
setCacheValue(group, key, s.value(key, def));
s.endGroup();
s.beginGroup(group);
setCacheValue(group, key, s.value(key, def));
s.endGroup();
}
void Settings::removeLocalKey(const QString &key) {
}
void Settings::removeLocalKey(const QString &key) {
- QSettings s(fileName(), format());
s.beginGroup(group);
s.remove(key);
s.endGroup();
s.beginGroup(group);
s.remove(key);
s.endGroup();
loadTranslation(QLocale::system());
loadTranslation(QLocale::system());
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
#ifdef Q_WS_WIN
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
#ifdef Q_WS_WIN
qWarning() << "*** Migration completed.\n\n";
}
}
qWarning() << "*** Migration completed.\n\n";
}
}
// MIGRATION end
// Register storage backends here!
// MIGRATION end
// Register storage backends here!
bool QtUiApplication::init() {
if(Quassel::init()) {
bool QtUiApplication::init() {
if(Quassel::init()) {
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
#ifdef Q_WS_WIN
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
#ifdef Q_WS_WIN
}
qWarning() << "*** Migration completed.\n\n";
}
}
qWarning() << "*** Migration completed.\n\n";
}
// MIGRATION end
// session resume
// MIGRATION end
// session resume