mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Fix Bug 310465 - Can't switch view mode for non-writable paths
BUG: 310465 FIXED-IN: 4.9.4 REVIEW: 107458
This commit is contained in:
parent
c570c62036
commit
b2719884b9
1 changed files with 7 additions and 2 deletions
|
@ -69,8 +69,13 @@ ViewProperties::ViewProperties(const KUrl& url) :
|
|||
useDetailsViewWithPath = true;
|
||||
} else if (url.isLocalFile()) {
|
||||
m_filePath = url.toLocalFile();
|
||||
const QFileInfo info(m_filePath);
|
||||
if (!info.isWritable() || !isPartOfHome(m_filePath)) {
|
||||
const QFileInfo dirInfo(m_filePath);
|
||||
const QFileInfo fileInfo(m_filePath + QDir::separator() + ViewPropertiesFileName);
|
||||
// Check if the directory is writable and check if the ".directory" file exists and
|
||||
// is read- and writable.
|
||||
if (!dirInfo.isWritable()
|
||||
|| (fileInfo.exists() && !(fileInfo.isReadable() && fileInfo.isWritable()))
|
||||
|| !isPartOfHome(m_filePath)) {
|
||||
#ifdef Q_OS_WIN
|
||||
// m_filePath probably begins with C:/ - the colon is not a valid character for paths though
|
||||
m_filePath = QDir::separator() + m_filePath.remove(QLatin1Char(':'));
|
||||
|
|
Loading…
Reference in a new issue