summaryrefslogtreecommitdiff
path: root/src/direct
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-06-05 04:23:39 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-06-05 04:23:39 +0200
commit4e10e30c2f99d552239871aa1b27a08a6c18f1a4 (patch)
treefc8426e57068733d7df20fc3a963f11cd864f079 /src/direct
parent0d64f78a02829282cd00dd6df691df08d29ed751 (diff)
Imported Upstream version 0.23.1upstream/0.23.1
Diffstat (limited to 'src/direct')
-rw-r--r--src/direct/Direct.vala2
-rw-r--r--src/direct/DirectPhoto.vala8
-rw-r--r--src/direct/DirectPhotoPage.vala16
-rw-r--r--src/direct/DirectView.vala2
-rw-r--r--src/direct/DirectWindow.vala2
5 files changed, 21 insertions, 9 deletions
diff --git a/src/direct/Direct.vala b/src/direct/Direct.vala
index 59680b1..028b190 100644
--- a/src/direct/Direct.vala
+++ b/src/direct/Direct.vala
@@ -1,4 +1,4 @@
-/* Copyright 2011-2015 Yorba Foundation
+/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
diff --git a/src/direct/DirectPhoto.vala b/src/direct/DirectPhoto.vala
index 9cd86f9..4016ee2 100644
--- a/src/direct/DirectPhoto.vala
+++ b/src/direct/DirectPhoto.vala
@@ -1,4 +1,4 @@
-/* Copyright 2009-2015 Yorba Foundation
+/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
@@ -121,8 +121,10 @@ public class DirectPhoto : Photo {
}
public override Gdk.Pixbuf? get_thumbnail(int scale) throws Error {
- return (get_metadata().get_preview_count() == 0) ? null :
- get_orientation().rotate_pixbuf(get_metadata().get_preview(0).get_pixbuf());
+ var metadata = get_metadata();
+
+ return (metadata == null || metadata.get_preview_count() == 0) ? null :
+ get_orientation().rotate_pixbuf(metadata.get_preview(0).get_pixbuf());
}
protected override void notify_altered(Alteration alteration) {
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala
index 58d82fc..3d23528 100644
--- a/src/direct/DirectPhotoPage.vala
+++ b/src/direct/DirectPhotoPage.vala
@@ -1,4 +1,4 @@
-/* Copyright 2009-2015 Yorba Foundation
+/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
@@ -242,7 +242,12 @@ public class DirectPhotoPage : EditingHostPage {
DirectPhoto? photo = DirectPhoto.global.get_file_source(initial_file);
- display_mirror_of(view_controller, photo);
+ if (photo != null) {
+ display_mirror_of(view_controller, photo);
+ } else {
+ AppWindow.panic(_("Unable open photo %s. Sorry.").printf(initial_file.get_path()));
+ }
+
initial_file = null;
}
@@ -406,7 +411,12 @@ public class DirectPhotoPage : EditingHostPage {
base.update_actions(selected_count, count);
}
- private bool check_ok_to_close_photo(Photo photo) {
+ private bool check_ok_to_close_photo(Photo? photo) {
+ // Means we failed to load the photo for some reason. Do not block
+ // shutdown
+ if (photo == null)
+ return true;
+
if (!photo.has_alterations())
return true;
diff --git a/src/direct/DirectView.vala b/src/direct/DirectView.vala
index 6f37850..afafff2 100644
--- a/src/direct/DirectView.vala
+++ b/src/direct/DirectView.vala
@@ -1,4 +1,4 @@
-/* Copyright 2011-2015 Yorba Foundation
+/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
diff --git a/src/direct/DirectWindow.vala b/src/direct/DirectWindow.vala
index 35729b7..2a33423 100644
--- a/src/direct/DirectWindow.vala
+++ b/src/direct/DirectWindow.vala
@@ -1,4 +1,4 @@
-/* Copyright 2009-2015 Yorba Foundation
+/* Copyright 2016 Software Freedom Conservancy Inc.
*
* This software is licensed under the GNU LGPL (version 2.1 or later).
* See the COPYING file in this distribution.