From 84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e Mon Sep 17 00:00:00 2001 From: llornkcor Date: Thu, 21 Oct 2004 09:16:20 +0000 Subject: turn off qDebug and qWarning in release mode. This should also quiet any 3rd party applications outside opie control --- (limited to 'library/qpeapplication.cpp') diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 1117240..4adfc8f 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -780,6 +780,28 @@ 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 a QApplication, passing \a argc, \a argv, and \a t. @@ -791,6 +813,7 @@ QPEApplication::QPEApplication( int & argc, char **argv, Type t ) : QApplication( hack(argc), argv, t ), pidChannel( 0 ) { QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. + qInstallMsgHandler(qtopiaMsgHandler); d = new QPEApplicationData; d->loadTextCodecs(); -- cgit v0.9.0.2