fix: new text file
This commit is contained in:
parent
d733c9d55c
commit
3ba1d05073
1 changed files with 6 additions and 6 deletions
|
@ -932,13 +932,13 @@ void FolderModel::newTextFile()
|
||||||
|
|
||||||
m_newDocumentUrl = QUrl(rootItem().url().toString() + "/" + newName);
|
m_newDocumentUrl = QUrl(rootItem().url().toString() + "/" + newName);
|
||||||
|
|
||||||
QFile srcFile(":/templates/TextFile.txt");
|
QFile file(m_newDocumentUrl.toLocalFile());
|
||||||
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
if (!srcFile.open(QIODevice::ReadOnly)) {
|
QTextStream stream(&file);
|
||||||
return;
|
stream << "\n";
|
||||||
|
::chmod(m_newDocumentUrl.toLocalFile().toStdString().c_str(), 0700);
|
||||||
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
srcFile.copy(m_newDocumentUrl.toLocalFile());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FolderModel::rename(int row, const QString &name)
|
void FolderModel::rename(int row, const QString &name)
|
||||||
|
|
Loading…
Reference in a new issue