summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryce Harrington <bryce@bryceharrington.org>2013-09-22 02:46:12 +0000
committerbryce <bryce@canonical.com>2013-09-22 02:46:12 +0000
commit4ecb7f9d77f45f7eaaca0465d2f549efef766e77 (patch)
tree24c9def3e2b961b3197d1fa340845c7753381bc3 /src
parentMerge gsoc procedural templates work. (diff)
downloadinkscape-4ecb7f9d77f45f7eaaca0465d2f549efef766e77.tar.gz
inkscape-4ecb7f9d77f45f7eaaca0465d2f549efef766e77.zip
units: Catch FileError if no units.xml is in /usr/local/...
Reproducible by building and running inkscape in-tree, without installation. #10 0x0000000000aa6873 in Inkscape::Util::UnitTable::UnitTable (this=0x11f75e0) at util/units.cpp:195 filename = 0x121e8f0 "/usr/local/share/inkscape/ui/units.xml" (bzr r12571)
Diffstat (limited to 'src')
-rw-r--r--src/util/units.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/units.cpp b/src/util/units.cpp
index e5c6f74fb..59717d0b5 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -321,6 +321,9 @@ bool UnitTable::load(std::string const &filename) {
Glib::ustring unitfile = Glib::file_get_contents(filename);
ctx.parse(unitfile);
ctx.end_parse();
+ } catch (Glib::FileError const &e) {
+ g_warning("Units file %s is missing: %s\n", filename.c_str(), e.what().c_str());
+ return false;
} catch (Glib::MarkupError const &e) {
g_warning("Problem loading units file '%s': %s\n", filename.c_str(), e.what().c_str());
return false;