comparison src/main.cpp @ 4:5c256892042c

Always silence debug output by default
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 22 Mar 2016 15:14:23 +0100
parents 8b4c49c92451
children 03dad1cff5b9
comparison
equal deleted inserted replaced
3:8b4c49c92451 4:5c256892042c
36 #else 36 #else
37 /* this is only necessary if we build statically for GNU/Linux */ 37 /* this is only necessary if we build statically for GNU/Linux */
38 // Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) 38 // Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
39 #endif 39 #endif
40 40
41 #ifdef IS_TAG_BUILD
42 bool g_debug = false; 41 bool g_debug = false;
43 #else
44 bool g_debug = true;
45 #endif
46 42
47 QtMessageHandler g_default_msg_handler = NULL; 43 QtMessageHandler g_default_msg_handler = NULL;
48 44
49 void filterDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) 45 void filterDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
50 { 46 {
122 QCommandLineParser parser; 118 QCommandLineParser parser;
123 cconvert_options(parser); 119 cconvert_options(parser);
124 120
125 parser.process(app); 121 parser.process(app);
126 122
127 #ifdef IS_TAG_BUILD 123 g_debug = parser.isSet("debug");
128 g_debug = parser.isSet(debugOpt);
129 #else
130 g_debug = true;
131 #endif
132 g_default_msg_handler = qInstallMessageHandler(filterDebugOutput); 124 g_default_msg_handler = qInstallMessageHandler(filterDebugOutput);
133 125
134 126
135 const QStringList args = parser.positionalArguments(); 127 const QStringList args = parser.positionalArguments();
136 if (args.size() > 1) { 128 if (args.size() > 1) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)