forked from qt-creator/qt-creator
No need to open file ReadWrite for just reading its contents
Pointed out by Mathias Gumz.
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user