MCPcopy Create free account
hub / github.com/Kitware/ParaView / onDeleteMacroTriggered

Method onDeleteMacroTriggered

Qt/Python/pqPythonMacroSupervisor.cxx:416–450  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

414}
415//----------------------------------------------------------------------------
416void 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//----------------------------------------------------------------------------
452void pqPythonMacroSupervisor::onEditMacroTriggered()
453{

Callers

nothing calls this directly

Calls 6

removeMacroMethod · 0.95
QFileInfoClass · 0.85
getSupportedIconFormatsFunction · 0.85
absoluteFilePathMethod · 0.80
valueMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected