Changeset View
Changeset View
Standalone View
Standalone View
src/core/ApplicationSettings.cpp
Context not available. | |||||
82 | 82 | | |||
---|---|---|---|---|---|
83 | static const char *PROGRESS_KEY = "progress"; | 83 | static const char *PROGRESS_KEY = "progress"; | ||
84 | 84 | | |||
85 | static const char *DEFAULT_DOWNLOAD_SERVER = "https://cdn.kde.org/gcompris"; | ||||
86 | | ||||
85 | ApplicationSettings *ApplicationSettings::m_instance = nullptr; | 87 | ApplicationSettings *ApplicationSettings::m_instance = nullptr; | ||
86 | 88 | | |||
87 | ApplicationSettings::ApplicationSettings(const QString &configPath, QObject *parent): QObject(parent), | 89 | ApplicationSettings::ApplicationSettings(const QString &configPath, QObject *parent): QObject(parent), | ||
Context not available. | |||||
151 | 153 | | |||
152 | // admin group | 154 | // admin group | ||
153 | m_config.beginGroup(ADMIN_GROUP_KEY); | 155 | m_config.beginGroup(ADMIN_GROUP_KEY); | ||
154 | m_downloadServerUrl = m_config.value(DOWNLOAD_SERVER_URL_KEY, QLatin1String("http://gcompris.net")).toString(); | 156 | m_downloadServerUrl = m_config.value(DOWNLOAD_SERVER_URL_KEY, QLatin1String(DEFAULT_DOWNLOAD_SERVER)).toString(); | ||
157 | if(m_downloadServerUrl == "http://gcompris.net") { | ||||
apol: these are char* so == doesn't work.
Make them (or at least either) a QLatin1String, otherwise… | |||||
m_downloadServerUrl is a QString and there is a operator==(const char *) (https://doc.qt.io/qt-5/qstring.html#operator-eq-eq-1) so it is fine? jjazeix: m_downloadServerUrl is a QString and there is a operator==(const char *) (https://doc.qt.io/qt… | |||||
158 | setDownloadServerUrl(DEFAULT_DOWNLOAD_SERVER); | ||||
159 | } | ||||
155 | m_cachePath = m_config.value(CACHE_PATH_KEY, QStandardPaths::writableLocation(QStandardPaths::CacheLocation)).toString(); | 160 | m_cachePath = m_config.value(CACHE_PATH_KEY, QStandardPaths::writableLocation(QStandardPaths::CacheLocation)).toString(); | ||
156 | m_userDataPath = m_config.value(USERDATA_PATH_KEY, QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/GCompris")).toString(); | 161 | m_userDataPath = m_config.value(USERDATA_PATH_KEY, QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/GCompris")).toString(); | ||
157 | m_renderer = m_config.value(RENDERER_KEY, GRAPHICAL_RENDERER).toString(); | 162 | m_renderer = m_config.value(RENDERER_KEY, GRAPHICAL_RENDERER).toString(); | ||
Context not available. |
these are char* so == doesn't work.
Make them (or at least either) a QLatin1String, otherwise you'll be comparing pointers.