diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-11-21 12:09:32 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-11-21 12:09:32 +0000 |
| commit | 960ef58386892cc146b1201fffe54bc9399726b1 (patch) | |
| tree | 6dc7ff5637752b9631aaa757fce1184ace749751 /src/ui/widget/dock-item.cpp | |
| parent | Minor documentation update (diff) | |
| download | inkscape-960ef58386892cc146b1201fffe54bc9399726b1.tar.gz inkscape-960ef58386892cc146b1201fffe54bc9399726b1.zip | |
Fix crash when floating dialog icon is not found
Fixed bugs:
- https://launchpad.net/bugs/658055
(bzr r9909)
Diffstat (limited to 'src/ui/widget/dock-item.cpp')
| -rw-r--r-- | src/ui/widget/dock-item.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index 026eac8e0..7b24c00cd 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -44,11 +44,17 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l if (!icon_name.empty()) { int width = 0, height = 0; Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height); - _icon_pixbuf = Gtk::IconTheme::get_default()->load_icon(icon_name, width, (Gtk::IconLookupFlags) 0); - _gdl_dock_item = - gdl_dock_item_new_with_pixbuf_icon(name.c_str(), long_name.c_str(), - _icon_pixbuf->gobj(), gdl_dock_behavior); - } else { + try { + _icon_pixbuf = Gtk::IconTheme::get_default()->load_icon(icon_name, width, (Gtk::IconLookupFlags) 0); + _gdl_dock_item = + gdl_dock_item_new_with_pixbuf_icon(name.c_str(), long_name.c_str(), + _icon_pixbuf->gobj(), gdl_dock_behavior); + } catch (Gtk::IconThemeError) { + // ignore - create the dock item without an icon below + } + } + + if (!_gdl_dock_item) { _gdl_dock_item = gdl_dock_item_new(name.c_str(), long_name.c_str(), gdl_dock_behavior); } |
