diff -Nru nautilus-3.18.2/debian/changelog nautilus-3.18.2/debian/changelog --- nautilus-3.18.2/debian/changelog 2015-12-02 10:28:33.000000000 +0100 +++ nautilus-3.18.2/debian/changelog 2015-12-02 14:16:00.000000000 +0100 @@ -1,3 +1,10 @@ +nautilus (1:3.18.2-1ubuntu2) xenial; urgency=medium + + * debian/patches/zg_activity_logging.patch: + - Use zeitgeist-2.0 (lp: #1197569) + + -- Rico Tzschichholz Wed, 02 Dec 2015 14:04:54 +0100 + nautilus (1:3.18.2-1ubuntu1) xenial; urgency=medium * New version (lp: #1463662) and resynchronize on Debian diff -Nru nautilus-3.18.2/debian/control nautilus-3.18.2/debian/control --- nautilus-3.18.2/debian/control 2015-12-02 10:28:35.000000000 +0100 +++ nautilus-3.18.2/debian/control 2015-12-02 15:33:01.000000000 +0100 @@ -36,7 +36,7 @@ libglib2.0-doc, libgtk-3-doc, libunity-dev (>= 5.0.0), - libzeitgeist-dev, + libzeitgeist-2.0-dev, Homepage: http://www.gnome.org/projects/nautilus/ Vcs-Bzr: http://code.launchpad.net/~ubuntu-desktop/nautilus/ubuntu Standards-Version: 3.9.6 diff -Nru nautilus-3.18.2/debian/control.in nautilus-3.18.2/debian/control.in --- nautilus-3.18.2/debian/control.in 2015-12-02 10:28:33.000000000 +0100 +++ nautilus-3.18.2/debian/control.in 2015-12-02 14:03:40.000000000 +0100 @@ -32,7 +32,7 @@ libglib2.0-doc, libgtk-3-doc, libunity-dev (>= 5.0.0), - libzeitgeist-dev, + libzeitgeist-2.0-dev, Homepage: http://www.gnome.org/projects/nautilus/ Vcs-Bzr: http://code.launchpad.net/~ubuntu-desktop/nautilus/ubuntu Standards-Version: 3.9.6 diff -Nru nautilus-3.18.2/debian/patches/zg_activity_logging.patch nautilus-3.18.2/debian/patches/zg_activity_logging.patch --- nautilus-3.18.2/debian/patches/zg_activity_logging.patch 2015-12-02 10:28:33.000000000 +0100 +++ nautilus-3.18.2/debian/patches/zg_activity_logging.patch 2015-12-02 15:31:58.000000000 +0100 @@ -1,26 +1,57 @@ -=== modified file 'nautilus-3.8.1/libnautilus-private/Makefile.am' ---- nautilus-3.8.1/libnautilus-private/Makefile.am 2015-11-24 10:44:52 +0000 -+++ nautilus-3.8.1/libnautilus-private/Makefile.am 2015-12-01 10:17:16 +0000 -@@ -12,6 +12,7 @@ +From 7ebf2ec608b69d4e3f8cb39d8c55af7f32744c74 Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz +Date: Wed, 2 Dec 2015 15:31:19 +0100 +Subject: [PATCH] Add zeitgeist activity logging + +--- + configure.ac | 2 + + libnautilus-private/Makefile.am | 2 + + libnautilus-private/nautilus-file-operations.c | 193 ++++++++++++++ + libnautilus-private/nautilus-file.c | 30 +++ + test/Makefile.am | 5 + + test/run-zeitgeist-test.sh | 50 ++++ + test/test-nautilus-zeitgeist.c | 343 +++++++++++++++++++++++++ + 7 files changed, 625 insertions(+) + create mode 100755 test/run-zeitgeist-test.sh + create mode 100644 test/test-nautilus-zeitgeist.c + +diff --git a/configure.ac b/configure.ac +index 777ff84..3eb759c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -246,6 +246,8 @@ fi + AM_CONDITIONAL(ENABLE_TRACKER, test "x$enable_tracker" = "xyes") + + dnl ========================================================================== ++ ++PKG_CHECK_MODULES(ZEITGEIST, zeitgeist-2.0) + + dnl base libs + PKG_CHECK_MODULES(BASE, [ +diff --git a/libnautilus-private/Makefile.am b/libnautilus-private/Makefile.am +index 92c6014..7f4803b 100644 +--- a/libnautilus-private/Makefile.am ++++ b/libnautilus-private/Makefile.am +@@ -12,6 +12,7 @@ AM_CPPFLAGS = \ $(WARNING_CFLAGS) \ $(DISABLE_DEPRECATED) \ $(TRACKER_CFLAGS) \ -+ `pkg-config --cflags zeitgeist-1.0` \ ++ $(ZEITGEIST_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ -DNAUTILUS_EXTENSIONDIR=\""$(libdir)/nautilus/extensions-3.0"\" \ -@@ -41,6 +42,7 @@ - - libnautilus_private_la_LDFLAGS = \ - -no-undefined \ -+ `pkg-config --libs zeitgeist-1.0` \ - $(NULL) - +@@ -46,6 +47,7 @@ libnautilus_private_la_LDFLAGS = \ libnautilus_private_la_LIBADD = \ - -=== modified file 'nautilus-3.8.1/libnautilus-private/nautilus-file-operations.c' ---- nautilus-3.8.1/libnautilus-private/nautilus-file-operations.c 2015-11-24 10:44:52 +0000 -+++ nautilus-3.8.1/libnautilus-private/nautilus-file-operations.c 2015-12-01 10:18:38 +0000 + $(SELINUX_LIBS) \ + $(TRACKER_LIBS) \ ++ $(ZEITGEIST_LIBS) \ + $(top_builddir)/eel/libeel-2.la \ + $(top_builddir)/libnautilus-extension/libnautilus-extension.la \ + $(top_builddir)/libgd/libgd.la \ +diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c +index 376ef7e..9fbd2db 100644 +--- a/libnautilus-private/nautilus-file-operations.c ++++ b/libnautilus-private/nautilus-file-operations.c @@ -64,6 +64,8 @@ #include "nautilus-file-undo-operations.h" #include "nautilus-file-undo-manager.h" @@ -30,7 +61,7 @@ /* TODO: TESTING!!! */ typedef struct { -@@ -192,6 +194,104 @@ +@@ -192,6 +194,107 @@ typedef struct { #define MERGE_ALL _("Merge _All") #define COPY_FORCE _("Copy _Anyway") @@ -40,7 +71,7 @@ +send_event_to_zeitgeist (ZeitgeistEvent *event) +{ + ZeitgeistLog *log = zeitgeist_log_get_default (); -+ zeitgeist_log_insert_events_no_reply (log, event, NULL); ++ zeitgeist_log_insert_event_no_reply (log, event, NULL); +} + +typedef struct { @@ -61,7 +92,7 @@ + gchar *origin; + const gchar *display_name; + const gchar *mimetype; -+ ++ + data = user_data; + + error = NULL; @@ -94,19 +125,22 @@ + if (data->original_uri) + zeitgeist_subject_set_current_uri (subject, uri); + -+ g_free (uri); -+ g_free (origin); -+ g_object_unref (info); -+ + if (subject) { + ZeitgeistEvent *event = zeitgeist_event_new_full ( + data->event_interpretation, + ZEITGEIST_ZG_USER_ACTIVITY, + ZEITGEIST_NAUTILUS_ACTOR, ++ origin, + subject, NULL); + send_event_to_zeitgeist (event); ++ g_object_unref (event); ++ g_object_unref (subject); + } + ++ g_free (uri); ++ g_free (origin); ++ g_object_unref (info); ++ + g_object_unref (data->file); + g_free (data->original_uri); + g_free (data); @@ -135,43 +169,49 @@ static void mark_desktop_file_trusted (CommonJob *common, GCancellable *cancellable, -@@ -2108,6 +2208,35 @@ +@@ -2108,6 +2211,41 @@ delete_job_done (gpointer user_data) job = user_data; + // Send event to Zeitgeist for deletions/trash -+ GList *file_iter = job->files; ++ GList *file_iter = job->files; + while (file_iter != NULL) { + gchar *uri = g_file_get_uri (file_iter->data); + gchar *origin = g_path_get_dirname (uri); -+ gchar *parse_name = g_file_get_parse_name (file_iter->data); ++ gchar *parse_name = g_file_get_parse_name (file_iter->data); + gchar *display_name = g_path_get_basename (parse_name); ++ ZeitgeistSubject *subject = zeitgeist_subject_new_full ( ++ uri, ++ NULL, // subject interpretation - auto-guess ++ NULL, // suject manifestation - auto-guess ++ NULL, // mime-type ++ origin, ++ display_name, ++ NULL // storage - auto-guess ++ ); + ZeitgeistEvent *event = zeitgeist_event_new_full ( + ZEITGEIST_ZG_DELETE_EVENT, + ZEITGEIST_ZG_USER_ACTIVITY, + ZEITGEIST_NAUTILUS_ACTOR, -+ zeitgeist_subject_new_full ( -+ uri, -+ NULL, // subject interpretation - auto-guess -+ NULL, // suject manifestation - auto-guess -+ NULL, // mime-type -+ origin, -+ display_name, -+ NULL // storage - auto-guess -+ ), NULL); ++ origin, ++ subject, ++ NULL ++ ); + send_event_to_zeitgeist (event); ++ g_object_unref (event); ++ g_object_unref (subject); + g_free (uri); + g_free (origin); -+ g_free (parse_name); ++ g_free (parse_name); + g_free (display_name); -+ file_iter = g_list_next (file_iter); ++ file_iter = g_list_next (file_iter); + } + // --- + g_list_free_full (job->files, g_object_unref); if (job->done_callback) { -@@ -4972,6 +5101,23 @@ +@@ -4972,6 +5110,23 @@ copy_job_done (gpointer user_data) job->done_callback_data); } @@ -182,12 +222,12 @@ + g_hash_table_iter_init (&iter, job->debuting_files); + while (g_hash_table_iter_next (&iter, (gpointer *) &file, &done)) { + if (GPOINTER_TO_INT (done)) { -+ // operation was completed successfully for this file -+ g_object_ref (file); -+ // FIXME: Set event origin to the original file URI, if we -+ // can somehow figure out which one it is. -+ log_zeitgeist_event_for_file_no_reply ( -+ ZEITGEIST_ZG_CREATE_EVENT, file, NULL); ++ // operation was completed successfully for this file ++ g_object_ref (file); ++ // FIXME: Set event origin to the original file URI, if we ++ // can somehow figure out which one it is. ++ log_zeitgeist_event_for_file_no_reply ( ++ ZEITGEIST_ZG_CREATE_EVENT, file, NULL); + } + } + // --- @@ -195,7 +235,7 @@ g_list_free_full (job->files, g_object_unref); if (job->destination) { g_object_unref (job->destination); -@@ -5544,6 +5690,19 @@ +@@ -5544,6 +5699,19 @@ move_job_done (gpointer user_data) job->done_callback_data); } @@ -215,7 +255,7 @@ g_list_free_full (job->files, g_object_unref); g_object_unref (job->destination); g_hash_table_unref (job->debuting_files); -@@ -5890,6 +6049,23 @@ +@@ -5890,6 +6058,23 @@ link_job_done (gpointer user_data) job->done_callback_data); } @@ -239,25 +279,25 @@ g_list_free_full (job->files, g_object_unref); g_object_unref (job->destination); g_hash_table_unref (job->debuting_files); -@@ -6374,6 +6550,14 @@ +@@ -6374,6 +6559,14 @@ create_job_done (gpointer user_data) job->done_callback_data); } + // Send event to Zeitgeist -+ if (job->created_file) { -+ g_object_ref (job->created_file); -+ log_zeitgeist_event_for_file_no_reply ( -+ ZEITGEIST_ZG_CREATE_EVENT, job->created_file, NULL); -+ } -+ // --- ++ if (job->created_file) { ++ g_object_ref (job->created_file); ++ log_zeitgeist_event_for_file_no_reply ( ++ ZEITGEIST_ZG_CREATE_EVENT, job->created_file, NULL); ++ } ++ // --- + g_object_unref (job->dest_dir); if (job->src) { g_object_unref (job->src); - -=== modified file 'nautilus-3.8.1/libnautilus-private/nautilus-file.c' ---- nautilus-3.8.1/libnautilus-private/nautilus-file.c 2015-11-24 10:44:52 +0000 -+++ nautilus-3.8.1/libnautilus-private/nautilus-file.c 2015-12-01 10:21:57 +0000 +diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c +index 8fde7c5..3e52643 100644 +--- a/libnautilus-private/nautilus-file.c ++++ b/libnautilus-private/nautilus-file.c @@ -90,6 +90,9 @@ #define DEBUG_REF_PRINTF printf #endif @@ -268,7 +308,7 @@ /* Files that start with these characters sort after files that don't. */ #define SORT_LAST_CHAR1 '.' #define SORT_LAST_CHAR2 '#' -@@ -1762,6 +1765,30 @@ +@@ -1754,6 +1757,33 @@ rename_get_info_callback (GObject *source_object, update_info_and_name (op->file, new_info); new_uri = nautilus_file_get_uri (op->file); @@ -285,33 +325,43 @@ + new_name, + NULL // storage - auto-guess + ); -+ zeitgeist_subject_set_current_uri (subject, new_uri); -+ g_free (origin); ++ zeitgeist_subject_set_current_uri (subject, new_uri); + // FIXME: zeitgeist_subject_set_current_uri (); + ZeitgeistEvent *event = zeitgeist_event_new_full ( + ZEITGEIST_ZG_MOVE_EVENT, + ZEITGEIST_ZG_USER_ACTIVITY, + ZEITGEIST_NAUTILUS_ACTOR, ++ origin, + subject, NULL); -+ zeitgeist_log_insert_events_no_reply (log, event, NULL); ++ zeitgeist_log_insert_event_no_reply (log, event, NULL); ++ g_object_unref (event); ++ g_object_unref (subject); ++ g_free (origin); + // --- + nautilus_directory_moved (old_uri, new_uri); g_free (new_uri); g_free (old_uri); - -=== modified file 'nautilus-3.8.1/test/Makefile.am' ---- nautilus-3.8.1/test/Makefile.am 2015-11-24 10:44:52 +0000 -+++ nautilus-3.8.1/test/Makefile.am 2015-12-01 10:23:01 +0000 -@@ -6,6 +6,7 @@ +diff --git a/test/Makefile.am b/test/Makefile.am +index c78212d..4a96756 100644 +--- a/test/Makefile.am ++++ b/test/Makefile.am +@@ -6,6 +6,7 @@ AM_CPPFLAGS =\ $(COMMON_CFLAGS) \ $(NAUTILUS_CFLAGS) \ $(WARNING_CFLAGS) \ -+ `pkg-config --cflags zeitgeist-1.0` \ ++ $(ZEITGEIST_CFLAGS) \ -DVERSION="\"$(VERSION)\"" \ -DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \ -DGNOMELOCALEDIR=\""$(prefix)/${DATADIRNAME}/locale"\" \ -@@ -22,6 +23,7 @@ +@@ -16,12 +17,14 @@ LDADD =\ + $(BASE_LIBS) \ + $(COMMON_LIBS) \ + $(NAUTILUS_LIBS) \ ++ $(ZEITGEIST_LIBS) \ + $(NULL) + + noinst_PROGRAMS =\ test-nautilus-search-engine \ test-nautilus-directory-async \ test-nautilus-copy \ @@ -319,29 +369,27 @@ $(NULL) test_nautilus_copy_SOURCES = test-copy.c test.c -@@ -30,6 +32,10 @@ +@@ -30,6 +33,8 @@ test_nautilus_search_engine_SOURCES = test-nautilus-search-engine.c test_nautilus_directory_async_SOURCES = test-nautilus-directory-async.c +test_nautilus_zeitgeist_SOURCES = test-nautilus-zeitgeist.c + -+test_nautilus_zeitgeist_LDCONFIG = `pkg-config --libs zeitgeist-1.0` -+ EXTRA_DIST = \ test.h \ $(NULL) - -Index: nautilus-3.8.1/test/run-zeitgeist-test.sh -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ nautilus-3.8.1/test/run-zeitgeist-test.sh 2013-06-04 22:27:52.524397563 -0400 +diff --git a/test/run-zeitgeist-test.sh b/test/run-zeitgeist-test.sh +new file mode 100755 +index 0000000..7dbe1d8 +--- /dev/null ++++ b/test/run-zeitgeist-test.sh @@ -0,0 +1,50 @@ +#! /bin/sh -e + +#echo "Building..." +#gcc test-nautilus-zeitgeist.c -o test-nautilus-zeitgeist \ +# ../libnautilus-private/nautilus-file-operations.c \ -+# `pkg-config --cflags --libs glib-2.0 gtk+-3.0 zeitgeist-1.0` -I.. \ ++# `pkg-config --cflags --libs glib-2.0 gtk+-3.0 zeitgeist-2.0` -I.. \ +[ "`basename $(pwd)`" = "test" ] || echo "Please cd into test/" +[ "`basename $(pwd)`" = "test" ] || exit +make @@ -386,10 +434,11 @@ +echo "Cleaning up..." +zeitgeist-daemon --quit +rm -r "${TMP_PATH}" -Index: nautilus-3.8.1/test/test-nautilus-zeitgeist.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ nautilus-3.8.1/test/test-nautilus-zeitgeist.c 2013-06-04 22:27:52.524397563 -0400 +diff --git a/test/test-nautilus-zeitgeist.c b/test/test-nautilus-zeitgeist.c +new file mode 100644 +index 0000000..3f4fa35 +--- /dev/null ++++ b/test/test-nautilus-zeitgeist.c @@ -0,0 +1,343 @@ +/* + * Copyright © 2012 Canonical Ltd. @@ -465,7 +514,7 @@ + // Create event template + ZeitgeistEvent *event_template = zeitgeist_event_new_full ( + event_interpretation, ZEITGEIST_ZG_USER_ACTIVITY, NULL, -+ subject_template, NULL); ++ origin, subject_template, NULL); + + // Add event template to the fixture for later verification + g_ptr_array_add (fix->expected_events, (gpointer) event_template); @@ -512,7 +561,7 @@ + + for (i = 0; i < fix->num_expected_events; ++i) + { -+ ZeitgeistEvent *event = zeitgeist_result_set_next (results); ++ ZeitgeistEvent *event = zeitgeist_result_set_next_value (results); + ZeitgeistEvent *tmpl = g_ptr_array_index (fix->expected_events, i); + assert_event_matches_template (event, tmpl); + } @@ -709,7 +758,7 @@ + g_main_loop_run (fix->mainloop); +} + -+int ++int +main (int argc, char* argv[]) +{ + g_type_init (); @@ -734,3 +783,6 @@ + + return g_test_run (); +} +-- +2.6.2 +