判断文件是否已经打开中,是则返回其tabindex,否则-1
| 3448 | |
| 3449 | //判断文件是否已经打开中,是则返回其tabindex,否则-1 |
| 3450 | int CCNotePad::findFileIsOpenAtPad(QString filePath) |
| 3451 | { |
| 3452 | int ret = -1; |
| 3453 | getRegularFilePath(filePath); |
| 3454 | |
| 3455 | for (int i = 0; i < ui.editTabWidget->count(); ++i) |
| 3456 | { |
| 3457 | QWidget* pw = ui.editTabWidget->widget(i); |
| 3458 | if (pw != nullptr) |
| 3459 | { |
| 3460 | QString curPath = pw->property(Edit_View_FilePath).toString(); |
| 3461 | getRegularFilePath(curPath); |
| 3462 | |
| 3463 | if (curPath == filePath) |
| 3464 | { |
| 3465 | ret = i; |
| 3466 | break; |
| 3467 | } |
| 3468 | } |
| 3469 | } |
| 3470 | |
| 3471 | return ret; |
| 3472 | } |
| 3473 | |
| 3474 | //判断新建名称是否已经存在,是 true |
| 3475 | bool CCNotePad::isNewFileNameExist(QString& fileName) |
nothing calls this directly
no test coverage detected