| 1032 | } |
| 1033 | |
| 1034 | void 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 | |
| 1061 | void TabWidget::setDebugLine(int line) |
| 1062 | { |
no test coverage detected