[gedit] Port Zeitgeist plugin to use libzeitgeist2



commit 20d860b6500e8f9a8143be4df306225e206664d6
Author: Seif Lotfy <seif lotfy com>
Date:   Sat Apr 6 19:14:59 2013 +0200

    Port Zeitgeist plugin to use libzeitgeist2
    
    Signed-off-by: Seif Lotfy <seif lotfy com>

 configure.ac                               | 6 +++---
 plugins/zeitgeist/gedit-zeitgeist-plugin.c | 9 +++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2339d93..cc5c44e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -276,7 +276,7 @@ dnl ================================================================
 dnl libzeitgeit check: for zeitgeist plugin
 dnl ================================================================
 
-LIBZEITGEIST_REQUIRED=0.3.2
+LIBZEITGEIST_REQUIRED=0.9.12
 
 AC_ARG_ENABLE([zeitgeist],
        AS_HELP_STRING([--enable-zeitgeist[=@<:@no/auto/yes@:>@]],[Build with zeitgeist support]),
@@ -284,13 +284,13 @@ AC_ARG_ENABLE([zeitgeist],
        [enable_zeitgeist="auto"])
 
 if test "x$enable_zeitgeist" = "xauto" ; then
-       PKG_CHECK_EXISTS([zeitgeist-1.0 >= $LIBZEITGEIST_REQUIRED], \
+       PKG_CHECK_EXISTS([zeitgeist-2.0 >= $LIBZEITGEIST_REQUIRED], \
                          enable_zeitgeist="yes", enable_zeitgeist="no")
 fi
 
 if test "x$enable_zeitgeist" = "xyes" ; then
        PKG_CHECK_MODULES(ZEITGEIST, \
-                         [zeitgeist-1.0 >= $LIBZEITGEIST_REQUIRED])
+                         [zeitgeist-2.0 >= $LIBZEITGEIST_REQUIRED])
 fi
 
 AM_CONDITIONAL(ENABLE_ZEITGEIST, test x"$enable_zeitgeist" = "xyes")
diff --git a/plugins/zeitgeist/gedit-zeitgeist-plugin.c b/plugins/zeitgeist/gedit-zeitgeist-plugin.c
index b9989a5..b5dcc07 100644
--- a/plugins/zeitgeist/gedit-zeitgeist-plugin.c
+++ b/plugins/zeitgeist/gedit-zeitgeist-plugin.c
@@ -186,16 +186,19 @@ gedit_zeitgeist_plugin_send_event (GeditZeitgeistPlugin *plugin,
                event = zeitgeist_event_new_full (interpretation,
                                                  ZEITGEIST_ZG_USER_ACTIVITY,
                                                  "application://gedit.desktop",
+                                                 NULL,
                                                  subject,
                                                  NULL);
 
-               zeitgeist_log_insert_events_no_reply (zg_log, event, NULL);
+               zeitgeist_log_insert_event_no_reply (zg_log, event, NULL);
 
                g_free (display_name);
                g_free (mime_type);
                g_free (dir_name);
                g_free (doc_uri);
 
+               g_object_unref (event);
+               g_object_unref (subject);
                g_object_unref (location);
        }
 }
@@ -273,7 +276,7 @@ gedit_zeitgeist_plugin_app_activate (GeditAppActivatable *activatable)
        zg_log = zeitgeist_log_new ();
 
        event = zeitgeist_event_new_full (NULL, NULL,
-                                         "application://gedit.desktop", NULL);
+                                         "application://gedit.desktop", NULL, NULL);
        ptr_arr = g_ptr_array_new ();
        g_ptr_array_add (ptr_arr, event);
 
@@ -285,6 +288,8 @@ gedit_zeitgeist_plugin_app_activate (GeditAppActivatable *activatable)
        zg_dsr = zeitgeist_data_source_registry_new ();
        zeitgeist_data_source_registry_register_data_source (zg_dsr, ds,
                                                             NULL, NULL, NULL);
+       g_ptr_array_set_free_func (ptr_arr, g_object_unref);
+       g_ptr_array_unref (ptr_arr);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]