Clean up command line options in plasma-shell

This commit is contained in:
Sebastian Kügler 2013-12-08 16:53:41 +01:00
parent d944a8f7fe
commit ba1be673e1

View File

@ -35,25 +35,25 @@ int main(int argc, char** argv)
QApplication app(argc, argv); QApplication app(argc, argv);
app.setApplicationVersion(version); app.setApplicationVersion(version);
parser.setApplicationDescription(description);
QCommandLineOption dbg = QCommandLineOption(QStringList() << QStringLiteral("d") << QCommandLineOption dbg(QStringList() << QStringLiteral("d") <<
QStringLiteral("qmljsdebugger"), QStringLiteral("qmljsdebugger"),
QStringLiteral("Enable QML Javascript debugger")); QStringLiteral("Enable QML Javascript debugger"));
QCommandLineOption windowed = QCommandLineOption(QStringList() << QStringLiteral("w") << QCommandLineOption win(QStringList() << QStringLiteral("w") <<
QStringLiteral("windowed"), QStringLiteral("windowed"),
QStringLiteral("Force a windowed view for testing purposes")); QStringLiteral("Force a windowed view for testing purposes"));
QCommandLineOption crashesOption(QStringLiteral("crashes"), QCommandLineOption crash(QStringList() << QStringLiteral("n") <<
QStringLiteral("Recent number of crashes"), QStringLiteral("crashes"),
QStringLiteral("n")); QStringLiteral("Recent number of crashes"));
parser.addVersionOption(); parser.addVersionOption();
parser.addHelpOption(); parser.addHelpOption();
parser.setApplicationDescription(description);
parser.addOption(dbg); parser.addOption(dbg);
parser.addOption(windowed); parser.addOption(win);
parser.addOption(crashesOption); parser.addOption(crash);
parser.process(app); parser.process(app);
@ -65,8 +65,8 @@ int main(int argc, char** argv)
Plasma::PluginLoader::setPluginLoader(new ShellPluginLoader); Plasma::PluginLoader::setPluginLoader(new ShellPluginLoader);
ShellManager::setCrashCount(parser.value(crashesOption).toInt()); ShellManager::setCrashCount(parser.value(crash).toInt());
ShellManager::s_forceWindowed = parser.isSet(windowed); ShellManager::s_forceWindowed = parser.isSet(win);
ShellManager::instance(); ShellManager::instance();
return app.exec(); return app.exec();