summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsemanticinfoupdater.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-10-23 12:39:59 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2014-11-03 12:11:01 +0100
commit9cddeef036d95874b487f23e7c43895d45897766 (patch)
tree85b40df839d33ea78ec9028367a2b5ce8d3677bc /src/plugins/cpptools/cppsemanticinfoupdater.cpp
parent8d6b43bc2af7ad6797c818a5a4eb50499e653ca3 (diff)
downloadqt-creator-9cddeef036d95874b487f23e7c43895d45897766.tar.gz
CppTools: Make use of QLoggingCategory
...for document processing and highlighting. Change-Id: I31d42a5a5010260643ec76688080fd14a486f7e3 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppsemanticinfoupdater.cpp')
-rw-r--r--src/plugins/cpptools/cppsemanticinfoupdater.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/plugins/cpptools/cppsemanticinfoupdater.cpp b/src/plugins/cpptools/cppsemanticinfoupdater.cpp
index 3d3b5b42a6..2ee0501aa7 100644
--- a/src/plugins/cpptools/cppsemanticinfoupdater.cpp
+++ b/src/plugins/cpptools/cppsemanticinfoupdater.cpp
@@ -39,11 +39,15 @@
#include <cplusplus/CppDocument.h>
#include <cplusplus/TranslationUnit.h>
+#include <QLoggingCategory>
+
enum { debug = 0 };
using namespace CPlusPlus;
using namespace CppTools;
+static Q_LOGGING_CATEGORY(log, "qtc.cpptools.semanticinfoupdater")
+
namespace CppTools {
class SemanticInfoUpdaterPrivate
@@ -105,8 +109,7 @@ void SemanticInfoUpdaterPrivate::setSemanticInfo(const SemanticInfo &semanticInf
m_semanticInfo = semanticInfo;
}
if (emitSignal) {
- if (debug)
- qDebug() << "SemanticInfoUpdater: emiting new info";
+ qCDebug(log) << "emiting new info";
emit q->updated(semanticInfo);
}
}
@@ -115,9 +118,6 @@ SemanticInfo SemanticInfoUpdaterPrivate::update(const SemanticInfo::Source &sour
bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor)
{
- if (debug)
- qDebug() << "SemanticInfoUpdater: update() - source revision" << source.revision;
-
SemanticInfo newSemanticInfo;
newSemanticInfo.revision = source.revision;
newSemanticInfo.snapshot = source.snapshot;
@@ -130,9 +130,8 @@ SemanticInfo SemanticInfoUpdaterPrivate::update(const SemanticInfo::Source &sour
newSemanticInfo.complete = false;
newSemanticInfo.doc = doc;
- if (debug)
- qDebug() << "SemanticInfoUpdater: update() - re-calculated document. Canceled ="
- << !newSemanticInfo.complete;
+ qCDebug(log) << "update() for source revision:" << source.revision
+ << "canceled:" << !newSemanticInfo.complete;
setSemanticInfo(newSemanticInfo, emitSignalWhenFinished);
return newSemanticInfo;
@@ -156,9 +155,7 @@ bool SemanticInfoUpdaterPrivate::reuseCurrentSemanticInfo(const SemanticInfo::So
newSemanticInfo.snapshot = source.snapshot;
newSemanticInfo.doc = currentSemanticInfo.doc;
setSemanticInfo(newSemanticInfo, emitSignalWhenFinished);
- if (debug)
- qDebug() << "SemanticInfoUpdater: re-using current semantic info - source.revision"
- << source.revision;
+ qCDebug(log) << "re-using current semantic info, source revision:" << source.revision;
return true;
}
@@ -185,8 +182,7 @@ SemanticInfoUpdater::~SemanticInfoUpdater()
SemanticInfo SemanticInfoUpdater::update(const SemanticInfo::Source &source)
{
- if (debug)
- qDebug() << "SemanticInfoUpdater: update() - synchronous";
+ qCDebug(log) << "update() - synchronous";
d->m_future.cancel();
const bool emitSignalWhenFinished = false;
@@ -200,8 +196,7 @@ SemanticInfo SemanticInfoUpdater::update(const SemanticInfo::Source &source)
void SemanticInfoUpdater::updateDetached(const SemanticInfo::Source source)
{
- if (debug)
- qDebug() << "SemanticInfoUpdater: updateDetached() - asynchronous";
+ qCDebug(log) << "updateDetached() - asynchronous";
d->m_future.cancel();
const bool emitSignalWhenFinished = true;