comparison pidgin/plugins/gevolution/gevolution.c @ 30530:6dbe83eee341

Fix compiling gevolution plugin with e-d-s >= 2.29.1 Fixes #10852
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 27 May 2010 19:59:14 +0000
parents 58fbaa661331
children 3e06c30b75bb
comparison
equal deleted inserted replaced
30529:58fbaa661331 30530:6dbe83eee341
34 #include "gtkplugin.h" 34 #include "gtkplugin.h"
35 #include "gtkutils.h" 35 #include "gtkutils.h"
36 36
37 #include "gevolution.h" 37 #include "gevolution.h"
38 38
39 #if 0
40 /* These are private headers that we probably should never have been
41 * including. Maybe very early versions of e-d-s required this?
42 *
43 * also, bonobo has gone away as of e-d-s 2.29.1, and this plugin still
44 * seems to work even on e-d-s 1.10.3 without us touching it.
45 * Maybe it's not really working though. I'm sure we'll find out.
46 */
39 #include <libedata-book/Evolution-DataServer-Addressbook.h> 47 #include <libedata-book/Evolution-DataServer-Addressbook.h>
40 48
41 #include <libedata-book/e-data-book-factory.h> 49 #include <libedata-book/e-data-book-factory.h>
42 /* TODO: bonobo is going away eventually, we'll need to find an alternative */ 50 /* TODO: bonobo is going away eventually, we'll need to find an alternative */
43 #include <bonobo/bonobo-main.h> 51 #include <bonobo/bonobo-main.h>
52 #endif
44 53
45 #include <glib.h> 54 #include <glib.h>
46 55
47 #define GEVOLUTION_PLUGIN_ID "gtk-x11-gevolution" 56 #define GEVOLUTION_PLUGIN_ID "gtk-x11-gevolution"
48 57
324 } 333 }
325 334
326 static gboolean 335 static gboolean
327 plugin_load(PurplePlugin *plugin) 336 plugin_load(PurplePlugin *plugin)
328 { 337 {
338 #if 0
329 bonobo_activate(); 339 bonobo_activate();
340 #endif
330 341
331 backup_blist_ui_ops = purple_blist_get_ui_ops(); 342 backup_blist_ui_ops = purple_blist_get_ui_ops();
332 343
333 blist_ui_ops = g_memdup(backup_blist_ui_ops, sizeof(PurpleBlistUiOps)); 344 blist_ui_ops = g_memdup(backup_blist_ui_ops, sizeof(PurpleBlistUiOps));
334 blist_ui_ops->request_add_buddy = request_add_buddy; 345 blist_ui_ops->request_add_buddy = request_add_buddy;
370 } 381 }
371 382
372 static void 383 static void
373 plugin_destroy(PurplePlugin *plugin) 384 plugin_destroy(PurplePlugin *plugin)
374 { 385 {
386 #if 0
375 bonobo_debug_shutdown(); 387 bonobo_debug_shutdown();
388 #endif
376 } 389 }
377 390
378 static void 391 static void
379 autoadd_toggled_cb(GtkCellRendererToggle *renderer, gchar *path_str, 392 autoadd_toggled_cb(GtkCellRendererToggle *renderer, gchar *path_str,
380 gpointer data) 393 gpointer data)
573 * freed. That includes this, if we make the module resident, which 586 * freed. That includes this, if we make the module resident, which
574 * prevents us from being able to actually unload it. 587 * prevents us from being able to actually unload it.
575 * 588 *
576 * So, in conclusion, this is an evil hack, but it doesn't harm anything 589 * So, in conclusion, this is an evil hack, but it doesn't harm anything
577 * and it works. 590 * and it works.
591 *
592 * And for some reason it's needed even when we don't init bonobo ourselves
593 * at all, so the above explanation is suspect. This is required even with
594 * e-d-s >= 2.29.1 where bonobo is no longer in the picture.
578 */ 595 */
579 g_module_make_resident(plugin->handle); 596 g_module_make_resident(plugin->handle);
580 597
598 #if 0
581 if (!bonobo_init_full(NULL, NULL, bonobo_activation_orb_get(), 599 if (!bonobo_init_full(NULL, NULL, bonobo_activation_orb_get(),
582 CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) 600 CORBA_OBJECT_NIL, CORBA_OBJECT_NIL))
583 { 601 {
584 purple_debug_error("evolution", "Unable to initialize bonobo.\n"); 602 purple_debug_error("evolution", "Unable to initialize bonobo.\n");
585 } 603 }
604 #endif
586 } 605 }
587 606
588 PURPLE_INIT_PLUGIN(gevolution, init_plugin, info) 607 PURPLE_INIT_PLUGIN(gevolution, init_plugin, info)