author | llornkcor <llornkcor> | 2004-10-21 09:16:20 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-10-21 09:16:20 (UTC) |
commit | 84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e (patch) (side-by-side diff) | |
tree | f826a49b2875e416b02dec228280c4958f25ac8b /library/qpeapplication.cpp | |
parent | 8232b072180742d87a8e543b6968e9c4109c0612 (diff) | |
download | opie-84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e.zip opie-84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e.tar.gz opie-84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e.tar.bz2 |
turn off qDebug and qWarning in release mode. This should also quiet any 3rd party applications outside opie control
-rw-r--r-- | library/qpeapplication.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 1117240..4adfc8f 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -781,4 +781,26 @@ static void qtopia_loadTranslations( const QStringList& qms ) #endif +/* + Turn off qDebug in release mode + */ +static void qtopiaMsgHandler(QtMsgType type, const char* msg) +{ + switch ( type ) { + case QtDebugMsg: +#ifdef QT_DEBUG + fprintf( stderr, "Debug: %s\n", msg ); +#endif + break; + case QtWarningMsg: +#ifdef QT_DEBUG + fprintf( stderr, "Warning: %s\n", msg ); +#endif + break; + case QtFatalMsg: + fprintf( stderr, "Fatal: %s\n", msg ); + abort(); + } +} + /*! Constructs a QPEApplication just as you would construct @@ -792,4 +814,5 @@ QPEApplication::QPEApplication( int & argc, char **argv, Type t ) { QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. + qInstallMsgHandler(qtopiaMsgHandler); d = new QPEApplicationData; |