diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-03-30 18:57:35 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-03-30 20:30:51 +0000 |
| commit | 09b38582c874646b49d10a8f11850c10b9c6ad39 (patch) | |
| tree | 6d79e6334315cbf1b5453bef2b111c3587e86647 /src/inkscape-main.cpp | |
| parent | Remove unused "get_datadir_path()" (diff) | |
| download | inkscape-09b38582c874646b49d10a8f11850c10b9c6ad39.tar.gz inkscape-09b38582c874646b49d10a8f11850c10b9c6ad39.zip | |
Remove "get_extensions_path()"
Contrary to what the name and placing suggest it's not a general
utility function but a specialized function that constructs the full
value to set for PYTHONPATH.
Despite the misleading placement most functionality is unneeded:
* INKSCAPE_EXTENSIONDIR should always be absolute
* g_setenv recommends UTF-8 on Windows
Diffstat (limited to 'src/inkscape-main.cpp')
| -rw-r--r-- | src/inkscape-main.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/inkscape-main.cpp b/src/inkscape-main.cpp index e25c6b71c..aab94542e 100644 --- a/src/inkscape-main.cpp +++ b/src/inkscape-main.cpp @@ -30,9 +30,15 @@ static void set_extensions_env() g_free(program_dir); // add share/inkscape/extensions to PYTHONPATH so the inkex module is found by extensions in user folder - gchar *pythonpath = get_extensions_path(); - g_setenv("PYTHONPATH", pythonpath, true); - g_free(pythonpath); + gchar const *pythonpath = g_getenv("PYTHONPATH"); + gchar *new_pythonpath; + if (pythonpath) { + new_pythonpath = g_strdup_printf("%s" G_SEARCHPATH_SEPARATOR_S "%s", INKSCAPE_EXTENSIONDIR, pythonpath); + } else { + new_pythonpath = g_strdup(INKSCAPE_EXTENSIONDIR); + } + g_setenv("PYTHONPATH", new_pythonpath, true); + g_free(new_pythonpath); #ifdef _WIN32 // add inkscape directory to DLL search path so dynamically linked extension modules find their libraries |
