mirror of
https://github.com/ashaduri/gsmartcontrol.git
synced 2026-09-27 14:25:34 +00:00
Fixed a crash when icon theme doesn't contain a specified icon.
This commit is contained in:
@@ -87,10 +87,15 @@ class GscMainWindowIconView : public Gtk::IconView {
|
||||
}
|
||||
|
||||
// Try XDG version first
|
||||
hd_icon = default_icon_theme->load_icon("drive-harddisk", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
try {
|
||||
hd_icon = default_icon_theme->load_icon("drive-harddisk", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
} catch (...) { } // ignore exceptions
|
||||
|
||||
if (!hd_icon) {
|
||||
// Before gtk 3.10 it was called gtk-harddisk.
|
||||
hd_icon = default_icon_theme->load_icon("gtk-harddisk", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
try {
|
||||
hd_icon = default_icon_theme->load_icon("gtk-harddisk", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
} catch (...) { } // ignore exceptions
|
||||
}
|
||||
if (!hd_icon) {
|
||||
// Still no luck, use bundled ones.
|
||||
@@ -103,10 +108,15 @@ class GscMainWindowIconView : public Gtk::IconView {
|
||||
}
|
||||
|
||||
// Try XDG version first
|
||||
cddvd_icon = default_icon_theme->load_icon("media-optical", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
try {
|
||||
cddvd_icon = default_icon_theme->load_icon("media-optical", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
} catch (...) { } // ignore exceptions
|
||||
|
||||
if (!cddvd_icon) {
|
||||
// Before gtk 3.10 it was called gtk-cdrom.
|
||||
cddvd_icon = default_icon_theme->load_icon("gtk-cdrom", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
try {
|
||||
cddvd_icon = default_icon_theme->load_icon("gtk-cdrom", 64, get_scale_factor(), Gtk::IconLookupFlags(0));
|
||||
} catch (...) { } // ignore exceptions
|
||||
}
|
||||
if (!cddvd_icon) {
|
||||
// Still no luck, use bundled ones.
|
||||
|
||||
Reference in New Issue
Block a user