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 510325 - x-content/* support
x-content/* support
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
SVN
Other Linux
: Normal normal
: ---
Assigned To: F-spot maintainers
F-spot maintainers
: 516383 (view as bug list)
Depends on:
Blocks: 510319
 
 
Reported: 2008-01-18 04:42 UTC by David Zeuthen (not reading bugmail)
Modified: 2008-04-24 15:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.34 KB, patch)
2008-03-28 10:20 UTC, Stephane Delcroix
committed Details | Review

Description David Zeuthen (not reading bugmail) 2008-01-18 04:42:26 UTC
Please include support for the new x-content/* machinery available in Nautilus.
Specifically, adding support for the types

 x-content/image-dcf
 x-content/image-picturecd

would make sense.

Please see bug 510319 for details about x-content/*. Thanks.
Comment 1 David Zeuthen (not reading bugmail) 2008-01-18 06:27:03 UTC
I should also add that I'm currently working on a gphoto2 backend for gvfs. So when that one lands (aiming for 2.22 actually) you can use this to get the photos from the media; the only difference is that the URI would be 

 gphoto2://usb-4-1/dcim/100eos5d/_mg_0348.jpg

instead of

 file:///media/EOS_DIGITAL/dcim/100eos5d/_mg_0348.jpg

Of course this would mean that you'd need to use gio instead of what you're using now but you probably want that anyway. If you do that and your only use of gphoto2 is to download photos (e.g. no camera remote control) you should be able to completely remove gphoto2 from f-spor proper.
Comment 2 Stephane Delcroix 2008-02-14 16:48:26 UTC
*** Bug 516383 has been marked as a duplicate of this bug. ***
Comment 3 Michael Monreal 2008-03-23 22:24:48 UTC
Stephane, can we have MimeType=x-content/image-dcf,x-content/image-picturecd added to the f-spot .desktop file?

Comment #1 is a future task, just adding the x-content would make f-spot show up in the new default application handler in nautilus 2.22 which probably many users (all those who started f-spot import using gnome-volume-manager before) want.
Comment 4 Stephane Delcroix 2008-03-27 10:05:56 UTC
David,

I totally understand the need for x-content/* support, but still don't know how to implement this correctly for f-spot. Hope you'll be able to enlighten me on how other projects are dealing with the same problems:

* g-v-m was able to launch commands with some flags, like "banshee --play --audio-cd %d". How is this supposed to work with Exec ?
* g-v-m allowed us to lauch a special script on import "f-spot-import %h", responsible of getting the mount point from hal for mass-storage camera or a gphoto2: path for the others. How can I launch a special command with the Exec machinery ?
* what about the %d, %s, %h flags handled by g-v-m and not by Exec ?

As I see the thing, there's 2 options:
* the ugly one: create a f-spot-import.desktop file, Exec'ing f-spot-import %u
* the long and hard one: import on Exec "f-spot %u". And I'm not even sure I'd like having import as the default action on command-line invocation...

Comment 5 David Zeuthen (not reading bugmail) 2008-03-27 17:03:28 UTC
(In reply to comment #4)
> David,
> 
> I totally understand the need for x-content/* support, but still don't know how
> to implement this correctly for f-spot. Hope you'll be able to enlighten me on
> how other projects are dealing with the same problems:
> 
> * g-v-m was able to launch commands with some flags, like "banshee --play
> --audio-cd %d". How is this supposed to work with Exec ?

In general you just want the URI using %u; from the URI you can use gio to get the device file (through g_volume_get_identifier()). 

And ideally apps should use the gio/gvfs file system drivers to access the device (e.g. cdda:// for audio discs and gphoto2:// for PTP and MTP devices). Which I do appreciate is some work. But in the long run it will simplify your application and making sharing the device with e.g. Nautilus / other apps work a lot better.

But see below for what do to in the interim.

> * g-v-m allowed us to lauch a special script on import "f-spot-import %h",
> responsible of getting the mount point from hal for mass-storage camera or a
> gphoto2: path for the others. How can I launch a special command with the Exec
> machinery ?

See below.

> * what about the %d, %s, %h flags handled by g-v-m and not by Exec ?
> 
> As I see the thing, there's 2 options:
> * the ugly one: create a f-spot-import.desktop file, Exec'ing f-spot-import %u

I'm not sure what's so ugly about this? It's probably what you want in general since you can 

 - tweak the name to e.g. "F-Spot photo importer"
 - tweak the icon (the one that appaears in Nautilus' preference dialog
   in the Media tab)
 - start f-sport with --import if you want to avoid a wrapper script.

You'd also want to use NoDisplay in that desktop file.

For the interim e.g. where the app don't use gio natively, said import wrapper could take the URI (e.g. cdda:// or gphoto2://) and use g_volume_get_identifier() to get the device file. It would also unmount the gvfs file system for things like gphoto2:// where the USB device is claimed by the gvfs backend (USB only supports one opener).

> * the long and hard one: import on Exec "f-spot %u". And I'm not even sure I'd
> like having import as the default action on command-line invocation...

I'd just use a dedicated desktop file like mentioned above. It's perfectly fine to do so.
Comment 6 Stephane Delcroix 2008-03-28 10:20:39 UTC
Created attachment 108165 [details] [review]
proposed patch

Does this patch makes sense to you ? I currently have no way to test it, as I'm still running nautilus 2.20
Comment 7 Stephane Delcroix 2008-04-24 15:33:25 UTC
works fine on opensuse11. committed as r3842.