+2008-09-11 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #551805
+
+ * backends/google/e-cal-backend-google-utils.c:
+ (e_cal_backend_google_utils_create_cache):
+ Create new timeout source only when none set yet.
+ * backends/google/e-cal-backend-google-utils.h:
+ * backends/google/e-cal-backend-google-utils.c:
+ (e_cal_backend_google_utils_update): Honour function prototype.
+ * backends/google/e-cal-backend-google-utils.c:
+ (e_cal_backend_google_utils_connect): Honour return data type.
+ * backends/google/e-cal-backend-google.h:
+ * backends/google/e-cal-backend-google.c:
+ (struct _ECalBackendGooglePrivate),
+ (e_cal_backend_google_set_timeout_id),
+ (e_cal_backend_google_get_timeout_id): Honour return data type.
+
2008-09-05 Andre Klapper <a9016009@gmx.de>
* libedata-cal/e-cal-backend-util.c:
e_cal_backend_google_utils_create_cache (ECalBackendGoogle *cbgo)
{
ESource *source;
- guint timeout_id;
int x;
const gchar *refresh_interval = NULL;
ECalBackendCache *cache;
else
x = 30;
- timeout_id = g_timeout_add (x * 60000,
- (GSourceFunc) get_deltas_timeout,
- (gpointer)cbgo);
- e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
+ if (!e_cal_backend_google_get_timeout_id (cbgo)) {
+ guint timeout_id;
+
+ timeout_id = g_timeout_add (x * 60000,
+ (GSourceFunc) get_deltas_timeout,
+ (gpointer)cbgo);
+ e_cal_backend_google_set_timeout_id (cbgo, timeout_id);
+ }
return GINT_TO_POINTER (GNOME_Evolution_Calendar_Success);
}
*
* Return value: TRUE if update is successful FALSE otherwise .
**/
-gboolean
+gpointer
e_cal_backend_google_utils_update (gpointer handle)
{
ECalBackendGoogle *cbgo;
gboolean needs_to_insert = FALSE;
gchar *uri;
- if (!handle) {
+ if (!handle || !E_IS_CAL_BACKEND_GOOGLE (handle)) {
g_critical ("\n Invalid handle %s", G_STRLOC);
- return FALSE;
+ return NULL;
}
g_static_mutex_lock (&updating);
}
g_static_mutex_unlock (&updating);
- return TRUE;
+ return NULL;
}
ECalBackendSyncStatus
GError *error = NULL;
GThread *thread;
gchar *username, *password;
- gint timeout_id;
+ guint timeout_id;
gboolean mode_changed;
gchar *uri, *suri;
EGoItem *
e_go_item_from_cal_component (ECalBackendGoogle *cbgo, ECalComponent *comp);
-gboolean
+gpointer
e_cal_backend_google_utils_update (gpointer handle);
GDataEntry *
CalMode mode;
EGoItem *item;
- gint timeout_id;
+ guint timeout_id;
gchar *username;
gchar *password;
gchar *uri;
*
**/
void
-e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo,gint timeout_id )
+e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo, guint timeout_id)
{
ECalBackendGooglePrivate *priv;
priv = cbgo->priv;
* Gets the timeout id.
*
**/
-gint
+guint
e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo)
{
ECalBackendGooglePrivate *priv;
gchar * e_cal_backend_google_get_username (ECalBackendGoogle *cbgo);
gchar * e_cal_backend_google_get_password (ECalBackendGoogle *cbgo);
gchar * e_cal_backend_google_get_local_attachments_store (ECalBackendGoogle *cbgo);
-gint e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo);
+guint e_cal_backend_google_get_timeout_id (ECalBackendGoogle *cbgo);
void e_cal_backend_google_set_entry (ECalBackendGoogle *cbgo, GDataEntry *entry);
void e_cal_backend_google_set_cache (ECalBackendGoogle *cbgo, ECalBackendCache *cache);
void e_cal_backend_google_set_mode_changed (ECalBackendGoogle *cbgo, gboolean mode_changed);
void e_cal_backend_google_set_username (ECalBackendGoogle *cbgo, gchar *username);
void e_cal_backend_google_set_password (ECalBackendGoogle *cbgo, gchar *password);
-void e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo,gint timeout_id);
+void e_cal_backend_google_set_timeout_id (ECalBackendGoogle *cbgo, guint timeout_id);
G_END_DECLS
#endif