346346b1a0
Upstream changes: 0.11.5: ------- This release fixes an issue in which Shotwell could crash when using the "Import from F-Spot" feature for the subset of users who continued to experience this problem after the 0.11.4 upgrade. We recommend that all users upgrade. 0.11.4; ------- This release fixes two critical issues present in all previous versions of Shotwell 0.11.x that could cause Shotwell to crash when using the Import from F-Spot feature. We recommend that all users upgrade. 0.11.3: ------- This releases fixes two critical bugs, including: * Shotwell could crash at the end of photo imports where one or more files failed to import correctly * Showell crashed when a new tag containing a slash (/) character was created by context-clicking on the Tags item in the sidebar and choosing New and improves error reporting in the publishing system. 0.11.2: ------- * Improved stability working with hierarchical tags * Importing hierarchical tags from F-Spot doesn't generate duplicate top-level tags * Fixed "server redirect contained no session key" errors in the Facebook Connector * Corrected problems with item counts over mixed media
116 lines
4.8 KiB
Text
116 lines
4.8 KiB
Text
$NetBSD: patch-ab,v 1.5 2011/10/22 13:51:02 gls Exp $
|
|
|
|
--- src/camera/CameraTable.vala.orig 2011-10-13 19:22:54.000000000 +0000
|
|
+++ src/camera/CameraTable.vala
|
|
@@ -26,7 +26,6 @@ public class CameraTable {
|
|
|
|
private static CameraTable instance = null;
|
|
|
|
- private GUdev.Client client = new GUdev.Client(SUBSYSTEMS);
|
|
private OneShotScheduler camera_update_scheduler = null;
|
|
private GPhoto.Context null_context = new GPhoto.Context();
|
|
private GPhoto.CameraAbilitiesList abilities_list;
|
|
@@ -44,7 +43,6 @@ public class CameraTable {
|
|
on_update_cameras);
|
|
|
|
// listen for interesting events on the specified subsystems
|
|
- client.uevent.connect(on_udev_event);
|
|
volume_monitor = VolumeMonitor.get();
|
|
volume_monitor.volume_changed.connect(on_volume_changed);
|
|
volume_monitor.volume_added.connect(on_volume_changed);
|
|
@@ -105,31 +103,6 @@ public class CameraTable {
|
|
private string[] get_all_usb_cameras() {
|
|
string[] cameras = new string[0];
|
|
|
|
- GLib.List<GUdev.Device> device_list = client.query_by_subsystem(null);
|
|
- foreach (GUdev.Device device in device_list) {
|
|
- string device_file = device.get_device_file();
|
|
- if(
|
|
- // only keep devices that have a non-null device file and that
|
|
- // have both the ID_GPHOTO2 and GPHOTO2_DRIVER properties set
|
|
- (device_file != null) &&
|
|
- (device.has_property("ID_GPHOTO2")) &&
|
|
- (device.has_property("GPHOTO2_DRIVER"))
|
|
- ) {
|
|
- int camera_bus, camera_device;
|
|
- // extract the bus and device IDs from the device file string
|
|
- // TODO: is it safe to parse the absolute path or should we be
|
|
- // smarter and use a regex to only pick up the end of the path?
|
|
- if (device_file.scanf("/dev/bus/usb/%d/%d", out camera_bus, out camera_device) < 2) {
|
|
- critical("get_all_usb_cameras: Failed to scanf device file %s", device_file);
|
|
-
|
|
- continue;
|
|
- }
|
|
- string camera = "usb:%.3d,%.3d".printf(camera_bus, camera_device);
|
|
- debug("USB camera detected at %s", camera);
|
|
- cameras += camera;
|
|
- }
|
|
- }
|
|
-
|
|
return cameras;
|
|
}
|
|
|
|
@@ -204,24 +177,6 @@ public class CameraTable {
|
|
"/dev/bus/usb/%s".printf(port.substring(4).replace(",", "/")) : null;
|
|
}
|
|
|
|
- private string? get_name_for_uuid(string uuid) {
|
|
- foreach (Volume volume in volume_monitor.get_volumes()) {
|
|
- if (volume.get_identifier(VOLUME_IDENTIFIER_KIND_UUID) == uuid) {
|
|
- return volume.get_name();
|
|
- }
|
|
- }
|
|
- return null;
|
|
- }
|
|
-
|
|
- private GLib.Icon? get_icon_for_uuid(string uuid) {
|
|
- foreach (Volume volume in volume_monitor.get_volumes()) {
|
|
- if (volume.get_identifier(VOLUME_IDENTIFIER_KIND_UUID) == uuid) {
|
|
- return volume.get_icon();
|
|
- }
|
|
- }
|
|
- return null;
|
|
- }
|
|
-
|
|
private void update_camera_table() throws GPhotoError {
|
|
// need to do this because virtual ports come and go in the USB world (and probably others)
|
|
GPhoto.PortInfoList port_info_list;
|
|
@@ -311,23 +266,6 @@ public class CameraTable {
|
|
continue;
|
|
}
|
|
|
|
- // Get display name for camera.
|
|
- string path = get_port_path(port);
|
|
- if (null != path) {
|
|
- GUdev.Device device = client.query_by_device_file(path);
|
|
- string serial = device.get_property("ID_SERIAL_SHORT");
|
|
- if (null != serial) {
|
|
- // Try to get the name and icon.
|
|
- display_name = get_name_for_uuid(serial);
|
|
- icon = get_icon_for_uuid(serial);
|
|
- }
|
|
- if (null == display_name) {
|
|
- display_name = device.get_sysfs_attr("product");
|
|
- }
|
|
- if (null == display_name) {
|
|
- display_name = device.get_property("ID_MODEL");
|
|
- }
|
|
- }
|
|
if (null == display_name) {
|
|
// Default to GPhoto detected name.
|
|
display_name = name;
|
|
@@ -365,14 +303,6 @@ public class CameraTable {
|
|
}
|
|
}
|
|
|
|
- private void on_udev_event(string action, GUdev.Device device) {
|
|
- debug("udev event: %s on %s", action, device.get_name());
|
|
-
|
|
- // Device add/removes often arrive in pairs; this allows for a single
|
|
- // update to occur when they come in all at once
|
|
- camera_update_scheduler.after_timeout(UPDATE_DELAY_MSEC, true);
|
|
- }
|
|
-
|
|
public void on_volume_changed(Volume volume) {
|
|
camera_update_scheduler.after_timeout(UPDATE_DELAY_MSEC, true);
|
|
}
|