Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwintabbox/main.cpp
Show All 37 Lines | |||||
38 | #include <KPluginInfo> | 38 | #include <KPluginInfo> | ||
39 | #include <KPluginLoader> | 39 | #include <KPluginLoader> | ||
40 | #include <KPluginTrader> | 40 | #include <KPluginTrader> | ||
41 | #include <KTitleWidget> | 41 | #include <KTitleWidget> | ||
42 | #include <KServiceTypeTrader> | 42 | #include <KServiceTypeTrader> | ||
43 | #include <KShortcutsEditor> | 43 | #include <KShortcutsEditor> | ||
44 | #include <KNewStuff3/KNS3/DownloadDialog> | 44 | #include <KNewStuff3/KNS3/DownloadDialog> | ||
45 | // Plasma | 45 | // Plasma | ||
46 | #include <Plasma/Package> | 46 | #include <KPackage/Package> | ||
47 | #include <Plasma/PluginLoader> | 47 | #include <KPackage/PackageLoader> | ||
48 | 48 | | |||
49 | // own | 49 | // own | ||
50 | #include "tabboxconfig.h" | 50 | #include "tabboxconfig.h" | ||
51 | #include "layoutpreview.h" | 51 | #include "layoutpreview.h" | ||
52 | 52 | | |||
53 | K_PLUGIN_FACTORY(KWinTabBoxConfigFactory, registerPlugin<KWin::KWinTabBoxConfig>();) | 53 | K_PLUGIN_FACTORY(KWinTabBoxConfigFactory, registerPlugin<KWin::KWinTabBoxConfig>();) | ||
54 | 54 | | |||
55 | namespace KWin | 55 | namespace KWin | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 156 | } else | |||
157 | infoLabel->hide(); | 157 | infoLabel->hide(); | ||
158 | } | 158 | } | ||
159 | 159 | | |||
160 | KWinTabBoxConfig::~KWinTabBoxConfig() | 160 | KWinTabBoxConfig::~KWinTabBoxConfig() | ||
161 | { | 161 | { | ||
162 | } | 162 | } | ||
163 | 163 | | |||
164 | 164 | | |||
165 | static QList<Plasma::Package> availableLnFPackages() | 165 | static QList<KPackage::Package> availableLnFPackages() | ||
166 | { | 166 | { | ||
167 | QList<Plasma::Package> packages; | 167 | QList<KPackage::Package> packages; | ||
168 | QStringList paths; | 168 | QStringList paths; | ||
169 | const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); | 169 | const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); | ||
170 | 170 | | |||
171 | for (const QString &path : dataPaths) { | 171 | for (const QString &path : dataPaths) { | ||
172 | QDir dir(path + QLatin1String("/plasma/look-and-feel")); | 172 | QDir dir(path + QLatin1String("/plasma/look-and-feel")); | ||
173 | paths << dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); | 173 | paths << dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); | ||
174 | } | 174 | } | ||
175 | 175 | | |||
176 | const auto &p = paths; | 176 | const auto &p = paths; | ||
177 | for (const QString &path : p) { | 177 | for (const QString &path : p) { | ||
178 | Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel")); | 178 | KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel")); | ||
179 | pkg.setPath(path); | 179 | pkg.setPath(path); | ||
180 | pkg.setFallbackPackage(Plasma::Package()); | 180 | pkg.setFallbackPackage(KPackage::Package()); | ||
181 | if (!pkg.filePath("defaults").isEmpty()) { | 181 | if (!pkg.filePath("defaults").isEmpty()) { | ||
182 | KSharedConfigPtr conf = KSharedConfig::openConfig(pkg.filePath("defaults")); | 182 | KSharedConfigPtr conf = KSharedConfig::openConfig(pkg.filePath("defaults")); | ||
183 | KConfigGroup cg = KConfigGroup(conf, "kwinrc"); | 183 | KConfigGroup cg = KConfigGroup(conf, "kwinrc"); | ||
184 | cg = KConfigGroup(&cg, "WindowSwitcher"); | 184 | cg = KConfigGroup(&cg, "WindowSwitcher"); | ||
185 | if (!cg.readEntry("LayoutName", QString()).isEmpty()) { | 185 | if (!cg.readEntry("LayoutName", QString()).isEmpty()) { | ||
186 | packages << pkg; | 186 | packages << pkg; | ||
187 | } | 187 | } | ||
188 | } | 188 | } | ||
Show All 11 Lines | 195 | { | |||
200 | KServiceTypeTrader* trader = KServiceTypeTrader::self(); | 200 | KServiceTypeTrader* trader = KServiceTypeTrader::self(); | ||
201 | KService::List offers = trader->query("KWin/WindowSwitcher"); | 201 | KService::List offers = trader->query("KWin/WindowSwitcher"); | ||
202 | QStringList layoutNames, layoutPlugins, layoutPaths; | 202 | QStringList layoutNames, layoutPlugins, layoutPaths; | ||
203 | 203 | | |||
204 | const auto lnfPackages = availableLnFPackages(); | 204 | const auto lnfPackages = availableLnFPackages(); | ||
205 | for (const auto &package : lnfPackages) { | 205 | for (const auto &package : lnfPackages) { | ||
206 | const auto &metaData = package.metadata(); | 206 | const auto &metaData = package.metadata(); | ||
207 | layoutNames << metaData.name(); | 207 | layoutNames << metaData.name(); | ||
208 | layoutPlugins << metaData.pluginName(); | 208 | layoutPlugins << metaData.pluginId(); | ||
209 | layoutPaths << package.filePath("windowswitcher", QStringLiteral("WindowSwitcher.qml")); | 209 | layoutPaths << package.filePath("windowswitcher", QStringLiteral("WindowSwitcher.qml")); | ||
210 | } | 210 | } | ||
211 | 211 | | |||
212 | foreach (KService::Ptr service, offers) { | 212 | foreach (KService::Ptr service, offers) { | ||
213 | const QString pluginName = service->property("X-KDE-PluginInfo-Name").toString(); | 213 | const QString pluginName = service->property("X-KDE-PluginInfo-Name").toString(); | ||
214 | if (service->property("X-Plasma-API").toString() != "declarativeappletscript") { | 214 | if (service->property("X-Plasma-API").toString() != "declarativeappletscript") { | ||
215 | continue; | 215 | continue; | ||
216 | } | 216 | } | ||
▲ Show 20 Lines • Show All 376 Lines • Show Last 20 Lines |