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

Method standardToolView

plugins/standardoutputview/standardoutputview.cpp:65–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65QString StandardOutputView::standardToolView(StandardToolView view)
66{
67 /// A convenience wrapper to call QIcon::fromTheme() once per standard tool view and to return the tool view ID.
68 const auto ensureRegistered = [this](QString toolViewId, const QString& title, ViewType type,
69 const QString& iconName, Options option = AddFilterAction) {
70 auto& toolView = m_toolViews[toolViewId];
71 if (!toolView) {
72 toolView = addToolView(toolViewId, title, type, QIcon::fromTheme(iconName), option);
73 }
74 return toolViewId;
75 };
76
77 switch( view )
78 {
79 case KDevelop::IOutputView::BuildView:
80 return ensureRegistered(QStringLiteral("Build"), i18nc("@title:window", "Build"), HistoryView,
81 QStringLiteral("run-build"));
82 case KDevelop::IOutputView::RunView:
83 return ensureRegistered(QStringLiteral("Run"), i18nc("@title:window", "Run"), MultipleView,
84 QStringLiteral("system-run"));
85 case KDevelop::IOutputView::DebugView:
86 return ensureRegistered(QStringLiteral("Debug"), i18nc("@title:window", "Debug"), MultipleView,
87 QStringLiteral("debug-step-into"));
88 case KDevelop::IOutputView::AnalyzeView:
89 return ensureRegistered(QStringLiteral("Analyze"), i18nc("@title:window", "Analyze"), HistoryView,
90 QStringLiteral("dialog-ok"));
91 case KDevelop::IOutputView::VcsView:
92 return ensureRegistered(QStringLiteral("VersionControl"), i18nc("@title:window", "Version Control"),
93 HistoryView, QStringLiteral("system-run"));
94 }
95 Q_UNREACHABLE();
96}
97
98void StandardOutputView::registerToolView(const QString& toolViewId, const QString& title,
99 KDevelop::IOutputView::ViewType type, const QIcon& icon, Options option,

Callers 2

startOutputMethod · 0.80
testStandardToolViewsMethod · 0.80

Calls

no outgoing calls

Tested by 1

testStandardToolViewsMethod · 0.64