From 5e8fef98ec54077f291094cd05966298e62af259 Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Sat, 11 Nov 2017 11:32:19 +0000 Subject: [PATCH] Fixed compilation with gtkmm < 3.10 and gcc 4.7. --- gsmartcontrol/configure.ac | 4 ++-- gsmartcontrol/src/gsc_main_window_iconview.h | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gsmartcontrol/configure.ac b/gsmartcontrol/configure.ac index e9937a5..072ab03 100644 --- a/gsmartcontrol/configure.ac +++ b/gsmartcontrol/configure.ac @@ -65,8 +65,8 @@ APP_DETECT_OS_KERNEL([build], [CONFIG_HOST_KERNEL_]) APP_COMPILER_OPTIONS([]) # Enable C++11 support. This is implied by gtkmm3, but CentOS7 fails to add it -# to gtkmm flags, so we have to enable it manually. -AX_CXX_COMPILE_STDCXX([11]) +# to gtkmm flags, so we have to enable it manually. Make it optional for Debian 7 (gcc 4.7). +AX_CXX_COMPILE_STDCXX([11], [], [optional]) # Thread support for known configurations. # Sun compiler (at least on linux) has some runtime issues with stringstream diff --git a/gsmartcontrol/src/gsc_main_window_iconview.h b/gsmartcontrol/src/gsc_main_window_iconview.h index 4226a84..ecd472e 100644 --- a/gsmartcontrol/src/gsc_main_window_iconview.h +++ b/gsmartcontrol/src/gsc_main_window_iconview.h @@ -91,14 +91,15 @@ class GscMainWindowIconView : public Gtk::IconView { const int icon_size = 64; // Try XDG version first +#if APP_GTKMM_CHECK_VERSION(3, 10, 0) try { hd_icon = default_icon_theme->load_icon("drive-harddisk", icon_size, get_scale_factor(), Gtk::IconLookupFlags(0)); } catch (...) { } // ignore exceptions - +#endif if (!hd_icon) { // Before gtk 3.10 it was called gtk-harddisk. try { - hd_icon = default_icon_theme->load_icon("gtk-harddisk", icon_size, get_scale_factor(), Gtk::IconLookupFlags(0)); + hd_icon = default_icon_theme->load_icon("gtk-harddisk", icon_size, Gtk::IconLookupFlags(0)); } catch (...) { } // ignore exceptions } if (!hd_icon) { @@ -112,14 +113,15 @@ class GscMainWindowIconView : public Gtk::IconView { } // Try XDG version first +#if APP_GTKMM_CHECK_VERSION(3, 10, 0) try { cddvd_icon = default_icon_theme->load_icon("media-optical", icon_size, get_scale_factor(), Gtk::IconLookupFlags(0)); } catch (...) { } // ignore exceptions - +#endif if (!cddvd_icon) { // Before gtk 3.10 it was called gtk-cdrom. try { - cddvd_icon = default_icon_theme->load_icon("gtk-cdrom", icon_size, get_scale_factor(), Gtk::IconLookupFlags(0)); + cddvd_icon = default_icon_theme->load_icon("gtk-cdrom", icon_size, Gtk::IconLookupFlags(0)); } catch (...) { } // ignore exceptions } if (!cddvd_icon) {