summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-11-15 17:17:25 +0000
committerTavmjong Bah <tavmjong@free.fr>2017-11-15 17:17:25 +0000
commitd022543be3b0968c4a6851c120b78b289c156e8e (patch)
treecace879487137b792de27dcfbf23b1e30be87022
parentMisc. Typo fixes (diff)
downloadinkscape-d022543be3b0968c4a6851c120b78b289c156e8e.tar.gz
inkscape-d022543be3b0968c4a6851c120b78b289c156e8e.zip
Catch Gtk::IconThemeError
-rw-r--r--src/ui/widget/dock-item.cpp7
-rw-r--r--src/ui/widget/imagetoggler.cpp11
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp
index 18ab70eb4..4a06163e1 100644
--- a/src/ui/widget/dock-item.cpp
+++ b/src/ui/widget/dock-item.cpp
@@ -45,7 +45,12 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l
int width = 0;
int height = 0;
Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height);
- _icon_pixbuf = iconTheme->load_icon(icon_name, width);
+ try {
+ _icon_pixbuf = iconTheme->load_icon(icon_name, width);
+ }
+ catch (const Gtk::IconThemeError& e) {
+ std::cerr << "DocItem::DocItem(): " << e.what() << std::endl;
+ }
}
if ( _icon_pixbuf ) {
diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp
index a2783ecb1..38c84ca51 100644
--- a/src/ui/widget/imagetoggler.cpp
+++ b/src/ui/widget/imagetoggler.cpp
@@ -16,6 +16,8 @@
#include "widgets/toolbox.h"
#include "ui/icon-names.h"
+#include <iostream>
+
namespace Inkscape {
namespace UI {
namespace Widget {
@@ -37,8 +39,13 @@ ImageToggler::ImageToggler( char const* on, char const* off) :
int phys = width;
Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
- _property_pixbuf_on = icon_theme->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_off = icon_theme->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0);
+ try {
+ _property_pixbuf_on = icon_theme->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0);
+ _property_pixbuf_off = icon_theme->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0);
+ }
+ catch (const Gtk::IconThemeError& e) {
+ std::cerr << "ImageToggler::ImageToggler(): " << e.what() << std::endl;
+ }
property_pixbuf() = _property_pixbuf_off.get_value();
}