MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / start

Method start

src/plugins/collaborators/collaborators.cpp:19–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19bool Collaborators::start()
20{
21 auto &ctx = dpfInstance.serviceContext();
22 WindowService *windowService = ctx.service<WindowService>(WindowService::name());
23 if (windowService) {
24 if (windowService->addNavigationItem) {
25 QAction *actionGit = new QAction(MWNA_GIT, this);
26 actionGit->setIcon(QIcon::fromTheme("git-navigation"));
27
28#ifdef ENABLE_SVN // TODO(Any): svn should not contained in this plugin.
29 QAction *actionSvn = new QAction(MWNA_SVN, this);
30 actionSvn->setIcon(QIcon::fromTheme("svn-navigation"));
31 windowService->addNavigationItem(new AbstractAction(actionSvn), Priority::medium);
32 AbstractWidget *svnMainWidgetImpl = new AbstractWidget(CVSkeeper::instance()->svnMainWidget());
33 windowService->registerWidget(MWNA_SVN, svnMainWidgetImpl);
34 connect(actionSvn, &QAction::triggered, this, [=](){
35 windowService->replaceWidget(MWNA_SVN,
36 Position::FullWindow);
37 windowService->hideStatusBar();
38 }, Qt::DirectConnection);
39#endif
40
41 windowService->addNavigationItem(new AbstractAction(actionGit), Priority::medium);
42
43 std::function<AbstractWidget *()> gitCreator = []()->AbstractWidget* {
44 return new AbstractWidget(CVSkeeper::instance()->gitMainWidget());
45 };
46 windowService->registerWidgetCreator(MWNA_GIT, gitCreator);
47
48 connect(actionGit, &QAction::triggered, this, [=](){
49 windowService->replaceWidget(MWNA_GIT,
50 Position::FullWindow);
51 windowService->hideStatusBar();
52 }, Qt::DirectConnection);
53 }
54 }
55 return true;
56}
57
58dpf::Plugin::ShutdownFlag Collaborators::stop()
59{

Callers 12

loadRevisionFilesMethod · 0.45
reloadRevisionFilesMethod · 0.45
loadHistoryMethod · 0.45
reloadHistoryMethod · 0.45
doUpdateReposMethod · 0.45
doAmendsCommitMethod · 0.45
doAmendsRevertAllMethod · 0.45
doDiffFileAtRevisionMethod · 0.45
testUserLogginMethod · 0.45
addMethod · 0.45
revertMethod · 0.45
doCheckoutReposMethod · 0.45

Calls 10

connectFunction · 0.85
addNavigationItemMethod · 0.80
svnMainWidgetMethod · 0.80
hideStatusBarMethod · 0.80
gitMainWidgetMethod · 0.80
registerWidgetCreatorMethod · 0.80
nameFunction · 0.50
setIconMethod · 0.45
registerWidgetMethod · 0.45
replaceWidgetMethod · 0.45

Tested by

no test coverage detected