Merge "Merge remote-tracking branch 'origin/11.0'"

This commit is contained in:
The Qt Project
2023-07-13 08:15:34 +00:00
39 changed files with 157 additions and 109 deletions

View File

@@ -34,7 +34,7 @@ public:
private:
CppEditor::SymbolFinder m_symbolFinder;
QString m_className;
const CPlusPlus::Snapshot &m_snapshot;
CPlusPlus::Snapshot m_snapshot;
QMap<QString, QtTestCodeLocationAndType> m_privSlots;
bool m_valid = false;
bool m_inherited = false;

View File

@@ -93,7 +93,7 @@ void TestCodeParser::syncTestFrameworks(const QList<ITestParser *> &parsers)
{
if (m_parserState != Idle) {
// there's a running parse
m_postponedUpdateType = UpdateType::NoUpdate;
m_postponedUpdateType = UpdateType::FullUpdate;
m_postponedFiles.clear();
ProgressManager::cancelTasks(Constants::TASK_PARSE);
}

View File

@@ -4,7 +4,9 @@
#include "testprojectsettings.h"
#include "autotestconstants.h"
#include "testcodeparser.h"
#include "testframeworkmanager.h"
#include "testtreemodel.h"
#include <projectexplorer/project.h>
#include <projectexplorer/projectmanager.h>
@@ -49,7 +51,9 @@ void TestProjectSettings::activateFramework(const Id &id, bool activate)
{
ITestFramework *framework = TestFrameworkManager::frameworkForId(id);
m_activeTestFrameworks[framework] = activate;
if (!activate)
if (TestTreeModel::instance()->parser()->isParsing())
framework->rootNode()->markForRemoval(!activate);
else if (!activate)
framework->resetRootNode();
}

View File

@@ -214,12 +214,16 @@ bool TestTreeItem::modifyLineAndColumn(const TestParseResult *result)
void TestTreeItem::markForRemoval(bool mark)
{
m_status = mark ? MarkedForRemoval : Cleared;
if (type() == Root)
m_status = mark ? ForcedRootRemoval : NewlyAdded;
else
m_status = mark ? MarkedForRemoval : Cleared;
}
void TestTreeItem::markForRemovalRecursively(bool mark)
{
markForRemoval(mark);
if (type() != Root)
markForRemoval(mark);
for (int row = 0, count = childCount(); row < count; ++row)
childItem(row)->markForRemovalRecursively(mark);
}
@@ -231,7 +235,8 @@ void TestTreeItem::markForRemovalRecursively(const QSet<FilePath> &filePaths)
child->markForRemovalRecursively(filePaths);
mark &= child->markedForRemoval();
});
markForRemoval(mark);
if (type() != Root)
markForRemoval(mark);
}
TestTreeItem *TestTreeItem::childItem(int at) const

View File

@@ -167,6 +167,7 @@ private:
{
NewlyAdded,
MarkedForRemoval,
ForcedRootRemoval, // only valid on rootNode
Cleared
};

View File

@@ -485,6 +485,10 @@ void TestTreeModel::markForRemoval(const QSet<Utils::FilePath> &filePaths)
void TestTreeModel::sweep()
{
for (TestTreeItem *frameworkRoot : frameworkRootNodes()) {
if (frameworkRoot->m_status == TestTreeItem::ForcedRootRemoval) {
frameworkRoot->framework()->resetRootNode();
continue;
}
sweepChildren(frameworkRoot);
revalidateCheckState(frameworkRoot);
}