Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/plugincontroller.cpp
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 105 | { | |||
---|---|---|---|---|---|
121 | return true; | 121 | return true; | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | struct Dependency | 124 | struct Dependency | ||
125 | { | 125 | { | ||
126 | explicit Dependency(const QString &dependency) | 126 | explicit Dependency(const QString &dependency) | ||
127 | : interface(dependency) | 127 | : interface(dependency) | ||
128 | { | 128 | { | ||
129 | if (dependency.contains('@')) { | 129 | if (dependency.contains(QLatin1Char('@'))) { | ||
130 | const auto list = dependency.split('@', QString::SkipEmptyParts); | 130 | const auto list = dependency.split(QLatin1Char('@'), QString::SkipEmptyParts); | ||
131 | if (list.size() == 2) { | 131 | if (list.size() == 2) { | ||
132 | interface = list.at(0); | 132 | interface = list.at(0); | ||
133 | pluginName = list.at(1); | 133 | pluginName = list.at(1); | ||
134 | } | 134 | } | ||
135 | } | 135 | } | ||
136 | } | 136 | } | ||
137 | 137 | | |||
138 | QString interface; | 138 | QString interface; | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 148 | public: | |||
226 | } | 226 | } | ||
227 | 227 | | |||
228 | /** | 228 | /** | ||
229 | * Decide whether a plugin is enabled | 229 | * Decide whether a plugin is enabled | ||
230 | */ | 230 | */ | ||
231 | bool isEnabled(const KPluginMetaData& info) const | 231 | bool isEnabled(const KPluginMetaData& info) const | ||
232 | { | 232 | { | ||
233 | // first check black listing from environment | 233 | // first check black listing from environment | ||
234 | static const QStringList disabledPlugins = QString::fromLatin1(qgetenv("KDEV_DISABLE_PLUGINS")).split(';'); | 234 | static const QStringList disabledPlugins = QString::fromLatin1(qgetenv("KDEV_DISABLE_PLUGINS")).split(QLatin1Char(';')); | ||
235 | if (disabledPlugins.contains(info.pluginId())) { | 235 | if (disabledPlugins.contains(info.pluginId())) { | ||
236 | return false; | 236 | return false; | ||
237 | } | 237 | } | ||
238 | 238 | | |||
239 | if (!isUserSelectable( info )) | 239 | if (!isUserSelectable( info )) | ||
240 | return true; | 240 | return true; | ||
241 | 241 | | |||
242 | // read stored user preference | 242 | // read stored user preference | ||
▲ Show 20 Lines • Show All 330 Lines • ▼ Show 20 Line(s) | |||||
573 | 573 | | |||
574 | bool PluginController::hasUnresolvedDependencies( const KPluginMetaData& info, QStringList& missing ) const | 574 | bool PluginController::hasUnresolvedDependencies( const KPluginMetaData& info, QStringList& missing ) const | ||
575 | { | 575 | { | ||
576 | QSet<QString> required = KPluginMetaData::readStringList(info.rawData(), KEY_Required()).toSet(); | 576 | QSet<QString> required = KPluginMetaData::readStringList(info.rawData(), KEY_Required()).toSet(); | ||
577 | if (!required.isEmpty()) { | 577 | if (!required.isEmpty()) { | ||
578 | d->foreachEnabledPlugin([&required] (const KPluginMetaData& plugin) -> bool { | 578 | d->foreachEnabledPlugin([&required] (const KPluginMetaData& plugin) -> bool { | ||
579 | foreach (const QString& iface, KPluginMetaData::readStringList(plugin.rawData(), KEY_Interfaces())) { | 579 | foreach (const QString& iface, KPluginMetaData::readStringList(plugin.rawData(), KEY_Interfaces())) { | ||
580 | required.remove(iface); | 580 | required.remove(iface); | ||
581 | required.remove(iface + '@' + plugin.pluginId()); | 581 | required.remove(iface + QLatin1Char('@') + plugin.pluginId()); | ||
582 | } | 582 | } | ||
583 | return !required.isEmpty(); | 583 | return !required.isEmpty(); | ||
584 | }); | 584 | }); | ||
585 | } | 585 | } | ||
586 | // if we found all dependencies required should be empty now | 586 | // if we found all dependencies required should be empty now | ||
587 | if (!required.isEmpty()) { | 587 | if (!required.isEmpty()) { | ||
588 | missing = required.toList(); | 588 | missing = required.toList(); | ||
589 | return false; | 589 | return false; | ||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |