Plasma
Go to the documentation of this file.
17 #include <QCoreApplication>
18 #include <QTextStream>
24 #include <kaboutdata.h>
25 #include <kcmdlineargs.h>
26 #include <kdesktopfile.h>
27 #include <kconfiggroup.h>
29 #include "private/componentinstaller_p.h"
33 KDesktopFile desktop(desktopFile);
34 KConfigGroup desktopGroup = desktop.desktopGroup();
35 if (desktopGroup.readEntry(
"X-KDE-ServiceTypes", QStringList())
36 .contains(
"Plasma/ScriptEngine")
37 || desktopGroup.readEntry(
"ServiceTypes", QStringList())
38 .contains(
"Plasma/ScriptEngine")) {
43 return desktopGroup.readEntry(
"X-Plasma-API", QString());
47 const QString &desktopFile)
49 if (!deps.isEmpty()) {
50 KDesktopFile desktop(desktopFile);
51 desktop.desktopGroup().writeEntry(
"X-Plasma-RequiredDataEngines", deps);
55 int main(
int argc,
char **argv)
57 KAboutData aboutData(
"plasma-dataengine-depextractor", QByteArray(),
58 ki18n(
"Plasma Data Engine dependency extractor"),
60 ki18n(
"Plasma Data Engine dependency extractor"));
61 aboutData.addAuthor(ki18n(
"Kevin Kofler"), ki18n(
"Author"),
62 "kevin.kofler@chello.at");
64 KCmdLineArgs::init(argc, argv, &aboutData);
65 KCmdLineOptions options;
66 options.add(
"+[path]",
67 ki18n(
"Source path (default: .)"));
68 options.add(
"+[file]",
69 ki18n(
".desktop rel. to path (default: metadata.desktop)")
71 KCmdLineArgs::addCmdLineOptions(options);
73 QCoreApplication *app =
new QCoreApplication(KCmdLineArgs::qtArgc(),
74 KCmdLineArgs::qtArgv());
76 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
80 QString path, desktopFile;
81 int argCount = args->count();
85 desktopFile =
"metadata.desktop";
89 desktopFile =
"metadata.desktop";
93 desktopFile = args->arg(1);
97 QTextStream err(stderr, QIODevice::WriteOnly | QIODevice::Text);
98 err << i18n(
"Expected at most 2 arguments, but %1 given", argCount)
106 if (QFileInfo(desktopFile).isRelative())
107 desktopFile = QDir(path).absoluteFilePath(desktopFile);
109 if (QFileInfo(desktopFile).exists()) {
111 ->extractDataEngineDependencies(
116 QTextStream err(stderr, QIODevice::WriteOnly | QIODevice::Text);
117 err << i18n(
"Desktop file \"%1\" not found", desktopFile) << endl;
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Jun 5 2015 00:16:04 by
doxygen 1.8.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.