Changeset View
Changeset View
Standalone View
Standalone View
src/plugin.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
87 | //static | 87 | //static | ||
88 | QList<Plugin::PluginInfo> Plugin::pluginInfos(const QString &componentName) | 88 | QList<Plugin::PluginInfo> Plugin::pluginInfos(const QString &componentName) | ||
89 | { | 89 | { | ||
90 | QList<PluginInfo> plugins; | 90 | QList<PluginInfo> plugins; | ||
91 | 91 | | |||
92 | QMap<QString, QStringList> sortedPlugins; | 92 | QMap<QString, QStringList> sortedPlugins; | ||
93 | 93 | | |||
94 | const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, componentName + QStringLiteral("/kpartplugins"), QStandardPaths::LocateDirectory); | 94 | const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, componentName + QStringLiteral("/kpartplugins"), QStandardPaths::LocateDirectory); | ||
95 | Q_FOREACH (const QString &dir, dirs) { | 95 | for (const QString &dir : dirs) { | ||
96 | Q_FOREACH (const QString &file, QDir(dir).entryList(QStringList(QStringLiteral("*.rc")))) { | 96 | const auto rcfiles = QDir(dir).entryList(QStringList(QStringLiteral("*.rc"))); | ||
97 | for (const QString &file : rcfiles) { | ||||
97 | const QFileInfo fInfo(dir + QLatin1Char('/') + file); | 98 | const QFileInfo fInfo(dir + QLatin1Char('/') + file); | ||
98 | QMap<QString, QStringList>::Iterator mapIt = sortedPlugins.find(fInfo.fileName()); | 99 | QMap<QString, QStringList>::Iterator mapIt = sortedPlugins.find(fInfo.fileName()); | ||
99 | if (mapIt == sortedPlugins.end()) { | 100 | if (mapIt == sortedPlugins.end()) { | ||
100 | mapIt = sortedPlugins.insert(fInfo.fileName(), QStringList()); | 101 | mapIt = sortedPlugins.insert(fInfo.fileName(), QStringList()); | ||
101 | } | 102 | } | ||
102 | mapIt.value().append(fInfo.absoluteFilePath()); | 103 | mapIt.value().append(fInfo.absoluteFilePath()); | ||
103 | } | 104 | } | ||
104 | } | 105 | } | ||
▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines |