| 338 | } |
| 339 | |
| 340 | void Project::remove(const QString &fileName) |
| 341 | { |
| 342 | auto path = QFileInfo(fileName).absoluteFilePath(); |
| 343 | if (!contains(path)) { |
| 344 | return; |
| 345 | } |
| 346 | |
| 347 | // Make sure we also remove any unused dirs |
| 348 | auto node = entries[path]; |
| 349 | if (node->text() == "_mooc" || node->text() == "_coursera") { |
| 350 | delete mooc; |
| 351 | mooc = nullptr; |
| 352 | emit moocChanged(mooc); |
| 353 | } |
| 354 | while (getType(node->parent()->index()) == NodeType::Dir && node->parent()->rowCount() <= 1) { |
| 355 | node = node->parent(); |
| 356 | } |
| 357 | auto parent = node->parent(); |
| 358 | parent->removeRow(node->row()); |
| 359 | if (parent->data(Role::Type) == "group" && !parent->hasChildren()) { |
| 360 | parent->setFlags(Qt::NoItemFlags); |
| 361 | } |
| 362 | entries.remove(path); |
| 363 | |
| 364 | if (!projectFile().isEmpty()) { |
| 365 | setModified(true); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | void Project::remove(const QStringList &fileNames) |
| 370 | { |
no outgoing calls
no test coverage detected