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

Method mergeView

kdevplatform/shell/mainwindow_p.cpp:163–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void MainWindowPrivate::mergeView(Sublime::View* view)
164{
165 // If the previous view was KXMLGUIClient, remove its actions
166 // In the case that that view was removed, lastActiveView
167 // will auto-reset, and xmlguifactory will disconnect that
168 // client, I think.
169 if (lastXMLGUIClientView)
170 {
171 qCDebug(SHELL) << "clearing last XML GUI client" << lastXMLGUIClientView;
172
173 m_mainWindow->guiFactory()->removeClient(dynamic_cast<KXMLGUIClient*>(lastXMLGUIClientView));
174
175 disconnect (lastXMLGUIClientView, &QWidget::destroyed, this, nullptr);
176
177 lastXMLGUIClientView = nullptr;
178 }
179
180 if (!view)
181 return;
182
183 QWidget* viewWidget = view->widget();
184 Q_ASSERT(viewWidget);
185
186 qCDebug(SHELL) << "changing active view to" << view << "doc" << view->document() << "mw" << m_mainWindow;
187
188 // If the new view is KXMLGUIClient, add it.
189 if (auto* c = dynamic_cast<KXMLGUIClient*>(viewWidget))
190 {
191 qCDebug(SHELL) << "setting new XMLGUI client" << viewWidget;
192 lastXMLGUIClientView = viewWidget;
193 m_mainWindow->guiFactory()->addClient(c);
194 connect(viewWidget, &QWidget::destroyed,
195 this, &MainWindowPrivate::xmlguiclientDestroyed);
196 }
197}
198
199void MainWindowPrivate::xmlguiclientDestroyed(QObject* obj)
200{

Callers

nothing calls this directly

Calls 3

guiFactoryMethod · 0.80
widgetMethod · 0.45
documentMethod · 0.45

Tested by

no test coverage detected