From a4afc8e3dd6ce7c5f02d0eb69f03bf9f043afed0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 27 Apr 2014 20:50:13 +0100 Subject: Open an error dialogue on uncaught exceptions in the main loop. Check that the ImageContent constructor found some valid files when scanning a folder. --- src/lib/image_content.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/image_content.cc') diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 13f7c52e3..3b87fcf00 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -44,7 +44,11 @@ ImageContent::ImageContent (shared_ptr f, boost::filesystem::path p) _paths.push_back (i->path ()); } } - + + if (_paths.empty()) { + throw FileError (_("No valid image files were found in the folder."), p); + } + sort (_paths.begin(), _paths.end()); } } -- cgit v1.2.3