diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2017-07-06 10:43:23 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2017-07-06 10:43:23 +0000 |
| commit | 05f2e3cabd68bf13c68ecd39946e058b01420d8a (patch) | |
| tree | 906b16bef378f13f209a24822105f41bb54e15ff /src | |
| parent | Don't check if icon exists in default theme since that prevents use of fallba... (diff) | |
| download | inkscape-05f2e3cabd68bf13c68ecd39946e058b01420d8a.tar.gz inkscape-05f2e3cabd68bf13c68ecd39946e058b01420d8a.zip | |
Remove more checks if icon exists in default theme.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/widget/clipmaskicon.cpp | 13 | ||||
| -rw-r--r-- | src/ui/widget/dock-item.cpp | 10 | ||||
| -rw-r--r-- | src/ui/widget/insertordericon.cpp | 9 | ||||
| -rw-r--r-- | src/ui/widget/layertypeicon.cpp | 14 |
4 files changed, 13 insertions, 33 deletions
diff --git a/src/ui/widget/clipmaskicon.cpp b/src/ui/widget/clipmaskicon.cpp index c284c035c..eceff13ca 100644 --- a/src/ui/widget/clipmaskicon.cpp +++ b/src/ui/widget/clipmaskicon.cpp @@ -42,16 +42,9 @@ ClipMaskIcon::ClipMaskIcon() : phys = width; Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); - - if (icon_theme->has_icon(_pixClipName)) { - _property_pixbuf_clip = icon_theme->load_icon(_pixClipName, phys, (Gtk::IconLookupFlags)0); - } - if (icon_theme->has_icon(_pixMaskName)) { - _property_pixbuf_mask = icon_theme->load_icon(_pixMaskName, phys, (Gtk::IconLookupFlags)0); - } - if (icon_theme->has_icon(_pixBothName)) { - _property_pixbuf_both = icon_theme->load_icon(_pixBothName, phys, (Gtk::IconLookupFlags)0); - } + _property_pixbuf_clip = icon_theme->load_icon(_pixClipName, phys, (Gtk::IconLookupFlags)0); + _property_pixbuf_mask = icon_theme->load_icon(_pixMaskName, phys, (Gtk::IconLookupFlags)0); + _property_pixbuf_both = icon_theme->load_icon(_pixBothName, phys, (Gtk::IconLookupFlags)0); property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(0); } diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index 60ea03fb7..18ab70eb4 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -42,12 +42,10 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l if (!icon_name.empty()) { Glib::RefPtr<Gtk::IconTheme> iconTheme = Gtk::IconTheme::get_default(); - if ( iconTheme->has_icon(icon_name) ) { - int width = 0; - int height = 0; - Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height); - _icon_pixbuf = iconTheme->load_icon(icon_name, width); - } + int width = 0; + int height = 0; + Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height); + _icon_pixbuf = iconTheme->load_icon(icon_name, width); } if ( _icon_pixbuf ) { diff --git a/src/ui/widget/insertordericon.cpp b/src/ui/widget/insertordericon.cpp index 26913ff98..5d1f64a54 100644 --- a/src/ui/widget/insertordericon.cpp +++ b/src/ui/widget/insertordericon.cpp @@ -36,13 +36,8 @@ InsertOrderIcon::InsertOrderIcon() : phys=width; Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); - - if (icon_theme->has_icon(_pixTopName)) { - _property_pixbuf_top = icon_theme->load_icon(_pixTopName, phys, (Gtk::IconLookupFlags)0); - } - if (icon_theme->has_icon(_pixBottomName)) { - _property_pixbuf_bottom = icon_theme->load_icon(_pixBottomName, phys, (Gtk::IconLookupFlags)0); - } + _property_pixbuf_top = icon_theme->load_icon(_pixTopName, phys, (Gtk::IconLookupFlags)0); + _property_pixbuf_bottom = icon_theme->load_icon(_pixBottomName, phys, (Gtk::IconLookupFlags)0); property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(0); } diff --git a/src/ui/widget/layertypeicon.cpp b/src/ui/widget/layertypeicon.cpp index 679a95cd2..3a8ffab44 100644 --- a/src/ui/widget/layertypeicon.cpp +++ b/src/ui/widget/layertypeicon.cpp @@ -39,17 +39,11 @@ LayerTypeIcon::LayerTypeIcon() : gint width, height; gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); int phys = width; - Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); - if (icon_theme->has_icon(_pixLayerName)) { - _property_pixbuf_layer = icon_theme->load_icon(_pixLayerName, phys, (Gtk::IconLookupFlags)0); - } - if (icon_theme->has_icon(_pixGroupName)) { - _property_pixbuf_group = icon_theme->load_icon(_pixGroupName, phys, (Gtk::IconLookupFlags)0); - } - if (icon_theme->has_icon(_pixPathName)) { - _property_pixbuf_path = icon_theme->load_icon(_pixPathName, phys, (Gtk::IconLookupFlags)0); - } + Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); + _property_pixbuf_layer = icon_theme->load_icon(_pixLayerName, phys, (Gtk::IconLookupFlags)0); + _property_pixbuf_group = icon_theme->load_icon(_pixGroupName, phys, (Gtk::IconLookupFlags)0); + _property_pixbuf_path = icon_theme->load_icon(_pixPathName, phys, (Gtk::IconLookupFlags)0); property_pixbuf() = _property_pixbuf_path.get_value(); } |
