From 3b92aab215d54a03ed0446ff32e36be91786e5d5 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 6 Jan 2011 18:34:06 +0100 Subject: [PATCH] classview: minor cleanup --- src/plugins/classview/classviewmanager.cpp | 25 ++++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/plugins/classview/classviewmanager.cpp b/src/plugins/classview/classviewmanager.cpp index e84f5e40c6d..a4adcc33aee 100644 --- a/src/plugins/classview/classviewmanager.cpp +++ b/src/plugins/classview/classviewmanager.cpp @@ -85,9 +85,6 @@ struct ManagerPrivate //! separate thread for the parser QThread parserThread; - //! cpp code model manager - QPointer codeModelManager; - //! there is some massive operation ongoing so temporary we should wait bool disableCodeParser; }; @@ -166,21 +163,10 @@ void Manager::initialize() connect(core->progressManager(), SIGNAL(allTasksFinished(QString)), SLOT(onAllTasksFinished(QString)), Qt::QueuedConnection); - // connect to the cpp model manager for signals about document updates - d_ptr->codeModelManager = CPlusPlus::CppModelManagerInterface::instance(); - - // when code manager signals that document is updated - handle it by ourselves - connect(d_ptr->codeModelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), - SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)), Qt::QueuedConnection); - // when we signals that really document is updated - sent it to the parser connect(this, SIGNAL(requestDocumentUpdated(CPlusPlus::Document::Ptr)), &d_ptr->parser, SLOT(parseDocument(CPlusPlus::Document::Ptr)), Qt::QueuedConnection); - // - connect(d_ptr->codeModelManager, SIGNAL(aboutToRemoveFiles(QStringList)), - &d_ptr->parser, SLOT(removeFiles(QStringList)), Qt::QueuedConnection); - // translate data update from the parser to listeners connect(&d_ptr->parser, SIGNAL(treeDataUpdate(QSharedPointer)), this, SLOT(onTreeDataUpdate(QSharedPointer)), Qt::QueuedConnection); @@ -204,6 +190,17 @@ void Manager::initialize() // flat mode request connect(this, SIGNAL(requestSetFlatMode(bool)), &d_ptr->parser, SLOT(setFlatMode(bool)), Qt::QueuedConnection); + + // connect to the cpp model manager for signals about document updates + CPlusPlus::CppModelManagerInterface *codeModelManager + = CPlusPlus::CppModelManagerInterface::instance(); + + // when code manager signals that document is updated - handle it by ourselves + connect(codeModelManager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)), + SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)), Qt::QueuedConnection); + // + connect(codeModelManager, SIGNAL(aboutToRemoveFiles(QStringList)), + &d_ptr->parser, SLOT(removeFiles(QStringList)), Qt::QueuedConnection); } bool Manager::state() const