[Xfce4-commits] <midori:master> Fix slot and dial name mixups when preparing/ saving

Christian Dywan noreply at xfce.org
Sun Sep 9 22:36:01 CEST 2012


Updating branch refs/heads/master
         to ad99fb1ebbd897bea53531de3fead8732902ace0 (commit)
       from fe2a5c048caad852436bb15aabf355596c92e497 (commit)

commit ad99fb1ebbd897bea53531de3fead8732902ace0
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Sun Sep 9 00:31:02 2012 +0200

    Fix slot and dial name mixups when preparing/ saving

 midori/midori-speeddial.vala |   10 +++++-----
 tests/speeddial.vala         |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/midori/midori-speeddial.vala b/midori/midori-speeddial.vala
index 31a2cbc..b532f36 100644
--- a/midori/midori-speeddial.vala
+++ b/midori/midori-speeddial.vala
@@ -120,14 +120,14 @@ namespace Midori {
             while (slot <= slot_count) {
                 string tile = "Dial %u".printf (slot);
                 if (!keyfile.has_group (tile))
-                    return "s%u".printf (slot);
+                    return "Dial %u".printf (slot);
                 slot++;
             }
-            return "s%u".printf (slot_count + 1);
+            return "Dial %u".printf (slot_count + 1);
         }
 
         public void add (string uri, string title, Gdk.Pixbuf img) {
-            string id = "Dial " + get_next_free_slot ();
+            string id = get_next_free_slot ();
             add_with_id (id, uri, title, img);
         }
 
@@ -260,7 +260,7 @@ namespace Midori {
 
             if (action == "add" || action == "rename"
                                 || action == "delete" || action == "swap") {
-                uint slot_id = parts[1].to_int () + 1;
+                uint slot_id = parts[1].next_char().to_int () ;
                 string dial_id = "Dial %u".printf (slot_id);
 
                 if (action == "delete") {
@@ -279,7 +279,7 @@ namespace Midori {
                     keyfile.set_string (dial_id, "title", title);
                 }
                 else if (action == "swap") {
-                    uint slot2_id = parts[2].to_int () + 1;
+                    uint slot2_id = parts[2].next_char().to_int ();
                     string dial2_id = "Dial %u".printf (slot2_id);
 
                     string uri = keyfile.get_string (dial_id, "uri");
diff --git a/tests/speeddial.vala b/tests/speeddial.vala
index 8a5d746..1da490d 100644
--- a/tests/speeddial.vala
+++ b/tests/speeddial.vala
@@ -40,8 +40,8 @@ static void speeddial_load () {
     FileUtils.remove (json);
 
     Katze.assert_str_equal (json, dial_data.keyfile.to_data (), dial_json.keyfile.to_data ());
-    Katze.assert_str_equal (json, Midori.SpeedDial.get_next_free_slot_fk (dial_data.keyfile), "s2");
-    Katze.assert_str_equal (json, Midori.SpeedDial.get_next_free_Slot_fk (dial_json), "s2");
+    Katze.assert_str_equal (json, dial_data.get_next_free_slot (), "Dial 2");
+    Katze.assert_str_equal (json, dial_json.get_next_free_slot (), "Dial 2");
 }
 
 void main (string[] args) {


More information about the Xfce4-commits mailing list