----------------------------------------------------------------------------
| 414 | } |
| 415 | //---------------------------------------------------------------------------- |
| 416 | void pqPythonMacroSupervisor::onDeleteMacroTriggered() |
| 417 | { |
| 418 | QObject* action = this->sender(); |
| 419 | QList<QString> listOfMacroToDelete; |
| 420 | QMap<QString, QPointer<QAction>>::const_iterator itr = |
| 421 | this->Internal->DeleteActionMap.constBegin(); |
| 422 | for (; itr != this->Internal->DeleteActionMap.constEnd(); ++itr) |
| 423 | { |
| 424 | if (itr.value() == action) |
| 425 | { |
| 426 | const QString& filename = itr.key(); |
| 427 | listOfMacroToDelete.append(filename); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | for (const QString& filename : listOfMacroToDelete) |
| 432 | { |
| 433 | // look for related file with same basename (as icon file) |
| 434 | QDir dir = QFileInfo(filename).absoluteDir(); |
| 435 | QStringList filter; |
| 436 | filter << QFileInfo(filename).completeBaseName() + ".py"; |
| 437 | for (const auto& extension : pqIconListModel::getSupportedIconFormats()) |
| 438 | { |
| 439 | filter << QFileInfo(filename).completeBaseName() + extension; |
| 440 | } |
| 441 | auto fileList = dir.entryInfoList(filter); |
| 442 | |
| 443 | for (const auto& file : fileList) |
| 444 | { |
| 445 | pqPythonMacroSupervisor::hideFile(file.absoluteFilePath()); |
| 446 | } |
| 447 | |
| 448 | this->removeMacro(filename); |
| 449 | } |
| 450 | } |
| 451 | //---------------------------------------------------------------------------- |
| 452 | void pqPythonMacroSupervisor::onEditMacroTriggered() |
| 453 | { |
nothing calls this directly
no test coverage detected