summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-07-26 14:51:10 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-07-26 14:51:10 +0000
commitf2a0226cb35bb6e9682c661daccff1826f86d13a (patch)
treefa41512daf0b947246b89d8f4ba09dbabd01b34c /src
parentFix symbolic icon color width (diff)
downloadinkscape-f2a0226cb35bb6e9682c661daccff1826f86d13a.tar.gz
inkscape-f2a0226cb35bb6e9682c661daccff1826f86d13a.zip
Fixing paths to allow themes and icons inside main inkscape instalation not only at home
Diffstat (limited to 'src')
-rw-r--r--src/helper/icon-loader.cpp4
-rw-r--r--src/inkscape.cpp4
-rw-r--r--src/io/resource.cpp8
-rw-r--r--src/io/resource.h4
-rw-r--r--src/main.cpp22
-rw-r--r--src/path-prefix.h20
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp7
-rw-r--r--src/ui/dialog/ocaldialogs.cpp2
8 files changed, 46 insertions, 25 deletions
diff --git a/src/helper/icon-loader.cpp b/src/helper/icon-loader.cpp
index e514343a3..362661e84 100644
--- a/src/helper/icon-loader.cpp
+++ b/src/helper/icon-loader.cpp
@@ -34,10 +34,6 @@ Glib::RefPtr<Gdk::Pixbuf> sp_get_icon_pixbuf(Glib::ustring icon_name, gint size)
iconTheme->set_custom_theme(prefs->getString("/theme/iconTheme"));
iconTheme->append_search_path(get_path_ustring(SYSTEM, ICONS));
iconTheme->append_search_path(get_path_ustring(USER, ICONS));
-#ifdef INKSCAPE_THEMEDIR
- iconTheme->append_search_path(get_path_ustring(SYSTEM, THEMES));
- iconTheme->append_search_path(get_path_ustring(USER, THEMES));
-#endif
Glib::RefPtr<Gdk::Pixbuf> _icon_pixbuf;
try {
if (prefs->getBool("/theme/symbolicIcons", false)) {
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 9be033494..0887bc2ef 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -377,10 +377,6 @@ Application::add_icon_theme()
// folders didn't seem to make much sense for Linux. More testing needed.
icon_theme->append_search_path(get_path_ustring(SYSTEM, ICONS));
icon_theme->append_search_path(get_path_ustring(USER, ICONS));
-#ifdef INKSCAPE_THEMEDIR
- icon_theme->append_search_path(get_path_ustring(SYSTEM, THEMES));
- icon_theme->append_search_path(get_path_ustring(USER, THEMES));
-#endif
}
/**
diff --git a/src/io/resource.cpp b/src/io/resource.cpp
index 83772dd5d..d90f329d9 100644
--- a/src/io/resource.cpp
+++ b/src/io/resource.cpp
@@ -54,7 +54,7 @@ gchar *_get_path(Domain domain, Type type, char const *filename)
case FILTERS: temp = INKSCAPE_FILTERDIR; break;
case FONTS: temp = INKSCAPE_FONTSDIR; break;
case GRADIENTS: temp = INKSCAPE_GRADIENTSDIR; break;
- case ICONS: temp = INKSCAPE_PIXMAPDIR; break;
+ case ICONS: temp = INKSCAPE_ICONSDIR; break;
case KEYS: temp = INKSCAPE_KEYSDIR; break;
case MARKERS: temp = INKSCAPE_MARKERSDIR; break;
case NONE: g_assert_not_reached(); break;
@@ -66,6 +66,10 @@ gchar *_get_path(Domain domain, Type type, char const *filename)
case THEMES: temp = INKSCAPE_THEMEDIR; break;
case TUTORIALS: temp = INKSCAPE_TUTORIALSDIR; break;
case UIS: temp = INKSCAPE_UIDIR; break;
+ case PIXMAPS: temp = INKSCAPE_PIXMAPSDIR; break;
+#ifdef INKSCAPE_DATADIR
+ case DATADIR: temp = INKSCAPE_DATADIR; break;
+#endif
default: temp = "";
}
path = g_strdup(temp);
@@ -100,6 +104,8 @@ gchar *_get_path(Domain domain, Type type, char const *filename)
case TEMPLATES: name = "templates"; break;
case THEMES: name = "icons"; break;
case UIS: name = "ui"; break;
+ case PIXMAPS: name = "pixmaps"; break;
+ case DATADIR: name = ""; break;
default: return _get_path(SYSTEM, type, filename);
}
path = profile_path(name);
diff --git a/src/io/resource.h b/src/io/resource.h
index d86eda51a..7a11fd8fa 100644
--- a/src/io/resource.h
+++ b/src/io/resource.h
@@ -47,7 +47,9 @@ enum Type {
SYMBOLS,
FILTERS,
THEMES,
- UIS
+ UIS,
+ PIXMAPS,
+ DATADIR
};
enum Domain {
diff --git a/src/main.cpp b/src/main.cpp
index b51d2d455..efa20bfc8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -615,15 +615,27 @@ static void set_extensions_env()
gchar *pythonpath = get_extensions_path();
g_setenv("PYTHONPATH", pythonpath, TRUE);
g_free(pythonpath);
- //printf("PYTHONPATH = %s\n", g_getenv("PYTHONPATH"));
+ // printf("PYTHONPATH = %s\n", g_getenv("PYTHONPATH"));
}
static void set_datadir_env()
{
- gchar *datadir = get_datadir_path();
- g_setenv("XDG_DATA_HOME", datadir, TRUE);
- g_free(datadir);
- // printf("XDG_DATA_HOME = %s\n", g_getenv("XDG_DATA_HOME"));
+ gchar const *xgd = g_getenv("XDG_DATA_DIRS");
+ Glib::ustring datadir = "";
+ if (xgd) {
+ datadir += xgd;
+ datadir += ":";
+ }
+ datadir += get_datadir_path();
+ datadir += ":";
+ datadir += INKSCAPE_DATADIR;
+#ifdef WIN32
+ datadir += g_win32_locale_filename_from_utf8("/inkscape");
+#else
+ datadir += "/inkscape";
+#endif
+ g_setenv("XDG_DATA_DIRS", datadir.c_str(), TRUE);
+ // printf("XDG_DATA_DIRS = %s\n", g_getenv("XDG_DATA_DIRS"));
}
/**
diff --git a/src/path-prefix.h b/src/path-prefix.h
index 598a2eff8..a23ffdb48 100644
--- a/src/path-prefix.h
+++ b/src/path-prefix.h
@@ -43,13 +43,14 @@ char *get_extensions_path();
# define INKSCAPE_FONTSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/fonts" )
# define INKSCAPE_GRADIENTSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/gradients" )
# define INKSCAPE_KEYSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/keys" )
-# define INKSCAPE_PIXMAPDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/icons" )
+# define INKSCAPE_ICONSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/icons" )
+# define INKSCAPE_PIXMAPSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/pixmaps" )
# define INKSCAPE_MARKERSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/markers" )
# define INKSCAPE_PALETTESDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/palettes" )
# define INKSCAPE_PATTERNSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/patterns" )
# define INKSCAPE_SCREENSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/screens" )
# define INKSCAPE_SYMBOLSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/symbols" )
-# define INKSCAPE_THEMEDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/icons" )
+# define INKSCAPE_THEMEDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/themes" )
# define INKSCAPE_TUTORIALSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/tutorials" )
# define INKSCAPE_TEMPLATESDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/templates" )
# define INKSCAPE_UIDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/inkscape/ui" )
@@ -69,13 +70,14 @@ char *get_extensions_path();
# define INKSCAPE_FONTSDIR append_inkscape_datadir("fonts")
# define INKSCAPE_GRADIENTSDIR append_inkscape_datadir("gradients")
# define INKSCAPE_KEYSDIR append_inkscape_datadir("keys")
-# define INKSCAPE_PIXMAPDIR append_inkscape_datadir("icons")
+# define INKSCAPE_ICONSDIR append_inkscape_datadir("icons")
+# define INKSCAPE_PIXMAPSDIR append_inkscape_datadir("pixmaps")
# define INKSCAPE_MARKERSDIR append_inkscape_datadir("markers")
# define INKSCAPE_PALETTESDIR append_inkscape_datadir("palettes")
# define INKSCAPE_PATTERNSDIR append_inkscape_datadir("patterns")
# define INKSCAPE_SCREENSDIR append_inkscape_datadir("screens")
# define INKSCAPE_SYMBOLSDIR append_inkscape_datadir("symbols")
-# define INKSCAPE_THEMEDIR append_inkscape_datadir("icons")
+# define INKSCAPE_THEMEDIR append_inkscape_datadir("themes")
# define INKSCAPE_TUTORIALSDIR append_inkscape_datadir("tutorials")
# define INKSCAPE_TEMPLATESDIR append_inkscape_datadir("templates")
# define INKSCAPE_UIDIR append_inkscape_datadir("ui")
@@ -94,13 +96,14 @@ char *get_extensions_path();
# define INKSCAPE_FONTSDIR "Contents/Resources/share/inkscape/fonts"
# define INKSCAPE_GRADIENTSDIR "Contents/Resources/share/inkscape/gradients"
# define INKSCAPE_KEYSDIR "Contents/Resources/share/inkscape/keys"
-# define INKSCAPE_PIXMAPDIR "Contents/Resources/share/inkscape/icons"
+# define INKSCAPE_ICONSDIR "Contents/Resources/share/inkscape/icons"
+# define INKSCAPE_PIXMAPSDIR "Contents/Resources/share/inkscape/pixmaps"
# define INKSCAPE_MARKERSDIR "Contents/Resources/share/inkscape/markers"
# define INKSCAPE_PALETTESDIR "Contents/Resources/share/inkscape/palettes"
# define INKSCAPE_PATTERNSDIR "Contents/Resources/share/inkscape/patterns"
# define INKSCAPE_SCREENSDIR "Contents/Resources/share/inkscape/screens"
# define INKSCAPE_SYMBOLSDIR "Contents/Resources/share/inkscape/symbols"
-# define INKSCAPE_THEMEDIR INKSCAPE_PIXMAPDIR
+# define INKSCAPE_THEMEDIR "Contents/Resources/share/inkscape/themes"
# define INKSCAPE_TUTORIALSDIR "Contents/Resources/share/inkscape/tutorials"
# define INKSCAPE_TEMPLATESDIR "Contents/Resources/share/inkscape/templates"
# define INKSCAPE_UIDIR "Contents/Resources/share/inkscape/ui"
@@ -119,13 +122,14 @@ char *get_extensions_path();
# define INKSCAPE_FONTSDIR append_inkscape_datadir("inkscape/fonts")
# define INKSCAPE_GRADIENTSDIR append_inkscape_datadir("inkscape/gradients")
# define INKSCAPE_KEYSDIR append_inkscape_datadir("inkscape/keys")
-# define INKSCAPE_PIXMAPDIR append_inkscape_datadir("inkscape/icons")
+# define INKSCAPE_ICONSDIR append_inkscape_datadir("inkscape/icons")
+# define INKSCAPE_PIXMAPSDIR append_inkscape_datadir("inkscape/pixmaps")
# define INKSCAPE_MARKERSDIR append_inkscape_datadir("inkscape/markers")
# define INKSCAPE_PALETTESDIR append_inkscape_datadir("inkscape/palettes")
# define INKSCAPE_PATTERNSDIR append_inkscape_datadir("inkscape/patterns")
# define INKSCAPE_SCREENSDIR append_inkscape_datadir("inkscape/screens")
# define INKSCAPE_SYMBOLSDIR append_inkscape_datadir("inkscape/symbols")
-# define INKSCAPE_THEMEDIR append_inkscape_datadir("icons")
+# define INKSCAPE_THEMEDIR append_inkscape_datadir("inkscape/themes")
# define INKSCAPE_TUTORIALSDIR append_inkscape_datadir("inkscape/tutorials")
# define INKSCAPE_TEMPLATESDIR append_inkscape_datadir("inkscape/templates")
# define INKSCAPE_UIDIR append_inkscape_datadir("inkscape/ui")
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 100590eab..2a012ad98 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -782,6 +782,7 @@ void InkscapePreferences::initPageUI()
symbolicThemeCheck();
_page_theme.add_group_header(_("Theme changes"));
{
+ using namespace Inkscape::IO::Resource;
GHashTable *t;
GHashTableIter iter;
gchar *theme, *path;
@@ -799,7 +800,11 @@ void InkscapePreferences::initPageUI()
}
g_strfreev(builtin_themes);
- path = _inkscape_get_theme_dir();
+ path = g_strdup((char const *)Inkscape::IO::Resource::get_path(USER, DATADIR, ""));
+ _inkscape_fill_gtk(path, t);
+ g_free(path);
+
+ path = g_strdup((char const *)Inkscape::IO::Resource::get_path(SYSTEM, DATADIR, ""));
_inkscape_fill_gtk(path, t);
g_free(path);
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp
index ffa535b78..42daddff2 100644
--- a/src/ui/dialog/ocaldialogs.cpp
+++ b/src/ui/dialog/ocaldialogs.cpp
@@ -547,7 +547,7 @@ LogoArea::LogoArea() : Gtk::EventBox()
{
// Try to load the OCAL logo, but if the file is not found, degrade gracefully
try {
- std::string logo_path = Glib::build_filename(INKSCAPE_PIXMAPDIR, "OCAL.png");
+ std::string logo_path = Glib::build_filename(INKSCAPE_PIXMAPSDIR, "OCAL.png");
logo_mask = Cairo::ImageSurface::create_from_png(logo_path);
draw_logo = true;
} catch(Cairo::logic_error) {