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

Method AbstractFileManagerPlugin

kdevplatform/project/abstractfilemanagerplugin.cpp:419–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417//BEGIN Plugin
418
419AbstractFileManagerPlugin::AbstractFileManagerPlugin(const QString& componentName, QObject* parent,
420 const KPluginMetaData& metaData, const QVariantList& /*args*/)
421 : IProjectFileManager()
422 , IPlugin(componentName, parent, metaData)
423 , d_ptr(new AbstractFileManagerPluginPrivate(this))
424{
425 connect(core()->projectController(), &IProjectController::projectClosing,
426 this, [this] (IProject* project) { Q_D(AbstractFileManagerPlugin); d->projectClosing(project); });
427 connect(core()->projectController()->projectModel(), &ProjectModel::rowsAboutToBeRemoved,
428 this, [this] (const QModelIndex& parent, int first, int last) {
429 Q_D(AbstractFileManagerPlugin);
430 // cleanup list jobs to remove about-to-be-dangling pointers
431 auto* model = core()->projectController()->projectModel();
432 for (int i = first; i <= last; ++i) {
433 const auto index = model->index(i, 0, parent);
434 auto* item = index.data(ProjectModel::ProjectItemRole).value<ProjectBaseItem*>();
435 Q_ASSERT(item);
436 for (auto* job : d->m_projectJobs.value(item->project())) {
437 job->handleRemovedItem(item);
438 }
439 }
440 });
441}
442
443AbstractFileManagerPlugin::~AbstractFileManagerPlugin() = default;
444

Callers

nothing calls this directly

Calls 8

projectControllerMethod · 0.80
handleRemovedItemMethod · 0.80
projectClosingMethod · 0.45
projectModelMethod · 0.45
indexMethod · 0.45
dataMethod · 0.45
valueMethod · 0.45
projectMethod · 0.45

Tested by

no test coverage detected