From e41570bd2f5313be8e7968fcafb99b546d4fb502 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 28 Aug 2012 02:07:25 +0300 Subject: [PATCH] telepathy: implement sipe_backend_schedule_* --- src/telepathy/Makefile.am | 1 + src/telepathy/telepathy-schedule.c | 62 ++++++++++++++++++++++++++++++++++++++ src/telepathy/telepathy-stubs.c | 11 ------- 3 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 src/telepathy/telepathy-schedule.c diff --git a/src/telepathy/Makefile.am b/src/telepathy/Makefile.am index 1ca23e46..e11875c0 100644 --- a/src/telepathy/Makefile.am +++ b/src/telepathy/Makefile.am @@ -12,6 +12,7 @@ telepathy_sipe_SOURCES = \ telepathy-main.c \ telepathy-private.h \ telepathy-protocol.c \ + telepathy-schedule.c \ telepathy-stubs.c \ telepathy-transport.c diff --git a/src/telepathy/telepathy-schedule.c b/src/telepathy/telepathy-schedule.c new file mode 100644 index 00000000..996f6291 --- /dev/null +++ b/src/telepathy/telepathy-schedule.c @@ -0,0 +1,62 @@ +/** + * @file telepathy-schedule.c + * + * pidgin-sipe + * + * Copyright (C) 2012 SIPE Project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "sipe-backend.h" +#include "sipe-common.h" +#include "sipe-core.h" + +static gboolean timeout_execute(gpointer data) +{ + sipe_core_schedule_execute(data); + return(FALSE); +} + +gpointer sipe_backend_schedule_seconds(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public, + guint timeout, + gpointer data) +{ + return(GUINT_TO_POINTER(g_timeout_add_seconds(timeout, timeout_execute, data))); +} + +gpointer sipe_backend_schedule_mseconds(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public, + guint timeout, + gpointer data) +{ + return(GUINT_TO_POINTER(g_timeout_add(timeout, timeout_execute, data))); +} + +void sipe_backend_schedule_cancel(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public, + gpointer data) +{ + g_source_remove(GPOINTER_TO_UINT(data)); +} + +/* + Local Variables: + mode: c + c-file-style: "bsd" + indent-tabs-mode: t + tab-width: 8 + End: +*/ diff --git a/src/telepathy/telepathy-stubs.c b/src/telepathy/telepathy-stubs.c index 88eb2bfd..33de767a 100644 --- a/src/telepathy/telepathy-stubs.c +++ b/src/telepathy/telepathy-stubs.c @@ -336,17 +336,6 @@ void sipe_backend_notify_error(SIPE_UNUSED_PARAMETER struct sipe_core_public *si SIPE_UNUSED_PARAMETER const gchar *title, SIPE_UNUSED_PARAMETER const gchar *msg) {} -/** SCHEDULE *****************************************************************/ - -gpointer sipe_backend_schedule_seconds(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public, - SIPE_UNUSED_PARAMETER guint timeout, - SIPE_UNUSED_PARAMETER gpointer data) { return(NULL); } -gpointer sipe_backend_schedule_mseconds(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public, - SIPE_UNUSED_PARAMETER guint timeout, - SIPE_UNUSED_PARAMETER gpointer data) { return(NULL); } -void sipe_backend_schedule_cancel(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public, - SIPE_UNUSED_PARAMETER gpointer data) {} - /** SEARCH *******************************************************************/ struct sipe_backend_search_results *sipe_backend_search_results_start(SIPE_UNUSED_PARAMETER struct sipe_core_public *sipe_public) { return(NULL); } -- 2.11.4.GIT