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

Method VcsChangesView

plugins/vcschangesview/vcschangesview.cpp:31–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29using namespace KDevelop;
30
31VcsChangesView::VcsChangesView(VcsProjectIntegrationPlugin* plugin, QWidget* parent)
32 : QTreeView(parent)
33 , m_model{ICore::self()->projectController()->makeChangesModel()}
34{
35 setRootIsDecorated(false);
36 setEditTriggers(QAbstractItemView::NoEditTriggers);
37 setSelectionMode(ExtendedSelection);
38 setContextMenuPolicy(Qt::CustomContextMenu);
39 setUniformRowHeights(true);
40 setTextElideMode(Qt::ElideLeft);
41 setWindowIcon(QIcon::fromTheme(QStringLiteral("exchange-positions"), windowIcon()));
42
43 connect(this, &VcsChangesView::customContextMenuRequested, this, &VcsChangesView::popupContextMenu);
44
45 const auto pluginActions = plugin->actionCollection()->actions();
46 for (QAction* action : pluginActions) {
47 addAction(action);
48 }
49
50 QAction* action = plugin->actionCollection()->action(QStringLiteral("locate_document"));
51 connect(action, &QAction::triggered, this, &VcsChangesView::selectCurrentDocument);
52 connect(this, &VcsChangesView::doubleClicked, this, &VcsChangesView::openSelected);
53
54 connect(m_model.get(), &QAbstractItemModel::rowsInserted, this, &VcsChangesView::expand);
55 setModel(m_model.get());
56}
57
58static void appendActions(QMenu* menu, const QList<QAction*>& actions)
59{

Callers

nothing calls this directly

Calls 6

makeChangesModelMethod · 0.80
projectControllerMethod · 0.80
actionsMethod · 0.45
actionCollectionMethod · 0.45
actionMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected