diff options
| author | Martin Owens <doctormo@gmail.com> | 2017-06-29 14:39:55 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2017-06-29 14:39:55 +0000 |
| commit | 5f15e100da0ce70052d1953f53f57d183a0bc9ce (patch) | |
| tree | 75ae1e3517e9283322e6bade3ff4491f9ae06842 /src | |
| parent | Hackfest icon work: restore selected menu icons and make theming easier (diff) | |
| download | inkscape-5f15e100da0ce70052d1953f53f57d183a0bc9ce.tar.gz inkscape-5f15e100da0ce70052d1953f53f57d183a0bc9ce.zip | |
Add caching to io resources path construction
Diffstat (limited to 'src')
| -rw-r--r-- | src/io/resource.cpp | 6 | ||||
| -rw-r--r-- | src/io/resource.h | 3 |
2 files changed, 8 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; diff --git a/src/io/resource.h b/src/io/resource.h index 8b60775b5..0ea5ab4f0 100644 --- a/src/io/resource.h +++ b/src/io/resource.h @@ -17,6 +17,7 @@ #ifndef SEEN_INKSCAPE_IO_RESOURCE_H #define SEEN_INKSCAPE_IO_RESOURCE_H +#include <glibmm/ustring.h> #include "util/share.h" namespace Inkscape { @@ -35,6 +36,7 @@ enum Type { ICONS, KEYS, MARKERS, + NONE, PALETTES, PATTERNS, SCREENS, @@ -49,6 +51,7 @@ enum Type { enum Domain { SYSTEM, CREATE, + CACHE, USER }; |
