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

Method doNewDocument

src/common/util/fileoperation.cpp:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49};
50
51bool FileOperation::doNewDocument(const QString &parentPath, const QString &docName)
52{
53 QFileInfo info(parentPath);
54 if (!info.exists() || !info.isDir())
55 return false;
56
57 QString newFilePath = checkDuplicate(parentPath, docName);
58
59 QFile newFile(newFilePath);
60 if (newFile.open(QFile::OpenModeFlag::NewOnly)){
61 newFile.close();
62 }
63 return true;
64}
65
66bool FileOperation::doNewFolder(const QString &parentPath, const QString &folderName)
67{

Callers

nothing calls this directly

Calls 4

checkDuplicateFunction · 0.85
existsMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected