diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-24 22:32:50 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-24 22:32:50 +0100 |
commit | d75f611d9a4b14a240b5f63411f736f82f31afcf (patch) | |
tree | ca4a90f1fc5ede5768291981734246f85a4080ec /plugins/gtkui | |
parent | cc2217c65b38b51d5a9d562d2b4d818eac13c3a9 (diff) |
gtkui: avoid config rewrite if gui layout didn't change
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/gtkui.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index d6d45f81..ea9acc3a 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -816,15 +816,18 @@ init_widget_layout (void) { char layout[20000]; deadbeef->conf_get_str ("gtkui.layout", gtkui_def_layout, layout, sizeof (layout)); - if (strcmp (layout, gtkui_def_layout) && !deadbeef->conf_get_int ("gtkui.layout_062_upgraded", 0)) { + int upgraded_062 = deadbeef->conf_get_int ("gtkui.layout_062_upgraded", 0); + if (strcmp (layout, gtkui_def_layout) && !upgraded_062) { // add top bar char layout_upgrade[20000]; snprintf (layout_upgrade, sizeof (layout_upgrade), "vbox expand=\"0 1\" fill=\"1 1\" homogeneous=0 {hbox expand=\"0 1 0\" fill=\"1 1 1\" homogeneous=0 {playtb {} seekbar {} volumebar {} } %s }", layout); strcpy (layout, layout_upgrade); deadbeef->conf_set_str ("gtkui.layout", layout); } - deadbeef->conf_set_int ("gtkui.layout_062_upgraded", 1); - deadbeef->conf_save (); + if (!upgraded_062) { + deadbeef->conf_set_int ("gtkui.layout_062_upgraded", 1); + deadbeef->conf_save (); + } ddb_gtkui_widget_t *w = NULL; w_create_from_string (layout, &w); |