[shotwell] Fix icon and label for mass storage cameras
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Fix icon and label for mass storage cameras
- Date: Mon, 21 Oct 2019 21:37:55 +0000 (UTC)
commit 9e1b3506b9882f8d08616577ede43dc627620e2f
Author: Jens Georg <mail jensge org>
Date: Mon Oct 21 22:55:09 2019 +0200
Fix icon and label for mass storage cameras
src/camera/CameraTable.vala | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/camera/CameraTable.vala b/src/camera/CameraTable.vala
index 5f888acd..a34ab215 100644
--- a/src/camera/CameraTable.vala
+++ b/src/camera/CameraTable.vala
@@ -252,9 +252,15 @@ public class CameraTable {
try {
var mount = File.new_for_path (port.substring(5)).find_enclosing_mount();
var volume = mount.get_volume();
- // Translators: First %s is the name of camera as gotten from GPhoto, second is the
GVolume name, e.g. Mass storage camera (510MB volume)
- display_name = _("%s (%s)").printf (name, volume.get_name ());
- icon = volume.get_symbolic_icon().to_string();
+ if (volume != null) {
+ // Translators: First %s is the name of camera as gotten from GPhoto, second is the
GVolume name, e.g. Mass storage camera (510MB volume)
+ display_name = _("%s (%s)").printf (name, volume.get_name ());
+ icon = volume.get_symbolic_icon().to_string();
+ } else {
+ // Translators: First %s is the name of camera as gotten from GPhoto, second is the
GMount name, e.g. Mass storage camera (510MB volume)
+ display_name = _("%s (%s)").printf (name, mount.get_name ());
+ icon = mount.get_symbolic_icon().to_string();
+ }
} catch (Error e) { }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]