Code

Unify stat type for older glib.
[inkscape.git] / src / widgets / icon.cpp
index 3e0746edf99f2f3bd73e5724d65a26006e53177b..526309727ddfc14e51483000a93885f8dd9f2c56 100644 (file)
 
 #include "icon.h"
 
+// Bring in work-around for Glib versions missing GStatBuf
+#if !GLIB_CHECK_VERSION(2,25,0)
+#if defined (_MSC_VER) && !defined(_WIN64)
+typedef struct _stat32 GStatBuf;
+#else //defined (_MSC_VER) && !defined(_WIN64)
+typedef struct stat GStatBuf;
+#endif //defined (_MSC_VER) && !defined(_WIN64)
+#endif //!GLIB_CHECK_VERSION(2,25,0)
 
 struct IconImpl {
     static void classInit(SPIconClass *klass);
@@ -1330,7 +1338,7 @@ bool IconImpl::prerenderIcon(gchar const *name, GtkIconSize lsize, unsigned psiz
 {
     bool loadNeeded = false;
     static bool dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpGtk");
-    static bool useCache = Inkscape::Preferences::get()->getBool("/debug/icons/useCache");
+    static bool useCache = Inkscape::Preferences::get()->getBool("/debug/icons/useCache", true);
     static bool cacheValidated = false;
     if (!cacheValidated) {
         cacheValidated = true;