Commit 3b92aab2 authored by hjk's avatar hjk

classview: minor cleanup

parent a7098c69
......@@ -85,9 +85,6 @@ struct ManagerPrivate
//! separate thread for the parser
QThread parserThread;
//! cpp code model manager
QPointer<CPlusPlus::CppModelManagerInterface> 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<QStandardItem>)),
this, SLOT(onTreeDataUpdate(QSharedPointer<QStandardItem>)), 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment