Remove useless member

No need to have another member variable for almost the same
functionality. Consolidated where necessary.

Change-Id: Iefaa410fea527f88b18b406199a449fc9e4d0533
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-02-20 09:11:33 +01:00
parent 9eb6167189
commit 2b8d6c5fc4
2 changed files with 7 additions and 9 deletions

View File

@@ -56,7 +56,6 @@ TestCodeParser::TestCodeParser(TestTreeModel *parent)
: QObject(parent),
m_model(parent),
m_parserEnabled(true),
m_pendingUpdate(false),
m_fullUpdatePostPoned(false),
m_partialUpdatePostPoned(false),
m_dirty(true),
@@ -89,7 +88,7 @@ void TestCodeParser::setState(State state)
{
m_parserState = state;
if (m_parserState == Disabled) {
m_pendingUpdate = m_fullUpdatePostPoned = m_partialUpdatePostPoned = false;
m_fullUpdatePostPoned = m_partialUpdatePostPoned = false;
m_postPonedFiles.clear();
} else if (m_parserState == Idle && m_dirty && currentProject()) {
scanForTests(m_postPonedFiles.toList());
@@ -104,14 +103,14 @@ void TestCodeParser::emitUpdateTestTree()
void TestCodeParser::updateTestTree()
{
if (!m_parserEnabled) {
m_pendingUpdate = true;
m_fullUpdatePostPoned = true;
return;
}
if (ProjectExplorer::Project *project = currentProject()) {
if (auto qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(project)) {
if (qmakeProject->asyncUpdateState() != QmakeProjectManager::QmakeProject::Base) {
m_pendingUpdate = true;
m_fullUpdatePostPoned = true;
return;
}
connect(qmakeProject, &QmakeProjectManager::QmakeProject::proFilesEvaluated,
@@ -120,7 +119,7 @@ void TestCodeParser::updateTestTree()
} else
return;
m_pendingUpdate = false;
m_fullUpdatePostPoned = false;
clearCache();
emit cacheCleared();
@@ -476,7 +475,7 @@ void TestCodeParser::handleQtQuickTest(CPlusPlus::Document::Ptr document)
void TestCodeParser::onCppDocumentUpdated(const CPlusPlus::Document::Ptr &document)
{
if (!m_parserEnabled) {
if (!m_pendingUpdate) {
if (!m_fullUpdatePostPoned) {
m_partialUpdatePostPoned = true;
m_postPonedFiles.insert(document->fileName());
}
@@ -501,7 +500,7 @@ void TestCodeParser::onCppDocumentUpdated(const CPlusPlus::Document::Ptr &docume
void TestCodeParser::onQmlDocumentUpdated(const QmlJS::Document::Ptr &document)
{
if (!m_parserEnabled) {
if (!m_pendingUpdate) {
if (!m_fullUpdatePostPoned) {
m_partialUpdatePostPoned = true;
m_postPonedFiles.insert(document->fileName());
}
@@ -726,7 +725,7 @@ void TestCodeParser::onAllTasksFinished(Core::Id type)
if (type != CppTools::Constants::TASK_INDEX)
return;
m_parserEnabled = true;
if (m_pendingUpdate)
if (m_fullUpdatePostPoned)
updateTestTree();
else if (m_partialUpdatePostPoned) {
m_partialUpdatePostPoned = false;

View File

@@ -110,7 +110,6 @@ private:
QMap<QString, TestInfo> m_quickDocMap;
QList<UnnamedQuickTestInfo> m_unnamedQuickDocList;
bool m_parserEnabled;
bool m_pendingUpdate;
bool m_fullUpdatePostPoned;
bool m_partialUpdatePostPoned;
bool m_dirty;