保存一个新建的文件后,更新相关配置
| 5520 | |
| 5521 | //保存一个新建的文件后,更新相关配置 |
| 5522 | void CCNotePad::updateProAfterSaveNewFile(int curTabIndex, QString fileName, ScintillaEditView* pEdit) |
| 5523 | { |
| 5524 | getRegularFilePath(fileName); |
| 5525 | //保存成功后,更新文件的路径和tab标签 |
| 5526 | QFileInfo fi(fileName); |
| 5527 | QString fileLabel(fi.fileName()); |
| 5528 | |
| 5529 | ui.editTabWidget->setTabText(curTabIndex, fileLabel); |
| 5530 | |
| 5531 | //删除新文件的索引 |
| 5532 | QVariant v = pEdit->property(Edit_File_New); |
| 5533 | |
| 5534 | int newFileIndex = v.toInt(); |
| 5535 | |
| 5536 | if (newFileIndex >= 0) |
| 5537 | { |
| 5538 | //如果是新建文件,则删除对于的记录 |
| 5539 | FileManager::getInstance().delNewFileNode(newFileIndex); |
| 5540 | } |
| 5541 | |
| 5542 | v.setValue(-1); |
| 5543 | pEdit->setProperty(Edit_File_New, v); |
| 5544 | |
| 5545 | //更新路径名称 |
| 5546 | QVariant fp(fileName); |
| 5547 | pEdit->setProperty(Edit_View_FilePath, fp); |
| 5548 | |
| 5549 | //setWindowTitle(fileName); |
| 5550 | setFileOpenAttrProperty(pEdit, OpenAttr::Text); |
| 5551 | setWindowTitleMode(fileName, OpenAttr::Text); |
| 5552 | |
| 5553 | ui.editTabWidget->setTabToolTip(curTabIndex, fileName); |
| 5554 | |
| 5555 | autoSetDocLexer(pEdit); |
| 5556 | |
| 5557 | addWatchFilePath(fileName); |
| 5558 | } |
| 5559 | |
| 5560 | // |
| 5561 | void CCNotePad::saveTabEdit(int tabIndex) |
nothing calls this directly
no test coverage detected