[plasma-shell] Add an option to suppress any output (--shut-up)

The amount of warnings that plasma-shell has, makes it super hard to
make use of tools like journalctl or to grep ~/.xsession-errors.

We need these tools to diagnose possible bugs in the session start or
any other software that redirects stderr or those places.

We can remove this option once all the Warnings are fixed, specially
the one in Qt: https://codereview.qt-project.org/#change,73943

CCMAIL: plasma-devel@kde.org
This commit is contained in:
Àlex Fiestas 2013-12-17 19:33:01 +01:00
parent 8c80c1f96c
commit c047dd5f68

View File

@ -32,6 +32,11 @@ static const char description[] = "Plasma Shell";
static const char version[] = "2.0";
static QCommandLineParser parser;
void noMessageOutput(QtMsgType type, const char *msg)
{
Q_UNUSED(type);
Q_UNUSED(msg);
}
int main(int argc, char** argv)
{
QApplication app(argc, argv);
@ -54,11 +59,15 @@ int main(int argc, char** argv)
QStringLiteral("Recent number of crashes"),
QStringLiteral("n"));
QCommandLineOption shutup(QStringList() << QStringLiteral("s") << QStringLiteral("shut-up"),
QStringLiteral("Shuts up the output"));
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(dbg);
parser.addOption(win);
parser.addOption(crash);
parser.addOption(shutup);
parser.process(app);
@ -68,6 +77,9 @@ int main(int argc, char** argv)
QQmlDebuggingEnabler enabler;
}
if (parser.isSet(shutup)) {
qInstallMsgHandler(noMessageOutput);
}
Plasma::PluginLoader::setPluginLoader(new ShellPluginLoader);
ShellManager::setCrashCount(parser.value(crash).toInt());