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

Method openFile

src/plugins/codeeditor/gui/tabwidget.cpp:1034–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032}
1033
1034void TabWidget::openFile(const QString &fileName, QsciDocument *doc)
1035{
1036 if (!QFile::exists(fileName) || QFileInfo(fileName).isDir())
1037 return;
1038
1039 if (d->findEditor(fileName)) {
1040 d->tabBar->switchTab(fileName);
1041 return;
1042 }
1043
1044 // add file monitor
1045 Inotify::globalInstance()->addPath(fileName);
1046
1047 d->symbolBar->setPath(fileName);
1048 d->symbolBar->setVisible(true);
1049 d->tabBar->setFileName(fileName);
1050 TextEditor *editor = d->createEditor(fileName, doc);
1051
1052 SymbolWidgetGenerator::instance()->symbolWidget()->setEditor(editor);
1053 d->editorLayout->addWidget(editor);
1054 d->editorLayout->setCurrentWidget(editor);
1055 d->changeFocusProxy();
1056
1057 if (!d->editorMng.isEmpty())
1058 setSplitButtonVisible(true);
1059}
1060
1061void TabWidget::setDebugLine(int line)
1062{

Callers 15

createDocumentMethod · 0.45
addRecentOpenWidgetMethod · 0.45
doDoubleClickedMethod · 0.45
acceptMethod · 0.45
openFileDialogMethod · 0.45
generateMethod · 0.45
generateMethod · 0.45
doDoubleClickedMethod · 0.45
btnOpenFileClickedMethod · 0.45
handleItemClickedMethod · 0.45
createEditorMethod · 0.45
onTabClosedMethod · 0.45

Calls 12

findEditorMethod · 0.80
switchTabMethod · 0.80
setVisibleMethod · 0.80
setFileNameMethod · 0.80
symbolWidgetMethod · 0.80
changeFocusProxyMethod · 0.80
addPathMethod · 0.45
setPathMethod · 0.45
createEditorMethod · 0.45
setEditorMethod · 0.45
addWidgetMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected