Changeset View
Changeset View
Standalone View
Standalone View
attica-kde/kdeplugin/kdeplatformdependent.cpp
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Line(s) | 194 | { | |||
---|---|---|---|---|---|
197 | Q_UNUSED(password); | 197 | Q_UNUSED(password); | ||
198 | 198 | | |||
199 | return false; | 199 | return false; | ||
200 | } | 200 | } | ||
201 | 201 | | |||
202 | QList<QUrl> KdePlatformDependent::getDefaultProviderFiles() const | 202 | QList<QUrl> KdePlatformDependent::getDefaultProviderFiles() const | ||
203 | { | 203 | { | ||
204 | KConfigGroup group(m_config, "General"); | 204 | KConfigGroup group(m_config, "General"); | ||
205 | QStringList pathStrings = group.readPathEntry("providerFiles", QStringList(QStringLiteral("http://download.kde.org/ocs/providers.xml"))); | 205 | QStringList pathStrings = group.readPathEntry("providerFiles", QStringList(QStringLiteral("https://download.kde.org/ocs/providers.xml"))); | ||
206 | QList<QUrl> paths; | 206 | QList<QUrl> paths; | ||
207 | foreach (const QString& pathString, pathStrings) { | 207 | foreach (const QString& pathString, pathStrings) { | ||
208 | paths.append(QUrl(pathString)); | 208 | paths.append(QUrl(pathString)); | ||
209 | } | 209 | } | ||
210 | qCDebug(ATTICA_PLUGIN_LOG) << "Loaded paths from config:" << paths; | 210 | qCDebug(ATTICA_PLUGIN_LOG) << "Loaded paths from config:" << paths; | ||
211 | return paths; | 211 | return paths; | ||
212 | } | 212 | } | ||
213 | 213 | | |||
214 | void KdePlatformDependent::addDefaultProviderFile(const QUrl& url) | 214 | void KdePlatformDependent::addDefaultProviderFile(const QUrl& url) | ||
215 | { | 215 | { | ||
216 | KConfigGroup group(m_config, "General"); | 216 | KConfigGroup group(m_config, "General"); | ||
217 | QStringList pathStrings = group.readPathEntry("providerFiles", QStringList(QStringLiteral("http://download.kde.org/ocs/providers.xml"))); | 217 | QStringList pathStrings = group.readPathEntry("providerFiles", QStringList(QStringLiteral("https://download.kde.org/ocs/providers.xml"))); | ||
218 | QString urlString = url.toString(); | 218 | QString urlString = url.toString(); | ||
219 | if(!pathStrings.contains(urlString)) { | 219 | if(!pathStrings.contains(urlString)) { | ||
220 | pathStrings.append(urlString); | 220 | pathStrings.append(urlString); | ||
221 | group.writeEntry("providerFiles", pathStrings); | 221 | group.writeEntry("providerFiles", pathStrings); | ||
222 | group.sync(); | 222 | group.sync(); | ||
223 | qCDebug(ATTICA_PLUGIN_LOG) << "wrote providers: " << pathStrings; | 223 | qCDebug(ATTICA_PLUGIN_LOG) << "wrote providers: " << pathStrings; | ||
224 | } | 224 | } | ||
225 | } | 225 | } | ||
226 | 226 | | |||
227 | void KdePlatformDependent::removeDefaultProviderFile(const QUrl& url) | 227 | void KdePlatformDependent::removeDefaultProviderFile(const QUrl& url) | ||
228 | { | 228 | { | ||
229 | KConfigGroup group(m_config, "General"); | 229 | KConfigGroup group(m_config, "General"); | ||
230 | QStringList pathStrings = group.readPathEntry("providerFiles", QStringList(QStringLiteral("http://download.kde.org/ocs/providers.xml"))); | 230 | QStringList pathStrings = group.readPathEntry("providerFiles", QStringList(QStringLiteral("https://download.kde.org/ocs/providers.xml"))); | ||
231 | pathStrings.removeAll(url.toString()); | 231 | pathStrings.removeAll(url.toString()); | ||
232 | group.writeEntry("providerFiles", pathStrings); | 232 | group.writeEntry("providerFiles", pathStrings); | ||
233 | } | 233 | } | ||
234 | 234 | | |||
235 | void KdePlatformDependent::enableProvider(const QUrl& baseUrl, bool enabled) const | 235 | void KdePlatformDependent::enableProvider(const QUrl& baseUrl, bool enabled) const | ||
236 | { | 236 | { | ||
237 | KConfigGroup group(m_config, "General"); | 237 | KConfigGroup group(m_config, "General"); | ||
238 | QStringList pathStrings = group.readPathEntry("disabledProviders", QStringList()); | 238 | QStringList pathStrings = group.readPathEntry("disabledProviders", QStringList()); | ||
Show All 25 Lines |