[Xfce4-commits] <midori:master> Properly calculate row count when importing from JSON

Christian Dywan noreply at xfce.org
Sun Apr 3 22:36:03 CEST 2011


Updating branch refs/heads/master
         to 7cafd62552a8ef00ec81ea67af90802d61535b6c (commit)
       from 599bd748df5419ffb0412b499a2add70ab037ad8 (commit)

commit 7cafd62552a8ef00ec81ea67af90802d61535b6c
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Thu Mar 24 22:54:58 2011 +0100

    Properly calculate row count when importing from JSON

 midori/main.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/midori/main.c b/midori/main.c
index 7900d62..1a97d02 100644
--- a/midori/main.c
+++ b/midori/main.c
@@ -1477,6 +1477,7 @@ speeddial_new_from_file (const gchar* config,
     guint i = 0;
     guint columns = 3;
     guint slot_count = 0;
+    guint rows;
     gchar* json_content;
     gchar** parts;
 
@@ -1594,9 +1595,10 @@ speeddial_new_from_file (const gchar* config,
         }
     }
 
-    /* Without JSON we save 3 columns and 0 rows, columns are initialised as 3 */
+    /* Default to 3 x 3 grid. Calculate rows here, columns is initialized as 3 */
+    rows = slot_count / columns > 3 ? slot_count / columns : 3;
     g_key_file_set_integer (key_file, "settings", "columns", columns);
-    g_key_file_set_integer (key_file, "settings", "rows", slot_count / columns ? 0 : 3);
+    g_key_file_set_integer (key_file, "settings", "rows", rows);
 
     g_strfreev (parts);
     g_free (json_content);



More information about the Xfce4-commits mailing list