forked from qt-creator/qt-creator
classview: minor cleanup
This commit is contained in:
@@ -85,9 +85,6 @@ struct ManagerPrivate
|
|||||||
//! separate thread for the parser
|
//! separate thread for the parser
|
||||||
QThread parserThread;
|
QThread parserThread;
|
||||||
|
|
||||||
//! cpp code model manager
|
|
||||||
QPointer<CPlusPlus::CppModelManagerInterface> codeModelManager;
|
|
||||||
|
|
||||||
//! there is some massive operation ongoing so temporary we should wait
|
//! there is some massive operation ongoing so temporary we should wait
|
||||||
bool disableCodeParser;
|
bool disableCodeParser;
|
||||||
};
|
};
|
||||||
@@ -166,21 +163,10 @@ void Manager::initialize()
|
|||||||
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
|
connect(core->progressManager(), SIGNAL(allTasksFinished(QString)),
|
||||||
SLOT(onAllTasksFinished(QString)), Qt::QueuedConnection);
|
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
|
// when we signals that really document is updated - sent it to the parser
|
||||||
connect(this, SIGNAL(requestDocumentUpdated(CPlusPlus::Document::Ptr)),
|
connect(this, SIGNAL(requestDocumentUpdated(CPlusPlus::Document::Ptr)),
|
||||||
&d_ptr->parser, SLOT(parseDocument(CPlusPlus::Document::Ptr)), Qt::QueuedConnection);
|
&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
|
// translate data update from the parser to listeners
|
||||||
connect(&d_ptr->parser, SIGNAL(treeDataUpdate(QSharedPointer<QStandardItem>)),
|
connect(&d_ptr->parser, SIGNAL(treeDataUpdate(QSharedPointer<QStandardItem>)),
|
||||||
this, SLOT(onTreeDataUpdate(QSharedPointer<QStandardItem>)), Qt::QueuedConnection);
|
this, SLOT(onTreeDataUpdate(QSharedPointer<QStandardItem>)), Qt::QueuedConnection);
|
||||||
@@ -204,6 +190,17 @@ void Manager::initialize()
|
|||||||
// flat mode request
|
// flat mode request
|
||||||
connect(this, SIGNAL(requestSetFlatMode(bool)),
|
connect(this, SIGNAL(requestSetFlatMode(bool)),
|
||||||
&d_ptr->parser, SLOT(setFlatMode(bool)), Qt::QueuedConnection);
|
&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
|
bool Manager::state() const
|
||||||
|
|||||||
Reference in New Issue
Block a user