summaryrefslogtreecommitdiffstats
path: root/src/io/resource.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2017-06-29 14:39:55 +0000
committerMartin Owens <doctormo@gmail.com>2017-06-29 14:39:55 +0000
commit5f15e100da0ce70052d1953f53f57d183a0bc9ce (patch)
tree75ae1e3517e9283322e6bade3ff4491f9ae06842 /src/io/resource.cpp
parentHackfest icon work: restore selected menu icons and make theming easier (diff)
downloadinkscape-5f15e100da0ce70052d1953f53f57d183a0bc9ce.tar.gz
inkscape-5f15e100da0ce70052d1953f53f57d183a0bc9ce.zip
Add caching to io resources path construction
Diffstat (limited to 'src/io/resource.cpp')
-rw-r--r--src/io/resource.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/io/resource.cpp b/src/io/resource.cpp
index ffe612e43..73dc7117e 100644
--- a/src/io/resource.cpp
+++ b/src/io/resource.cpp
@@ -20,7 +20,6 @@
#include "config.h"
#endif
-#include <glib.h> // g_assert()
#include "path-prefix.h"
#include "io/sys.h"
#include "io/resource.h"
@@ -49,6 +48,7 @@ gchar *_get_path(Domain domain, Type type, char const *filename)
case ICONS: temp = INKSCAPE_PIXMAPDIR; break;
case KEYS: temp = INKSCAPE_KEYSDIR; break;
case MARKERS: temp = INKSCAPE_MARKERSDIR; break;
+ case NONE: g_assert_not_reached(); break;
case PALETTES: temp = INKSCAPE_PALETTESDIR; break;
case PATTERNS: temp = INKSCAPE_PATTERNSDIR; break;
case SCREENS: temp = INKSCAPE_SCREENSDIR; break;
@@ -71,6 +71,9 @@ gchar *_get_path(Domain domain, Type type, char const *filename)
}
path = g_strdup(temp);
} break;
+ case CACHE: {
+ path = g_build_filename(g_get_user_cache_dir(), "inkscape", NULL);
+ } break;
case USER: {
char const *name=NULL;
switch (type) {
@@ -80,6 +83,7 @@ gchar *_get_path(Domain domain, Type type, char const *filename)
case ICONS: name = "icons"; break;
case KEYS: name = "keys"; break;
case MARKERS: name = "markers"; break;
+ case NONE: name = ""; break;
case PALETTES: name = "palettes"; break;
case PATTERNS: name = "patterns"; break;
case SYMBOLS: name = "symbols"; break;