aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1999-01-29 08:51:55 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-01-29 08:51:55 +0800
commit7fa29f65a4b068db075d0da9dbf05c2a3c4569a4 (patch)
tree10b40041921cbd83857d3ed707562efedb04f53e /calendar/gui/alarm-notify
parent1ae6dea2dbe31f7aef33db4f6c099b4476a545e9 (diff)
downloadgsoc2013-evolution-7fa29f65a4b068db075d0da9dbf05c2a3c4569a4.tar.gz
gsoc2013-evolution-7fa29f65a4b068db075d0da9dbf05c2a3c4569a4.tar.zst
gsoc2013-evolution-7fa29f65a4b068db075d0da9dbf05c2a3c4569a4.zip
Schedule an alarm for midnight to change the
1999-01-28 Miguel de Icaza <miguel@nuclecu.unam.mx> * calendar.c (calendar_init_alarms): Schedule an alarm for midnight to change the calendar_day_begin/calendar_day_end. * alarm.c (alarm_ready): If we reschedule, there is no need to activate any pending alarms. svn path=/trunk/; revision=634
Diffstat (limited to 'calendar/gui/alarm-notify')
-rw-r--r--calendar/gui/alarm-notify/alarm.c14
-rw-r--r--calendar/gui/alarm-notify/alarm.h6
2 files changed, 15 insertions, 5 deletions
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c
index 30d3534955..3848fb87fd 100644
--- a/calendar/gui/alarm-notify/alarm.c
+++ b/calendar/gui/alarm-notify/alarm.c
@@ -74,6 +74,7 @@ alarm_ready (void *closure, int fd, GdkInputCondition cond)
itimer.it_value.tv_sec = next->activation_time - now;
itimer.it_value.tv_usec = 0;
setitimer (ITIMER_REAL, &itimer, NULL);
+ break;
} else {
g_free (ar);
ar = next;
@@ -95,7 +96,14 @@ alarm_compare_by_time (gconstpointer a, gconstpointer b)
return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
}
-void
+/**
+ * alarm_add:
+ *
+ * Tries to schedule @alarm.
+ *
+ * Returns TRUE if the alarm was scheduled.
+ */
+gboolean
alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure)
{
time_t now = time (NULL);
@@ -104,7 +112,7 @@ alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure)
/* If it already expired, do not add it */
if (alarm_time < now)
- return;
+ return FALSE;
ar = g_new0 (AlarmRecord, 1);
ar->activation_time = alarm_time;
@@ -127,6 +135,8 @@ alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure)
v = setitimer (ITIMER_REAL, &itimer, NULL);
head_alarm = alarms->data;
}
+
+ return TRUE;
}
int
diff --git a/calendar/gui/alarm-notify/alarm.h b/calendar/gui/alarm-notify/alarm.h
index 3c2ab18ff1..81710bda5e 100644
--- a/calendar/gui/alarm-notify/alarm.h
+++ b/calendar/gui/alarm-notify/alarm.h
@@ -5,8 +5,8 @@
typedef void (*AlarmFunction)(time_t time, CalendarAlarm *which, void *closuse);
-void alarm_init (void);
-void alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure);
-int alarm_kill (void *closure);
+void alarm_init (void);
+gboolean alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure);
+int alarm_kill (void *closure);
#endif
cgit.cgi/freebsd-ports-gnome/commit/portuguese/kde4-l10n?h=gnome-3.24&id=d5810e633a14509d6944b4e26679ea69ea6f6aa8'>The KDE on FreeBSD team is pleased to update the KDE4 ports to 4.7.3.rakuco2011-11-141-2/+2 * The KDE/FreeBSD team is pleased to announce KDE Software Compilationavilla2011-10-173-20/+103 * Update KDE Software Compilation ports to 4.6.5makc2011-07-082-2/+55 * The FreeBSD KDE Team is pleased to announce KDE SC 4.6.4. Read fullavilla2011-06-141-2/+2 * Update KDE Software Compilation ports to 4.6.3makc2011-05-172-2/+51 * The FreeBSD KDE Team is pleased to announce April updates for KDEavilla2011-04-072-2/+20 * The FreeBSD KDE Team is pleased to announce KDE SC 4.6.1 and KDE PIMavilla2011-03-253-22/+58 * - The KDE FreeBSD team is proud to announce the release of KDE 4.5.5fluffy2011-01-081-2/+2 * KDE FreeBSD team presents KDE SC 4.5.4.makc2010-12-032-6/+2 * KDE FreeBSD team presents KDE SC 4.5.3.makc2010-11-042-3/+6 * KDE FreeBSD team presents KDE SC 4.5.2.makc2010-10-062-7/+42 * KDE FreeBSD team presents KDE SC 4.5.1.makc2010-09-033-610/+204 * Present KDE SC 4.4.5 for FreeBSD.makc2010-06-301-3/+3 * Present KDE SC 4.4.4 for FreeBSD.makc2010-06-021-3/+3 * - The FreeBSD KDE team is pleased to announce KDE SC 4.4.3 for FreeBSDfluffy2010-05-114-150/+135 * - update to 1.4.1dinoex2010-03-281-0/+1 * Presenting KDE 4.3.5 for FreeBSD. The official release notes for thismiwi2010-02-072-4/+3 * - update to jpeg-8dinoex2010-02-051-0/+1 * The FreeBSD KDE is please to announce the release of KDE 4.3.4,miwi2009-12-021-3/+3 * The KDE FreeBSD team is proud to announce the release of KDE 4.3.3miwi2009-11-272-5/+11 * The FreeBSD KDE is please to announce the release of KDE 4.3.1,tabthorpe2009-09-022-4/+4 * clean upmakc2009-08-081-3/+0 * The KDE FreeBSD team is proud to announce the release of KDE 4.3.0miwi2009-08-054-21/+89 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-311-0/+1 * The KDE FreeBSD team is pleased to announce KDE 4.2.4, the last bugfixmiwi2009-06-031-3/+3 * Update KDE ports to 4.2.3makc2009-05-102-3/+4 * The KDE FreeBSD team is proud to announce the release of KDE 4.2.2miwi2009-04-022-15/+7 * Update KDE to 4.2.1.makc2009-03-093-60/+310 * - Add all manpages for kde4-l10n*miwi2009-02-091-0/+42 * The KDE FreeBSD team is proud to announce the release of KDE 4.2.0miwi2009-02-093-73/+125 * kde@freebsd team is pleased to announce KDE 4.1.4, the last bugfix release in...makc2009-01-143-6/+6 * The KDE FreeBSD team is proud to announce the release of KDE 4.1.1miwi2008-09-032-8/+4 * The KDE FreeBSD team is proud to announce the release of KDE 4.1.0miwi2008-08-104-919/+267 * Update to KDE 3.5.8lofi2007-10-302-5/+3 * Update to KDE 3.5.7 / KOffice 1.6.3lofi2007-07-043-13/+3 * - Welcome X.org 7.2 \o/.flz2007-05-201-0/+1