MCPcopy Create free account
hub / github.com/KDE/ghostwriter / createDraft

Method createDraft

src/documentmanager.cpp:971–986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969}
970
971void DocumentManagerPrivate::createDraft()
972{
973 if (document->isNew()) {
974 int i = 1;
975 QString draftPath;
976
977 // Make sure draft file name is unique.
978 do {
979 draftPath = draftLocation + "/" + draftName + "-" + QString::number(i) + ".md";
980 i++;
981 } while (QFileInfo(draftPath).exists());
982
983 setFilePath(draftPath);
984 saveFile();
985 }
986}
987
988}

Callers 2

DocumentManagerMethod · 0.80
setAutoSaveEnabledMethod · 0.80

Calls 1

isNewMethod · 0.80

Tested by

no test coverage detected