diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-05-17 18:56:04 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2013-05-17 18:56:04 +0200 |
| commit | c2e2187662835c49173b932e9752d9847f431f3d (patch) | |
| tree | 78c594a3b5e964484f7bd787025ae95f94b759ea /dash | |
| parent | 8155ba1dc7d5a2005acd137a0067dd51d2dbff3c (diff) | |
ResultRenderer: use glib::Error for error handling
(bzr r3310.4.5)
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/ResultRenderer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/dash/ResultRenderer.cpp b/dash/ResultRenderer.cpp index b8166bac6..7b92ff45c 100644 --- a/dash/ResultRenderer.cpp +++ b/dash/ResultRenderer.cpp @@ -41,7 +41,7 @@ GdkPixbuf* _icon_hint_get_drag_pixbuf(std::string icon_hint, int size) GdkPixbuf *pbuf; GtkIconTheme *theme; gtk::IconInfo info; - GError *error = NULL; + glib::Error error; glib::Object<GIcon> icon; if (icon_hint.empty()) @@ -51,10 +51,9 @@ GdkPixbuf* _icon_hint_get_drag_pixbuf(std::string icon_hint, int size) { pbuf = gdk_pixbuf_new_from_file_at_scale (icon_hint.c_str(), size, size, TRUE, &error); - if (error != NULL || !pbuf || !GDK_IS_PIXBUF (pbuf)) + if (error || !pbuf || !GDK_IS_PIXBUF (pbuf)) { icon_hint = "application-default-icon"; - g_clear_error (&error); } else return pbuf; @@ -101,10 +100,9 @@ GdkPixbuf* _icon_hint_get_drag_pixbuf(std::string icon_hint, int size) pbuf = gtk_icon_info_load_icon(info, &error); - if (error != NULL) + if (error) { - g_error_free (error); - pbuf = NULL; + pbuf = nullptr; } return pbuf; |
