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

Method VcsProjectIntegrationPlugin

plugins/vcschangesview/vcschangesviewplugin.cpp:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47};
48
49VcsProjectIntegrationPlugin::VcsProjectIntegrationPlugin(QObject* parent, const KPluginMetaData& metaData,
50 const QVariantList&)
51 : KDevelop::IPlugin(QStringLiteral("kdevvcsprojectintegration"), parent, metaData)
52 , m_factory(new VCSProjectToolViewFactory(this))
53{
54 core()->uiController()->addToolView(i18nc("@title:window", "Project Changes"), m_factory);
55
56 QAction* synaction = actionCollection()->addAction(QStringLiteral("locate_document"));
57 synaction->setText(i18nc("@action", "Locate Current Document"));
58 synaction->setIcon(QIcon::fromTheme(QStringLiteral("dirsync")));
59 synaction->setToolTip(i18nc("@info:tooltip", "Locate the current document and select it"));
60
61 QAction* reloadaction = actionCollection()->addAction(QStringLiteral("reload_view"));
62 reloadaction->setText(i18nc("@action", "Reload View"));
63 reloadaction->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
64 reloadaction->setToolTip(i18nc("@info:tooltip", "Refresh the view for all projects, in case anything changed"));
65 connect(reloadaction, &QAction::triggered, this, [this] {
66 if (const auto model = core()->projectController()->changesModel()) {
67 model->reloadAll();
68 }
69 });
70}
71
72void VcsProjectIntegrationPlugin::unload()
73{

Callers

nothing calls this directly

Calls 9

uiControllerMethod · 0.80
setIconMethod · 0.80
setToolTipMethod · 0.80
projectControllerMethod · 0.80
addToolViewMethod · 0.45
addActionMethod · 0.45
setTextMethod · 0.45
changesModelMethod · 0.45
reloadAllMethod · 0.45

Tested by

no test coverage detected