mainwindow: Catch Gdk::PixbufError

Due to another bug the MIME type guessing of PNG files was broken on my
Ubuntu system. This made pavucontrol crash on startup (while loading the
necessary icons) without a helpful error message (requiring a lot of
debugging effort). Although this is not originally pavucontrol's fault,
I think that pavucontrol could be more robust about such a problem,
especially because:

A) In a complex database like the one to guess MIME types (that is populated
from hundres of different packages) this can happen from time to time and
B) pavucontrol already has some fallback options in place - they are just not
active in this specific case.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88813
This commit is contained in:
Martin Steghöfer 2015-02-16 11:29:29 +01:00 committed by David Henningsson
parent f2e32ea305
commit ed140c230c
1 changed files with 2 additions and 0 deletions

View File

@ -253,6 +253,8 @@ static void set_icon_name_fallback(Gtk::Image *i, const char *name, Gtk::IconSiz
i->set(name); i->set(name);
} catch (Gio::Error &e) { } catch (Gio::Error &e) {
i->set(name); i->set(name);
} catch (Gdk::PixbufError &e) {
i->set(name);
} }
} }