Commit ef46c31d authored by con's avatar con
Browse files

Fixes: External permission changes are not recognized

Task-number: QTCREATORBUG-1077
parent 70b96146
......@@ -83,8 +83,6 @@ public:
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
void reload(ReloadFlag flag, ChangeType type);
void checkPermissions() {}
void setMimetype(const QString &mimetype) { m_mimeType = mimetype; emit changed(); }
void setFileName(const QString &filename) { m_fileName = filename; emit changed(); }
private:
......
......@@ -853,6 +853,7 @@ void FileManager::checkForReload()
blockFileChange(it.key());
it.key()->save(it.value());
unblockFileChange(it.key());
it.key()->checkPermissions();
}
d->m_blockActivated = false;
......
......@@ -145,12 +145,15 @@ bool BaseTextDocument::isModified() const
void BaseTextDocument::checkPermissions()
{
bool previousReadOnly = m_fileIsReadOnly;
if (!m_fileName.isEmpty()) {
const QFileInfo fi(m_fileName);
m_fileIsReadOnly = !fi.isWritable();
} else {
m_fileIsReadOnly = false;
}
if (previousReadOnly != m_fileIsReadOnly)
emit changed();
}
bool BaseTextDocument::open(const QString &fileName)
......@@ -266,7 +269,7 @@ void BaseTextDocument::reload(ReloadFlag flag, ChangeType type)
if (flag == FlagIgnore)
return;
if (type == TypePermissions) {
emit changed();
checkPermissions();
} else {
reload();
}
......
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