Commit 500b5e20 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

No need to open file ReadWrite for just reading its contents

Pointed out by Mathias Gumz.
parent f15660cb
......@@ -453,7 +453,7 @@ void FileManager::changedFile(const QString &file)
foreach (IFile *fileinterface, managedFiles(file))
m_changedFiles << fileinterface;
if (wasempty && !m_changedFiles.isEmpty()) {
QTimer::singleShot (200, this, SLOT(checkForReload()));
QTimer::singleShot(200, this, SLOT(checkForReload()));
}
}
......
......@@ -171,10 +171,7 @@ bool BaseTextDocument::open(const QString &fileName)
m_fileName = fi.absoluteFilePath();
QFile file(fileName);
if (!file.exists())
return false;
if (!file.open(QIODevice::ReadWrite) && !file.open(QIODevice::ReadOnly))
if (!file.open(QIODevice::ReadOnly))
return false;
title = fi.fileName();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment