[maemo-developers] Deleting alarms
From: David Weinehall david.weinehall at nokia.comDate: Thu May 3 12:50:37 EEST 2007
- Previous message: Deleting alarms
- Next message: Deleting alarms
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On tor, 2007-05-03 at 11:12 +0200, ext Murray Cumming wrote: > If I understand the alarm API > http://www.maemo.org/platform/docs/howtos/howto_alarm_interface_bora.html > properly, it can be used to specify a D-Bus method to be called at > regular intervals. I guess the application/service will be started if > necessary. That's the idea, at least. > But how can I remove an existing alarm (to replace it with a new alarm > with a different interval) if that alarm was set by a previous instance > of my application. Should I save the cookie_t ID in gconf in order to > use it later? You can either save the cookie_t ID (this is the preferred solution, since it's guaranteed to be correct), or request a list of all alarms happening in a specific time interval (using alarm_event_query), then iterate the list of cookies (retrieving each alarm_event_t with alarm_event_get) and see if the exec_name or dbus_name matches your application (as mentioned, this is not 100% fail-safe; think of cron-like execution schedulers for instance). > Or, do the alarms only work while my application is already running, and > stop working when my applications stops? No, alarms keep working even when you quit your application. Regards: David
- Previous message: Deleting alarms
- Next message: Deleting alarms
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]