f-spot r4532 - in trunk: . src tools
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4532 - in trunk: . src tools
- Date: Thu, 23 Oct 2008 20:53:23 +0000 (UTC)
Author: sdelcroix
Date: Thu Oct 23 20:53:23 2008
New Revision: 4532
URL: http://svn.gnome.org/viewvc/f-spot?rev=4532&view=rev
Log:
2008-10-23 Stephane Delcroix <sdelcroix novell com>
* src/MainWindow.cs:
* tools/f-spot-import: fix the import uri to match the nautilus one,
avoid popping the multiple camera detection dialog.
Modified:
trunk/ChangeLog
trunk/src/MainWindow.cs
trunk/tools/f-spot-import
Modified: trunk/src/MainWindow.cs
==============================================================================
--- trunk/src/MainWindow.cs (original)
+++ trunk/src/MainWindow.cs Thu Oct 23 20:53:23 2008
@@ -1658,6 +1658,7 @@
public void ImportCamera (string camera_device)
{
+ Log.DebugFormat ("ImportCamera {0}", camera_device);
GPhotoCamera cam = new GPhotoCamera();
try {
@@ -1678,10 +1679,9 @@
selected_cam = 0;
} else {
bool found = false;
- if (camera_device != null) {
- string port = camera_device.Remove (0, "gphoto2:".Length);
- for (int i = 0; i < num_cameras; i++)
- if (cam.CameraList.GetValue (i) == port) {
+ if (camera_device != null)
+ for (int i = 0; i < num_cameras; i++) {
+ if (camera_device.IndexOf (cam.CameraList.GetValue(i)) != 0) {
selected_cam = i;
found = true;
break;
Modified: trunk/tools/f-spot-import
==============================================================================
--- trunk/tools/f-spot-import (original)
+++ trunk/tools/f-spot-import Thu Oct 23 20:53:23 2008
@@ -1,20 +1,23 @@
-#!/bin/bash
+#!/bin/bash -x
udi="$1"
#xmessage $udi
-mount_point=`hal-get-property --udi="$udi" --key=volume.mount_point`
-if [ -n "$mount_point" ]; then
- # USB Mass Storage camera: need to pass f-spot a mount point
- f-spot --import "$mount_point"
+if [ "$udi" != "${udi#gphoto2:}" ]; then
+ # gphoto2, as passed by nautilus.
+ f-spot --import "$udi"
+ exit
+fi
+mount_point=`hal-get-property --udi="$udi" --key=volume.mount_point` || true
+if [ -n "$mount_point" ]; then
+ # USB Mass Storage camera: need to pass f-spot a mount point
+ f-spot --import "$mount_point"
else
- # Some other camera try GPhoto2
-
- bus=`hal-get-property --udi="$udi" --key=usb.bus_number`
- dev=`hal-get-property --udi="$udi" --key=usb.linux.device_number`
- uri=`printf gphoto2:usb:%.3d,%.3d $bus $dev`
+ # Some other camera try GPhoto2
- echo $uri
+ bus=`hal-get-property --udi="$udi" --key=usb.bus_number`
+ dev=`hal-get-property --udi="$udi" --key=usb.linux.device_number`
+ uri=`printf gphoto2:[usb:%.3d,%.3d] $bus $dev`
- f-spot --import "$uri"
+ f-spot --import "$uri"
fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]