2007-07-25 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Wed, 25 Jul 2007 08:58:32 +0000 (08:58 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Wed, 25 Jul 2007 08:58:32 +0000 (08:58 +0000)
(modest_platform_set_update_interval): Set the alarm recurrence
fields so that auto-update does not just happen the first time.
This should have fixed projects.maemo.org bug NB#63938.

When this happens you can see a printf when the D-Bus method is
called:
GLIB DEBUG default - debug: modest_dbus_req_handler: method received: SendReceive

However, I do not actually seem to get new POP messages even when
clicking the refresh button manually. A restart gets them.
This might be a problem in today's tinymail only.

pmo-trunk-r2788

ChangeLog2
src/maemo/modest-maemo-global-settings-dialog.c
src/maemo/modest-platform.c

index 054e8cd..4f8afaa 100644 (file)
@@ -1,3 +1,17 @@
+2007-07-25  Murray Cumming  <murrayc@murrayc.com>
+
+       (modest_platform_set_update_interval): Set the alarm recurrence 
+       fields so that auto-update does not just happen the first time.
+       This should have fixed projects.maemo.org bug NB#63938.
+
+       When this happens you can see a printf when the D-Bus method is 
+       called:
+       GLIB DEBUG default - debug: modest_dbus_req_handler: method received: SendReceive
+
+       However, I do not actually seem to get new POP messages even when 
+       clicking the refresh button manually. A restart gets them. 
+       This might be a problem in today's tinymail only.
+
 2007-07-24  Murray Cumming  <murrayc@murrayc.com>
 
        * src/maemo/modest-maemo-global-settings-dialog.c:
index b44f141..7f3d2ca 100644 (file)
@@ -252,7 +252,12 @@ modest_maemo_global_settings_dialog_finalize (GObject *obj)
        priv = MODEST_MAEMO_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (obj);
        ppriv = MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (obj);
 
-       if (priv->switch_handler) {
+       if (priv->switch_handler && ppriv->notebook) {
+               /* TODO: This causes a g_warning:
+                modest[13409]: GLIB WARNING ** GLib-GObject - invalid unclassed pointer in cast to `GObject'
+               modest[13409]: GLIB WARNING ** GLib-GObject - instance with invalid (NULL) class pointer
+               modest[13409]: GLIB CRITICAL ** GLib-GObject - g_signal_handler_disconnect: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
+                */
                g_signal_handler_disconnect (G_OBJECT (ppriv->notebook), priv->switch_handler);
                priv->switch_handler = 0;
        }
index 1e25a46..1089275 100644 (file)
@@ -1190,17 +1190,13 @@ gboolean modest_platform_set_update_interval (guint minutes)
      
        /* Register alarm: */
        
-       /* Get current time: */
-       time_t time_now;
-       time (&time_now);
-       struct tm *st_time = localtime (&time_now);
-       
-       /* Add minutes to tm_min field: */
-       st_time->tm_min += minutes;
-       
-       /* Set the time in alarm_event_t structure: */
+       /* Set the interval in alarm_event_t structure: */
        alarm_event_t *event = g_new0(alarm_event_t, 1);
-       event->alarm_time = mktime (st_time);
+       event->alarm_time = minutes * 60; /* seconds */
+       
+       /* Set recurrence every few minutes: */
+       event->recurrence = minutes;
+       event->recurrence_count = -1; /* Means infinite */
 
        /* Specify what should happen when the alarm happens:
         * It should call this D-Bus method: */