Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/previewjob.cpp
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Line(s) | 270 | { | |||
---|---|---|---|---|---|
275 | QHash<QString, QHash<QString, KService::Ptr> > protocolMap; | 275 | QHash<QString, QHash<QString, KService::Ptr> > protocolMap; | ||
276 | 276 | | |||
277 | for (KService::List::ConstIterator it = plugins.constBegin(); it != plugins.constEnd(); ++it) { | 277 | for (KService::List::ConstIterator it = plugins.constBegin(); it != plugins.constEnd(); ++it) { | ||
278 | QStringList protocols = (*it)->property(QStringLiteral("X-KDE-Protocols")).toStringList(); | 278 | QStringList protocols = (*it)->property(QStringLiteral("X-KDE-Protocols")).toStringList(); | ||
279 | const QString p = (*it)->property(QStringLiteral("X-KDE-Protocol")).toString(); | 279 | const QString p = (*it)->property(QStringLiteral("X-KDE-Protocol")).toString(); | ||
280 | if (!p.isEmpty()) { | 280 | if (!p.isEmpty()) { | ||
281 | protocols.append(p); | 281 | protocols.append(p); | ||
282 | } | 282 | } | ||
283 | foreach (const QString &protocol, protocols) { | 283 | for (const QString &protocol : qAsConst(protocols)) { | ||
284 | // We cannot use mimeTypes() here, it doesn't support groups such as: text/* | 284 | // We cannot use mimeTypes() here, it doesn't support groups such as: text/* | ||
285 | const QStringList mtypes = (*it)->serviceTypes(); | 285 | const QStringList mtypes = (*it)->serviceTypes(); | ||
286 | // Add supported mimetype for this protocol | 286 | // Add supported mimetype for this protocol | ||
287 | QStringList &_ms = m_remoteProtocolPlugins[protocol]; | 287 | QStringList &_ms = m_remoteProtocolPlugins[protocol]; | ||
288 | foreach (const QString &_m, mtypes) { | 288 | for (const QString &_m : mtypes) { | ||
289 | if (_m != QLatin1String("ThumbCreator")) { | 289 | if (_m != QLatin1String("ThumbCreator")) { | ||
290 | protocolMap[protocol].insert(_m, *it); | 290 | protocolMap[protocol].insert(_m, *it); | ||
291 | if (!_ms.contains(_m)) { | 291 | if (!_ms.contains(_m)) { | ||
292 | _ms.append(_m); | 292 | _ms.append(_m); | ||
293 | } | 293 | } | ||
294 | } | 294 | } | ||
295 | } | 295 | } | ||
296 | } | 296 | } | ||
▲ Show 20 Lines • Show All 532 Lines • Show Last 20 Lines |