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

Method removeTab

src/plugins/codeeditor/gui/tabbar.cpp:222–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void TabBar::removeTab(const QString &fileName, bool silent)
223{
224 int index = indexOf(fileName);
225 if (-1 == index)
226 return;
227
228 if (!silent && QFile::exists(fileName) && d->isModified(index)) {
229 int ret = d->showConfirmDialog(fileName);
230 if (ret == 0) // save
231 emit saveFileRequested(fileName);
232 else if (ret == 2 || ret == -1) // cancel or close
233 return;
234 }
235
236 emit tabClosed(fileName);
237 editor.fileClosed(fileName);
238 d->tabBar->removeTab(index);
239 editor.switchedFile(this->currentFileName());
240}
241
242void TabBar::closeAllTab(const QStringList &exceptList, bool silent)
243{

Callers 5

tabClosedMethod · 0.45
closeFileEditorMethod · 0.45
onTabColseRequestedMethod · 0.45
showMenuMethod · 0.45
initConnectionsMethod · 0.45

Calls 4

currentFileNameMethod · 0.95
indexOfFunction · 0.85
showConfirmDialogMethod · 0.80
isModifiedMethod · 0.45

Tested by

no test coverage detected