[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/io
From:       David Faure <faure () kde ! org>
Date:       2010-11-05 18:37:18
Message-ID: 20101105183718.EFCE1AC89B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1193366 by dfaure:

Make Block a no-op at runtime if the corresponding debug area is disabled.


 M  +6 -0      kdebug.cpp  


--- trunk/KDE/kdelibs/kdecore/io/kdebug.cpp #1193365:1193366
@@ -858,14 +858,19 @@
 KDebug::Block::Block(const char* label, int area)
     : m_label(label), m_area(area), d(0)
 {
+    if (hasNullOutputQtDebugMsg(area)) {
+        m_label = 0; // remember, for the dtor
+    } else {
     m_startTime.start();
     kDebug(area) << "BEGIN:" << label;
     QMutexLocker locker(&kDebug_data->mutex);
     kDebug_data->m_indentString += QLatin1String("  ");
 }
+}
 
 KDebug::Block::~Block()
 {
+    if (m_label) {
     const double duration = (double)m_startTime.elapsed() / (double)1000.0;
     kDebug_data->mutex.lock();
     kDebug_data->m_indentString.chop(2);
@@ -884,3 +889,4 @@
             << QString::fromLatin1("[DELAY Took (quite long) \
%3s]").arg(QString::number(duration, 'g', 2));  }
 }
+}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic