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

Small tweaks to NTFS writable check fix

parent 1898c4db
......@@ -1173,9 +1173,8 @@ bool EditorManager::saveFile(IEditor *editor)
return true;
}
if (file->isReadOnly() || fileName.isEmpty()) {
if (file->isReadOnly() || fileName.isEmpty())
return saveFileAs(editor);
}
m_d->m_core->fileManager()->blockFileChange(file);
const bool success = file->save(fileName);
......
......@@ -146,15 +146,14 @@ bool BaseTextDocument::isReadOnly() const
const QFileInfo fi(m_fileName);
#ifdef Q_OS_WIN32
// be careful when getting info from files on network drives
int old_ntfs_permission_lookup = qt_ntfs_permission_lookup;
qt_ntfs_permission_lookup = 1;
// Check for permissions on NTFS file systems
qt_ntfs_permission_lookup++;
#endif
const int ro = !fi.isWritable();
const bool ro = !fi.isWritable();
#ifdef Q_OS_WIN32
qt_ntfs_permission_lookup = old_ntfs_permission_lookup;
qt_ntfs_permission_lookup--;
#endif
return ro;
}
......@@ -175,9 +174,6 @@ bool BaseTextDocument::open(const QString &fileName)
if (!file.exists())
return false;
if (!fi.isReadable())
return false;
if (!file.open(QIODevice::ReadWrite) && !file.open(QIODevice::ReadOnly))
return false;
......
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