r23327 - gnucash/trunk/src/gnome-utils - Fix window position/size saving

Geert Janssens gjanssens at code.gnucash.org
Fri Oct 25 03:27:58 EDT 2013


Author: gjanssens
Date: 2013-10-25 03:27:57 -0400 (Fri, 25 Oct 2013)
New Revision: 23327
Trac: http://svn.gnucash.org/trac/changeset/23327

Modified:
   gnucash/trunk/src/gnome-utils/dialog-utils.c
Log:
Fix window position/size saving

- fix inverted test if saving/restoring is requested
- fix glib CRIT warning when saving

Modified: gnucash/trunk/src/gnome-utils/dialog-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-utils.c	2013-10-24 20:33:42 UTC (rev 23326)
+++ gnucash/trunk/src/gnome-utils/dialog-utils.c	2013-10-25 07:27:57 UTC (rev 23327)
@@ -128,7 +128,7 @@
     g_return_if_fail(group != NULL);
     g_return_if_fail(window != NULL);
 
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
+    if (!gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
         return;
 
     geometry = gnc_prefs_get_value (group, GNC_PREF_LAST_GEOMETRY);
@@ -186,7 +186,7 @@
     g_return_if_fail(group != NULL);
     g_return_if_fail(window != NULL);
 
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
+    if (!gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
         return;
 
     gtk_window_get_position(GTK_WINDOW(window), &wpos[0], &wpos[1]);
@@ -194,7 +194,7 @@
     geometry = g_variant_new ("(iiii)", wpos[0],  wpos[1],
                                         wsize[0], wsize[1]);
     gnc_prefs_set_value (group, GNC_PREF_LAST_GEOMETRY, geometry);
-    g_variant_unref (geometry);
+    /* Don't unref geometry here, it is consumed by gnc_prefs_set_value */
 }
 
 



More information about the gnucash-changes mailing list