summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmviewstyle.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/pwmviewstyle.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmviewstyle.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/pwmanager/pwmanager/pwmviewstyle.cpp b/pwmanager/pwmanager/pwmviewstyle.cpp
index 51d8f6c..9704615 100644
--- a/pwmanager/pwmanager/pwmviewstyle.cpp
+++ b/pwmanager/pwmanager/pwmviewstyle.cpp
@@ -41,9 +41,21 @@ PwMViewStyle::PwMViewStyle(QWidget *parent, const char *name)
PwMViewStyle::~PwMViewStyle()
{
- //US ENH : load and store the size of the listviewcolumns
- lv->saveLayout(conf()->getConfig(), "listview");
- conf()->getConfig()->sync();
+ //US ENH : store the size of the listviewcolumns
+ switch (curStyle)
+ {
+ case style_0:
+ s0->saveSettings(PWMPrefs::instance());
+ break;
+ case style_1:
+ s1->saveSettings(PWMPrefs::instance());
+ break;
+ default:
+ BUG();
+ }
+
+
+ PWMPrefs::instance()->getConfig()->sync();
delete_ifnot_null(s0);
delete_ifnot_null(s1);
@@ -88,8 +100,18 @@ void PwMViewStyle::initStyle(style_t style)
lv->addColumn(i18n("Launcher"), 120);
v->tmpReEnableSort();
- //US ENH : load and store the size of the listviewcolumns
- lv->restoreLayout(conf()->getConfig(), "listview");
+ //US ENH : load the size of the listviewcolumns
+ switch (style)
+ {
+ case style_0:
+ s0->restoreSettings(PWMPrefs::instance());
+ break;
+ case style_1:
+ s1->restoreSettings(PWMPrefs::instance());
+ break;
+ default:
+ BUG();
+ }
resizeView(v->size());
v->updateView();