┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-06-22 09:27:37 +0200
committerFrank Reininghaus <[email protected]>2013-06-22 09:27:37 +0200
commit5a647117abf1fd6ab7ef26cfa3f54aee96f27fce (patch)
tree002eebee854deeef0bb3f58094ccf55ae1c335e0 /src/views/dolphinview.cpp
parent0d6bf0359872deeabde854cc14af558281a078a6 (diff)
Make sure that changing the view mode does not fail
This commit ensures that changing the view mode works even if the .directory file in the user's KDE folder is not writable. BUG: 318534 FIXED-IN: 4.11.0 REVIEW: 111120
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 303ee34af..e879f67fc 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -248,9 +248,12 @@ void DolphinView::setMode(Mode mode)
if (mode != m_mode) {
ViewProperties props(viewPropertiesUrl());
props.setViewMode(mode);
- props.save();
- applyViewProperties();
+ // We pass the new ViewProperties to applyViewProperties, rather than
+ // storing them on disk and letting applyViewProperties() read them
+ // from there, to prevent that changing the view mode fails if the
+ // .directory file is not writable (see bug 318534).
+ applyViewProperties(props);
}
}
@@ -1508,9 +1511,13 @@ void DolphinView::loadDirectory(const KUrl& url, bool reload)
void DolphinView::applyViewProperties()
{
- m_view->beginTransaction();
-
const ViewProperties props(viewPropertiesUrl());
+ applyViewProperties(props);
+}
+
+void DolphinView::applyViewProperties(const ViewProperties& props)
+{
+ m_view->beginTransaction();
const Mode mode = props.viewMode();
if (m_mode != mode) {