From 7d6ce966a79e88e0ed14b9495b7e2e5a94f9007b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 15 Jul 2007 00:10:26 +0000 Subject: Gracefully handle inability to load window icon (SVG). git-svn-id: http://svn.drobilla.net/lad/ingen@588 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/App.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index befca9d3..5ea42d92 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -109,8 +109,13 @@ App::run(int argc, char** argv, _instance->configuration()->load_settings(); _instance->configuration()->apply_settings(); - if (Glib::file_test(PKGDATADIR "/ingen.svg", Glib::FILE_TEST_EXISTS)) - Gtk::Window::set_default_icon_from_file(PKGDATADIR "/ingen.svg"); + const Glib::ustring icon_path = PKGDATADIR "/ingen.svg"; + try { + if (Glib::file_test(icon_path, Glib::FILE_TEST_EXISTS)) + Gtk::Window::set_default_icon_from_file(icon_path); + } catch (Gdk::PixbufError err) { + cerr << "Unable to load window icon " << icon_path << ": " << err.what() << endl; + } App::instance().connect_window()->start(engine, interface); -- cgit v1.2.1