[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 175085] Icons view settings aren't saved
From:       Frank Reininghaus <frank78ac () googlemail ! com>
Date:       2009-03-10 23:02:22
Message-ID: 20090310230222.D954C495B () immanuel ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=175085





--- Comment #18 from Frank Reininghaus <frank78ac googlemail com>  2009-03-11 00:02:19 ---
I think I might have found a solution to this issue.

The storing of settings seems to be handled handled in a different way in
Dolphin and Konqueror. Konqueror settings (like, e.g., Enabling Access Keys in
the Web Browsing section) are written to disk already when the Configuration
dialog is closed. The save() methods of Konqueror's KCModules indeed contain
code to save the settings.

On the other hand, if I change, e.g., the "Expandable folders" setting in
Dolphin, this is written to dolphinrc only when I quit Dolphin (apparently by
the "settings.save();" instruction in DolphinMainWindow::closeEvent()).

Looking at the code shows that for example DolphinViewModesConfigModule::save()
indeed only updates the DolphinSettings::instance() object and notifies
Konqueror of the changes via a D-Bus message. But the changes never get written
to disk if a DolphinPart is running inside Konqueror :-(

I think the easiest way to fix this is to save the settings in
DolphinPartBrowserExtension::reparseConfiguration(), see patch below. I
verified that dolphinrc gets updated immediately when Konqueror's "Configure"
dialog is closed and that the changes persist when closing and reopening
Konqueror.

Index: src/dolphinpart.cpp
===================================================================
--- src/dolphinpart.cpp (revision 937891)
+++ src/dolphinpart.cpp (working copy)
@@ -23,6 +23,7 @@
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphinview.h"
 #include "dolphinmodel.h"
+#include "settings/dolphinsettings.h"

 #include <konq_fileitemcapabilities.h>
 #include <konq_operations.h>
@@ -464,6 +465,9 @@
 void DolphinPartBrowserExtension::reparseConfiguration()
 {
     m_part->view()->refresh();
+
+    DolphinSettings& settings = DolphinSettings::instance();
+    settings.save();
 }

 ////

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic