diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-18 11:18:21 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-18 11:18:21 +0800 |
commit | f8921df01e239b4d77ce9b226c68fbd62cbffb9a (patch) | |
tree | 03364d89a6455326d33aa2ed467aa181f392423e /camel | |
parent | 2983d377425a6a34411630363e91e0951b58d2b9 (diff) | |
download | gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.tar gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.tar.gz gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.tar.bz2 gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.tar.lz gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.tar.xz gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.tar.zst gsoc2013-evolution-f8921df01e239b4d77ce9b226c68fbd62cbffb9a.zip |
check for NULL implementation before calling it. (disco_sync): similar.
2004-05-18 Not Zed <NotZed@Ximian.com>
* camel-disco-folder.c (disco_expunge_uids): check for NULL
implementation before calling it.
(disco_sync): similar. Fixes crash #58278.
svn path=/trunk/; revision=25944
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/camel-disco-folder.c | 29 |
2 files changed, 29 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 1cc5432ec5..ade1bd5458 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2004-05-18 Not Zed <NotZed@Ximian.com> + + * camel-disco-folder.c (disco_expunge_uids): check for NULL + implementation before calling it. + (disco_sync): similar. Fixes crash #58278. + 2004-05-17 Jeffrey Stedfast <fejj@novell.com> * camel-folder-search.c (search_match_threads): Fixed a string type-o. diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c index a5e7f80ee0..d45a4da850 100644 --- a/camel/camel-disco-folder.c +++ b/camel/camel-disco-folder.c @@ -270,6 +270,8 @@ disco_refresh_info (CamelFolder *folder, CamelException *ex) static void disco_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) { + void (*sync)(CamelFolder *, CamelException *) = NULL; + if (expunge) { disco_expunge (folder, ex); if (camel_exception_is_set (ex)) @@ -280,40 +282,55 @@ disco_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) switch (camel_disco_store_status (CAMEL_DISCO_STORE (folder->parent_store))) { case CAMEL_DISCO_STORE_ONLINE: - CDF_CLASS (folder)->sync_online (folder, ex); + sync = CDF_CLASS (folder)->sync_online; break; case CAMEL_DISCO_STORE_OFFLINE: - CDF_CLASS (folder)->sync_offline (folder, ex); + sync = CDF_CLASS (folder)->sync_offline; break; case CAMEL_DISCO_STORE_RESYNCING: - CDF_CLASS (folder)->sync_resyncing (folder, ex); + sync = CDF_CLASS (folder)->sync_resyncing; break; } + + if (sync) { + sync(folder, ex); + } else { + g_warning("Class '%s' doesn't implement CamelDiscoFolder:sync methods", + ((CamelObject *)folder)->klass->name); + } } static void disco_expunge_uids (CamelFolder *folder, GPtrArray *uids, CamelException *ex) { CamelDiscoStore *disco = CAMEL_DISCO_STORE (folder->parent_store); + void (*expunge_uids)(CamelFolder *, GPtrArray *, CamelException *) = NULL; if (uids->len == 0) return; switch (camel_disco_store_status (disco)) { case CAMEL_DISCO_STORE_ONLINE: - CDF_CLASS (folder)->expunge_uids_online (folder, uids, ex); + expunge_uids = CDF_CLASS (folder)->expunge_uids_online; break; case CAMEL_DISCO_STORE_OFFLINE: - CDF_CLASS (folder)->expunge_uids_offline (folder, uids, ex); + expunge_uids = CDF_CLASS (folder)->expunge_uids_offline; break; case CAMEL_DISCO_STORE_RESYNCING: - CDF_CLASS (folder)->expunge_uids_resyncing (folder, uids, ex); + expunge_uids = CDF_CLASS (folder)->expunge_uids_resyncing; break; } + + if (expunge_uids) { + expunge_uids(folder, uids, ex); + } else { + g_warning("Class '%s' doesn't implement CamelDiscoFolder:expunge_uids methods", + ((CamelObject *)folder)->klass->name); + } } static void |