No need to open file ReadWrite for just reading its contents

Pointed out by Mathias Gumz.
This commit is contained in:
Thorbjørn Lindeijer
2009-04-15 16:06:49 +02:00
parent f15660cb5c
commit 500b5e20b5
2 changed files with 2 additions and 5 deletions

View File

@@ -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()));
}
}

View File

@@ -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();