Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
c3a3ab96
Commit
c3a3ab96
authored
Apr 14, 2009
by
Thorbjørn Lindeijer
Browse files
Small tweaks to NTFS writable check fix
parent
1898c4db
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
c3a3ab96
...
...
@@ -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
);
...
...
src/plugins/texteditor/basetextdocument.cpp
View file @
c3a3ab96
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment