MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / deleteTask

Method deleteTask

src/summarytree.cpp:236–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void SummaryTree::deleteTask() {
237 if (QMessageBox::warning(this, tr("LemonLime"), tr("Are you sure to delete this task?"), QMessageBox::Yes,
238 QMessageBox::Cancel) == QMessageBox::Cancel) {
239 return;
240 }
241
242 QTreeWidgetItem *curItem = currentItem();
243
244 if (indexOfTopLevelItem(curItem) == -1) {
245 curItem = curItem->parent();
246 }
247
248 int index = indexOfTopLevelItem(curItem);
249
250 if (index + 1 < topLevelItemCount()) {
251 setCurrentItem(topLevelItem(index + 1));
252 } else {
253 if (index - 1 >= 0) {
254 setCurrentItem(topLevelItem(index - 1));
255 } else {
256 setCurrentItem(nullptr);
257 }
258 }
259
260 delete curItem;
261 curContest->deleteTask(index);
262 emit taskChanged();
263}
264
265void SummaryTree::deleteTestCase() {
266 QTreeWidgetItem *curItem = currentItem();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected