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

Method setArea

kdevplatform/sublime/mainwindow.cpp:131–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void MainWindow::setArea(Area *area)
132{
133 Q_D(MainWindow);
134
135 if (d->area) {
136 // Disconnect the previous area. We really do not want to mess with
137 // the main window if an area not visible now is modified. Further,
138 // if setArea() is called with the same area as is current
139 // now, we do not want to connect to the same signals twice.
140 disconnect(d->area, nullptr, d, nullptr);
141 }
142
143 bool differentArea = (area != d->area);
144 if (d->autoAreaSettingsSave && differentArea)
145 saveSettings();
146
147 HoldUpdates hu(this);
148 if (d->area)
149 clearArea();
150 d->area = area;
151 d->reconstruct();
152
153 if(d->area->activeView())
154 activateView(d->area->activeView());
155 else
156 d->activateFirstVisibleView();
157
158 initializeStatusBar();
159 emit areaChanged(area);
160
161 hu.stop();
162
163 loadSettings();
164 connect(area, &Area::viewAdded, d, &MainWindowPrivate::viewAdded);
165 connect(area, &Area::viewRemoved, d, &MainWindowPrivate::viewRemovedInternal);
166 connect(area, &Area::requestToolViewRaise, d, &MainWindowPrivate::raiseToolView);
167 connect(area, &Area::aboutToRemoveView, d, &MainWindowPrivate::aboutToRemoveView);
168 connect(area, &Area::toolViewAdded, d, &MainWindowPrivate::toolViewAdded);
169 connect(area, &Area::aboutToRemoveToolView, d, &MainWindowPrivate::aboutToRemoveToolView);
170}
171
172void MainWindow::focusEditor()
173{

Callers 1

addViewMethod · 0.45

Calls 4

reconstructMethod · 0.80
stopMethod · 0.80
activeViewMethod · 0.45

Tested by

no test coverage detected