summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-06-14 19:28:32 +0200
committerLennart Poettering <lennart@poettering.net>2009-06-14 19:28:32 +0200
commit874ebedf163195c7d54d5f9da3ff1725c1e43aa2 (patch)
tree0f7ad800386d93f532027ca65d1dd07ae375f548 /src
parent4663ea6a9887432c776f006b3916564803140682 (diff)
don't abort when icon is missing from the theme
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 9d2a33d..61156c4 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -111,12 +111,17 @@ static void set_icon_name_fallback(Gtk::Image *i, const char *name, Gtk::IconSiz
Gtk::IconSize::lookup(size, width, height);
theme = Gtk::IconTheme::get_default();
- pixbuf = theme->load_icon(name, width, Gtk::ICON_LOOKUP_GENERIC_FALLBACK);
- if (pixbuf)
- i->set(pixbuf);
- else
+ try {
+ pixbuf = theme->load_icon(name, width, Gtk::ICON_LOOKUP_GENERIC_FALLBACK);
+
+ if (pixbuf)
+ i->set(pixbuf);
+ else
+ i->set(name);
+ } catch (Gtk::IconThemeError &e) {
i->set(name);
+ }
}
void MainWindow::updateCard(const pa_card_info &info) {