After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 627311 - [PATCH] Zeitgeist support
[PATCH] Zeitgeist support
Status: RESOLVED WONTFIX
Product: cheese
Classification: Applications
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2010-08-18 21:45 UTC by Michal Hruby
Modified: 2014-03-31 14:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch (3.79 KB, patch)
2010-08-18 23:22 UTC, Michal Hruby
needs-work Details | Review
Second stab at the patch (3.99 KB, patch)
2010-08-20 00:11 UTC, Michal Hruby
none Details | Review
Updated to apply against trunk (8.70 KB, patch)
2010-08-21 20:01 UTC, Siegfried Gevatter (RainCT)
none Details | Review
Updated patch (4.45 KB, patch)
2010-09-24 21:56 UTC, Siegfried Gevatter (RainCT)
rejected Details | Review
Add Zeitgeist support (4.20 KB, patch)
2011-04-15 15:15 UTC, Seif Lotfy
needs-work Details | Review
Add Zeitgeist support for Pictures and Videos (3.98 KB, patch)
2011-11-06 00:53 UTC, Seif Lotfy
rejected Details | Review

Description Michal Hruby 2010-08-18 21:45:06 UTC
Attached patch adds optional Zeitgeist dependency and pushes events to Zeitgeist when picture is taken / video is recorded. Unfortunately I didn't have all required dependencies to build git Cheese, so this wasn't really tested in any way.
Comment 1 Michal Hruby 2010-08-18 23:22:10 UTC
Created attachment 168246 [details] [review]
The patch
Comment 2 daniel g. siegel 2010-08-18 23:33:07 UTC
Review of attachment 168246 [details] [review]:

nice patch, would you mind fixing the missing points? (shouldnt take you long)

::: configure.ac
@@ +175,3 @@
+  zeitgeist-1.0 >= $LIBZEITGEIST_REQUIRED,
+  has_libzg=yes,
+  AC_MSG_WARN([zeitgeist-1.0 not found. Zeitgeist support disabled.])

didnt try this, but it would be cool to have an option

--disable-zeitgeist and
--enable-zeitgeist

::: src/cheese-window.vala
@@ +590,3 @@
                                  null);
     this.camera.take_photo (file_name);
+    this.push_to_zeitgeist (file_name, true);

missing #if HAVE_LIBZG

@@ +646,3 @@
+        string filename = fileutil.get_new_media_filename (this.current_mode);
+        camera.start_video_recording (filename);
+        this.push_to_zeitgeist (filename, false);

missing #if HAVE_LIBZG

@@ +1073,3 @@
+#if HAVE_LIBZG
+  private Zeitgeist.Log zg_log = null;
+#endif

better: one big 	

#if HAVE_LIBZG

around the whole block

@@ +1081,3 @@
+    string interpretation = is_photo ?
+      Zeitgeist.NFO_RASTER_IMAGE : Zeitgeist.VIDEO;
+    string title = "%s taken using Cheese".printf (is_photo ? "Photo":"Video");

shouldnt this string be translated?

@@ +1090,3 @@
+      size_t n = (char*)substr - (char*)uri;
+      origin = uri.ndup (n);
+    }

please use 

fileutil.get_photo_path () 

and

fileutil.get_video_path ()

instead
Comment 3 Michal Hruby 2010-08-20 00:11:29 UTC
Created attachment 168342 [details] [review]
Second stab at the patch

Fixes according to the review, though I left the defines in the vala file, as this way it doesn't pollute the original code with the awful #ifs (and calling empty functions doesn't hurt).
Comment 4 Siegfried Gevatter (RainCT) 2010-08-21 20:01:09 UTC
Created attachment 168469 [details] [review]
Updated to apply against trunk
Comment 5 daniel g. siegel 2010-08-22 16:22:56 UTC
(In reply to comment #4)
> Created an attachment (id=168469) [details] [review]
> Updated to apply against trunk

please drop the foo.patch file from the patch
Comment 6 Siegfried Gevatter (RainCT) 2010-09-24 21:56:55 UTC
Created attachment 171068 [details] [review]
Updated patch
Comment 7 daniel g. siegel 2010-10-23 00:14:16 UTC
your patch does not apply to current git master, could you update?
Comment 8 Akhil Laddha 2011-03-10 10:13:18 UTC
Siegfried Gevatter, ping, did you get time to update patch as per current git master code base ?
Comment 9 Seif Lotfy 2011-04-15 15:15:58 UTC
Created attachment 186026 [details] [review]
Add Zeitgeist support
Comment 10 Seif Lotfy 2011-04-28 13:05:24 UTC
Review of attachment 171068 [details] [review]:

This is outdated
Comment 11 Seif Lotfy 2011-04-28 13:05:25 UTC
Review of attachment 171068 [details] [review]:

This is outdated
Comment 12 David King 2011-10-16 14:03:12 UTC
Review of attachment 186026 [details] [review]:

I am in the progress of updating the build system, so it is probably best to hold off on any updates to the patch until tomorrow. The changes will require some alterations to the configure.ac and Makefile.am changes.

::: src/Makefile.am
@@ -56,1 +56,5 @@
 	$(CHEESE_GTK_LIBS)
+	
+
+if HAVE_LIBZG
+VALAFLAGS += --define=HAVE_LIBZG --pkg zeitgeist-1.0

HAVE_LIBZG should be output to the configuration header with AC_DEFINE.

::: src/cheese-window.vala
@@ +675,3 @@
                                    null);
       this.camera.take_photo (file_name);
+      this.push_to_zeitgeist (file_name, true);

Needs an #if HAVE_LIBZG.

@@ +763,3 @@
     if (is_start)
     {
       camera.start_video_recording (fileutil.get_new_media_filename (this.current_mode));

I think that you meant to remove this line, as you call start_video_recording() below.

@@ +764,3 @@
     {
       camera.start_video_recording (fileutil.get_new_media_filename (this.current_mode));
+      string filename = fileutil.get_new_media_filename (this.current_mode);

Also needs an #if HAVE_LIBZG.

@@ -1283,2 +1287,4 @@
     camera.play ();
   }
+
+#if HAVE_LIBZG

There should be one #if HAVE_LIBZGaround the whole block (function and declaration), as mentioned in a previous review.

@@ -1285,0 +1289,6 @@
+
+#if HAVE_LIBZG
+  private Zeitgeist.Log zg_log = null;
... 3 more ...

A boolean parameter here is pretty ugly, although Cheese is unlikely to gain the ability to capture other media.  It seems that Zeitgeist already provides constants for those: Zeitgeist.NFO_RASTER_IMAGE and Zeitgeist.NFO_VIDEO (or maybe something better, as those appear to be string constants). Of course, if those constants are used, there must be #if HAVE_LIBZG blocks around any calls to push_to_zeitgeist(), as the constants will not be available if Zeitgeist is not installed.

@@ +1314,3 @@
+                                         subject, null);
+
+    if (zg_log == null) zg_log = new Zeitgeist.Log ();

zg_log = new Zeitgeist.Log (); should be on the line after the if condition.
Comment 13 Seif Lotfy 2011-11-06 00:52:21 UTC
Comment on attachment 186026 [details] [review]
Add Zeitgeist support

Attaching new patch
Comment 14 Seif Lotfy 2011-11-06 00:53:33 UTC
Created attachment 200804 [details] [review]
Add Zeitgeist support for Pictures and Videos
Comment 15 David King 2011-11-06 16:29:03 UTC
Review of attachment 200804 [details] [review]:

This is not a git-formatted patch, please create one before sending an update. The configure.ac changes show that you are basing your patch on the stable branch, which does not have the build system changes that I mentioned in the previous review. Please ensure that you base future updates to the patch on the master branch, Finally, you ignored most of my requests in the previous review. Please either correct the patch based on my comments, or explain your reasoning for not doing so.
Comment 16 David King 2014-03-31 14:01:50 UTC
Since commit d0cd9db7c92b258aea34e7b4d42ef4f1c7a4958e, Cheese adds tags to saved media, including the application name and device, so I do not think that zeitgeist support is desirable any longer.