| 38 | } |
| 39 | |
| 40 | QString checkDuplicate(const QString & parentPath, const QString &newFileName) |
| 41 | { |
| 42 | QString newFilePath = parentPath + QDir::separator() + newFileName; |
| 43 | if (QFile::exists(newFilePath)) { |
| 44 | QString newName = newFileName + QString("(1)"); |
| 45 | newFilePath = checkDuplicate(parentPath, newName); |
| 46 | } |
| 47 | |
| 48 | return newFilePath; |
| 49 | }; |
| 50 | |
| 51 | bool FileOperation::doNewDocument(const QString &parentPath, const QString &docName) |
| 52 | { |