Blob Blame History Raw
From 1d79c645ffbd858517f07cee3143dc64fac7c3e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <dvratil@redhat.com>
Date: Mon, 10 Nov 2014 11:51:45 +0100
Subject: [PATCH 11/30] Convert some qDebugs to akDebugs

This should make Akonadi in release mode even less chatty.
---
 server/src/handler/merge.cpp        |  3 ++-
 server/src/handler/modify.cpp       |  6 +++---
 server/src/handler/remove.cpp       |  4 ++--
 server/src/search/searchmanager.cpp | 12 ++++++------
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/server/src/handler/merge.cpp b/server/src/handler/merge.cpp
index fffe100..c26917d 100644
--- a/server/src/handler/merge.cpp
+++ b/server/src/handler/merge.cpp
@@ -328,8 +328,9 @@ bool Merge::parseStream()
       }
 
     } else {
+      akDebug() << "Multiple merge candidates:";
       Q_FOREACH (const PimItem &item, result) {
-          qDebug() << item.id() << item.remoteId() << item.gid();
+          akDebug() << "\t" << item.id() << item.remoteId() << item.gid();
       }
       // Nor GID or RID are guaranteed to be unique, so make sure we don't merge
       // something we don't want
diff --git a/server/src/handler/modify.cpp b/server/src/handler/modify.cpp
index 9671fb9..ad329db 100644
--- a/server/src/handler/modify.cpp
+++ b/server/src/handler/modify.cpp
@@ -216,9 +216,9 @@ bool Modify::parseStream()
 
       queryAttributes = attrs.join( QLatin1String( " " ) );
 
-      qDebug() << collection.queryAttributes() << queryAttributes;
-      qDebug() << collection.queryCollections() << queryCollections;
-      qDebug() << collection.queryString() << queryString;
+      akDebug() << collection.queryAttributes() << queryAttributes;
+      akDebug() << collection.queryCollections() << queryCollections;
+      akDebug() << collection.queryString() << queryString;
 
       if ( collection.queryAttributes() != queryAttributes
           || collection.queryCollections() != queryCollections
diff --git a/server/src/handler/remove.cpp b/server/src/handler/remove.cpp
index 090531f..daec5a0 100644
--- a/server/src/handler/remove.cpp
+++ b/server/src/handler/remove.cpp
@@ -40,8 +40,8 @@ bool Remove::parseStream()
 {
   mScope.parseScope( m_streamParser );
   connection()->context()->parseContext( m_streamParser );
-  qDebug() << "Tag context:" << connection()->context()->tagId();
-  qDebug() << "Collection context: " << connection()->context()->collectionId();
+  akDebug() << "Tag context:" << connection()->context()->tagId();
+  akDebug() << "Collection context: " << connection()->context()->collectionId();
 
 
   SelectQueryBuilder<PimItem> qb;
diff --git a/server/src/search/searchmanager.cpp b/server/src/search/searchmanager.cpp
index 35e76e1..c821aa3 100644
--- a/server/src/search/searchmanager.cpp
+++ b/server/src/search/searchmanager.cpp
@@ -159,7 +159,7 @@ void SearchManager::loadSearchPlugins()
   Q_FOREACH ( const QString &pluginDir, dirs ) {
     QDir dir( pluginDir + QLatin1String( "/akonadi" ) );
     const QStringList desktopFiles = dir.entryList( QStringList() << QLatin1String( "*.desktop" ), QDir::Files );
-    qDebug() << "SEARCH MANAGER: searching in " << pluginDir + QLatin1String( "/akonadi" ) << ":" << desktopFiles;
+    akDebug() << "SEARCH MANAGER: searching in " << pluginDir + QLatin1String( "/akonadi" ) << ":" << desktopFiles;
 
     Q_FOREACH ( const QString &desktopFileName, desktopFiles ) {
       QSettings desktop( pluginDir + QLatin1String( "/akonadi/" ) + desktopFileName, QSettings::IniFormat );
@@ -170,13 +170,13 @@ void SearchManager::loadSearchPlugins()
 
       const QString libraryName = desktop.value( QLatin1String( "X-Akonadi-Library" ) ).toString();
       if ( loadedPlugins.contains( libraryName ) ) {
-        qDebug() << "Already loaded one version of this plugin, skipping: " << libraryName;
+        akDebug() << "Already loaded one version of this plugin, skipping: " << libraryName;
         continue;
       }
       // When search plugin override is active, ignore all plugins except for the override
       if ( !pluginOverride.isEmpty() ) {
         if ( libraryName != pluginOverride ) {
-          qDebug() << desktopFileName << "skipped because of AKONADI_OVERRIDE_SEARCHPLUGIN";
+          akDebug() << desktopFileName << "skipped because of AKONADI_OVERRIDE_SEARCHPLUGIN";
           continue;
         }
 
@@ -198,7 +198,7 @@ void SearchManager::loadSearchPlugins()
         continue;
       }
 
-      qDebug() << "SearchManager: loaded search plugin" << libraryName;
+      akDebug() << "SearchManager: loaded search plugin" << libraryName;
       mPlugins << plugin;
       loadedPlugins << libraryName;
     }
@@ -390,7 +390,7 @@ void SearchManager::searchUpdateResultsAvailable( const QSet<qint64> &results )
     }
   }
 
-  qDebug() << "Got" << newMatches.count() << "results, out of which" << existingMatches.count() << "are already in the collection";
+  akDebug() << "Got" << newMatches.count() << "results, out of which" << existingMatches.count() << "are already in the collection";
 
   newMatches = newMatches - existingMatches;
 
@@ -405,7 +405,7 @@ void SearchManager::searchUpdateResultsAvailable( const QSet<qint64> &results )
     Collection::addPimItem( collection.id(), id );
   }
 
-  qDebug() << "Added" << newMatches.count();
+  akDebug() << "Added" << newMatches.count();
 
   if ( !existingTransaction && !DataStore::self()->commitTransaction() ) {
     akDebug() << "Failed to commit transaction";
-- 
2.1.0