Skip to content
Snippets Groups Projects
Commit e5181165 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

No need to open file for reading when just writing to it

parent 3d9c65f2
No related branches found
No related tags found
No related merge requests found
...@@ -264,7 +264,7 @@ void CppFileSettingsWidget::slotEdit() ...@@ -264,7 +264,7 @@ void CppFileSettingsWidget::slotEdit()
if (path.isEmpty()) if (path.isEmpty())
return; return;
QFile file(path); QFile file(path);
if (!file.open(QIODevice::ReadWrite|QIODevice::Text|QIODevice::Truncate)) { if (!file.open(QIODevice::WriteOnly|QIODevice::Text|QIODevice::Truncate)) {
QMessageBox::warning(this, tr("Template write error"), QMessageBox::warning(this, tr("Template write error"),
tr("Cannot write to %1: %2").arg(path, file.errorString())); tr("Cannot write to %1: %2").arg(path, file.errorString()));
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment