[gnome-clocks/wip/vala] Fix serialization
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-clocks/wip/vala] Fix serialization
- Date: Sun, 17 Feb 2013 20:47:39 +0000 (UTC)
commit f44d1fa828316ba5b9a1c1188ed2773eaf7165b3
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Feb 17 21:21:27 2013 +0100
    Fix serialization
 src/alarm.vala |    4 ++--
 src/utils.vala |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/alarm.vala b/src/alarm.vala
index 5ec98d9..97f16ca 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -190,7 +190,7 @@ private class Item : Object {
         bool active = true;
         int hour = -1;
         int minute = -1;
-        Utils.Weekdays? days = null;
+        Utils.Weekdays days = new Utils.Weekdays ();
         foreach (var v in alarm_variant) {
             var key = v.get_child_value (0).get_string ();
             if (key == "name") {
@@ -436,6 +436,7 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
                     if (response == 1) {
                         ((SetupDialog) dialog).apply_to_alarm (alarm);
                         alarm.reset ();
+                        save ();
                     }
                     dialog.destroy ();
                 });
@@ -490,7 +491,6 @@ public class MainPanel : Gd.Stack, Clocks.Clock {
         visible_child = standalone;
     }
 
-
     private void load () {
         foreach (var a in settings.get_value ("alarms")) {
             Item alarm = Item.deserialize (a);
diff --git a/src/utils.vala b/src/utils.vala
index 34473eb..a588cc0 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -245,11 +245,11 @@ public class Weekdays {
         int32 i = 1;
         foreach (var d in days) {
             if (d) {
-                builder.add ("i", new GLib.Variant.int32 (i));
+                builder.add ("i", i);
             }
             i++;
         }
-        return builder.end ();
+        return builder.end ();;
     }
 
     public static Weekdays deserialize (GLib.Variant days_variant) {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]