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

Method addMainWindow

kdevplatform/sublime/controller.cpp:237–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void Controller::addMainWindow(MainWindow* mainWindow)
238{
239 Q_D(Controller);
240
241 Q_ASSERT(mainWindow);
242
243 Q_ASSERT (!d->controlledWindows.contains(mainWindow));
244 d->controlledWindows << mainWindow;
245 d->mainWindowAreas.resize(d->controlledWindows.size());
246 int index = d->controlledWindows.size()-1;
247
248 auto& mainWindowAreas = d->mainWindowAreas[index];
249 const auto& defaultAreas = this->defaultAreas();
250 d->allAreas.reserve(d->allAreas.size() + defaultAreas.size());
251 mainWindowAreas.reserve(defaultAreas.size());
252
253 for (const auto* area : defaultAreas) {
254 Area *na = new Area(*area);
255 d->allAreas.append(na);
256 mainWindowAreas.append(na);
257 emit areaCreated(na);
258 }
259 showAreaInternal(d->mainWindowAreas[index][0], mainWindow);
260 emit mainWindowAdded( mainWindow );
261}
262
263void Controller::areaReleased()
264{

Callers 4

UiControllerPrivateMethod · 0.80
viewActivationMethod · 0.80

Calls 4

containsMethod · 0.45
sizeMethod · 0.45
reserveMethod · 0.45
appendMethod · 0.45

Tested by 3

viewActivationMethod · 0.64