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

Method setFileName

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

Source from the content-addressed store, hash-verified

153}
154
155void TabBar::setFileName(const QString &fileName)
156{
157 if (fileName.isEmpty() || !QFile::exists(fileName))
158 return;
159
160 int index = indexOf(fileName);
161 if (-1 != index) {
162 d->tabBar->setCurrentIndex(index);
163 return;
164 }
165
166 QSignalBlocker block(d->tabBar);
167 QFileInfo info(fileName);
168 index = d->tabBar->addTab(info.fileName());
169 d->tabBar->setTabToolTip(index, fileName);
170 d->tabBar->setCurrentIndex(index);
171
172 emit tabSwitched(fileName);
173 editor.switchedFile(fileName);
174}
175
176int TabBar::indexOf(const QString &fileName)
177{

Callers 5

runMethod · 0.80
scanfAllPluginMethod · 0.80
redirectGlobalDebugFunction · 0.80
outCheckFunction · 0.80
openFileMethod · 0.80

Calls 5

indexOfFunction · 0.85
addTabMethod · 0.80
fileNameMethod · 0.80
isEmptyMethod · 0.45
setCurrentIndexMethod · 0.45

Tested by

no test coverage detected