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);
|
||||
|
||||
QFile srcFile(":/templates/TextFile.txt");
|
||||
|
||||
if (!srcFile.open(QIODevice::ReadOnly)) {
|
||||
return;
|
||||
QFile file(m_newDocumentUrl.toLocalFile());
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
QTextStream stream(&file);
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue