MCPcopy Create free account
hub / github.com/KDE/kdevelop / deleteWorkingSet

Method deleteWorkingSet

kdevplatform/shell/tests/test_workingsets.cpp:125–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void TestWorkingSetController::deleteWorkingSet()
126{
127 // Create a persistent working set
128 m_area->setWorkingSet(setName2);
129 auto set2 = m_workingSetCtrl->workingSet(m_area->workingSet());
130 set2->setPersistent(true);
131 m_documentCtrl->openDocument(QUrl::fromLocalFile(m_file.fileName()));
132
133 // Create and activate another persistent working set
134 m_area->setWorkingSet(setName);
135 auto set = m_workingSetCtrl->workingSet(m_area->workingSet());
136 set->setPersistent(true);
137 m_documentCtrl->openDocument(QUrl::fromLocalFile(m_file.fileName()));
138
139 QTRY_COMPARE(m_closedSets->layout()->count(), 1); // working set 2 (1 is active)
140
141 // Delete the first set
142 set2->deleteSet(false);
143 // Try deleting the active set
144 set->deleteSet(false);
145
146 QCOMPARE(m_closedSets->layout()->count(), 0); // no closed working set
147
148 restartSession();
149
150 const auto sets = m_workingSetCtrl->allWorkingSets();
151 QVERIFY(std::any_of(sets.constBegin(), sets.constEnd(), [&](WorkingSet* set){ return set->id() == setName; }));
152 QVERIFY(std::none_of(sets.constBegin(), sets.constEnd(), [&](WorkingSet* set){ return set->id() == setName2; }));
153
154 QCOMPARE(m_closedSets->layout()->count(), 0); // no closed working set
155}
156
157void TestWorkingSetController::switchArea()
158{

Callers

nothing calls this directly

Calls 11

setPersistentMethod · 0.80
deleteSetMethod · 0.80
allWorkingSetsMethod · 0.80
constBeginMethod · 0.80
constEndMethod · 0.80
setWorkingSetMethod · 0.45
workingSetMethod · 0.45
openDocumentMethod · 0.45
fileNameMethod · 0.45
countMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected