aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2003-03-01 02:10:05 +0800
committerDan Winship <danw@src.gnome.org>2003-03-01 02:10:05 +0800
commitdad4d7df9c3e301eb57a10b12d66fb9e2bb74950 (patch)
treebfa9bf460116be50acf7013dd8c390bf2a7815ff /my-evolution
parent5597bf794e72cd92935a7ac9828bcb590fcbb853 (diff)
downloadgsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.tar
gsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.tar.gz
gsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.tar.bz2
gsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.tar.lz
gsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.tar.xz
gsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.tar.zst
gsoc2013-evolution-dad4d7df9c3e301eb57a10b12d66fb9e2bb74950.zip
Don't need to use libalarm to set a timeout to change the date. We know
* e-summary.c (e_summary_init): Don't need to use libalarm to set a timeout to change the date. We know how many seconds away it is, so we can just set a timeout for then. * Makefile.am (summary_libs): Remove libalarm.a svn path=/trunk/; revision=20106
Diffstat (limited to 'my-evolution')
-rw-r--r--my-evolution/ChangeLog8
-rw-r--r--my-evolution/Makefile.am1
-rw-r--r--my-evolution/e-summary.c49
3 files changed, 34 insertions, 24 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index 88bffcd366..3480932408 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,11 @@
+2003-02-28 Dan Winship <danw@ximian.com>
+
+ * e-summary.c (e_summary_init): Don't need to use libalarm to set
+ a timeout to change the date. We know how many seconds away it is,
+ so we can just set a timeout for then.
+
+ * Makefile.am (summary_libs): Remove libalarm.a
+
2003-02-21 Dan Winship <danw@ximian.com>
* Makefile.am (summary_libs): clean up
diff --git a/my-evolution/Makefile.am b/my-evolution/Makefile.am
index db1a59f9c4..fcb3e124b4 100644
--- a/my-evolution/Makefile.am
+++ b/my-evolution/Makefile.am
@@ -65,7 +65,6 @@ summary_sources = \
weather.h
summary_libs = \
- $(top_builddir)/calendar/gui/alarm-notify/libalarm.a \
$(top_builddir)/shell/libeshell.la \
$(top_builddir)/widgets/misc/libemiscwidgets.la \
$(top_builddir)/e-util/libeutil.la \
diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c
index 3723d65c4c..c32bd5bb5b 100644
--- a/my-evolution/e-summary.c
+++ b/my-evolution/e-summary.c
@@ -59,7 +59,6 @@
#include <gtk/gtkdialog.h>
-#include <gui/alarm-notify/alarm.h>
#include <cal-util/timeutil.h>
#include <gtk/gtkmain.h>
@@ -106,7 +105,7 @@ struct _ESummaryPrivate {
guint pending_reload_tag;
- gpointer alarm;
+ guint tomorrow_timeout_id;
gboolean frozen;
@@ -168,8 +167,7 @@ destroy (GtkObject *object)
e_summary_tasks_free (summary);
}
- alarm_remove (priv->alarm);
- alarm_done ();
+ g_source_remove (priv->tomorrow_timeout_id);
if (priv->protocol_hash) {
g_hash_table_foreach (priv->protocol_hash, free_protocol, NULL);
@@ -466,20 +464,34 @@ e_summary_class_init (GtkObjectClass *object_class)
e_summary_parent_class = g_type_class_ref(PARENT_TYPE);
}
+static gboolean tomorrow_timeout (gpointer data);
+
static void
-alarm_fn (gpointer alarm_id,
- time_t trigger,
- gpointer data)
+reset_tomorrow_timeout (ESummary *summary)
{
- ESummary *summary;
- time_t t, day_end;
+ time_t now, day_end;
+
+ now = time (NULL);
+ if (summary->tz)
+ day_end = time_day_end_with_zone (now, summary->tz);
+ else
+ day_end = time_day_end (now);
+
+ /* (Yes, the number of milliseconds in a day is less than UINT_MAX) */
+ summary->priv->tomorrow_timeout_id =
+ g_timeout_add ((day_end - now) * 1000,
+ tomorrow_timeout, summary);
+}
- summary = data;
- t = time (NULL);
- day_end = time_day_end_with_zone (t, summary->tz);
- summary->priv->alarm = alarm_add (day_end, alarm_fn, summary, NULL);
+static gboolean
+tomorrow_timeout (gpointer data)
+{
+ ESummary *summary = data;
+ reset_tomorrow_timeout (summary);
e_summary_reconfigure (summary);
+
+ return FALSE;
}
#define DEFAULT_HTML "<html><head><title>Summary</title></head><body bgcolor=\"#ffffff\">%s</body></html>"
@@ -490,7 +502,6 @@ e_summary_init (ESummary *summary)
GConfClient *gconf_client;
ESummaryPrivate *priv;
GdkColor bgcolor = {0, 0xffff, 0xffff, 0xffff};
- time_t t, day_end;
char *def, *default_utf;
summary->priv = g_new (ESummaryPrivate, 1);
@@ -534,18 +545,10 @@ e_summary_init (ESummary *summary)
summary->timezone = g_strdup ("UTC");
}
summary->tz = icaltimezone_get_builtin_timezone (summary->timezone);
+ reset_tomorrow_timeout (summary);
g_object_unref (gconf_client);
- t = time (NULL);
- if (summary->tz == NULL) {
- day_end = time_day_end (t);
- } else {
- day_end = time_day_end_with_zone (t, summary->tz);
- }
-
- priv->alarm = alarm_add (day_end, alarm_fn, summary, NULL);
-
priv->queued_draw_idle_id = 0;
}