diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index f1e2c1684c47554eb38a29d1f53efdb8adc1463f..fc9aff78e2bb9e9fed0eb853d81878a8f385127e 100644 (file)
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
gchar * location = homedir_path(c);
Inkscape::IO::dump_fopen_call(location, "E");
file = Inkscape::IO::fopen_utf8name(location, "w");
gchar * location = homedir_path(c);
Inkscape::IO::dump_fopen_call(location, "E");
file = Inkscape::IO::fopen_utf8name(location, "w");
+ g_snprintf (c, 1024, "%s", location); // we want the complete path to be stored in c (for reporting purposes)
g_free(location);
if (!file) {
// try saving to /tmp
g_free(location);
if (!file) {
// try saving to /tmp
}
if (!file) {
// try saving to the current directory
}
if (!file) {
// try saving to the current directory
+ gchar *curdir = g_get_current_dir();
g_snprintf (c, 1024, "inkscape-%.256s.%s.%d.svg", docname, sptstr, count);
Inkscape::IO::dump_fopen_call(c, "F");
file = Inkscape::IO::fopen_utf8name(c, "w");
g_snprintf (c, 1024, "inkscape-%.256s.%s.%d.svg", docname, sptstr, count);
Inkscape::IO::dump_fopen_call(c, "F");
file = Inkscape::IO::fopen_utf8name(c, "w");
+ // store the complete path in c so that it can be reported later
+ gchar * location = g_build_filename(curdir, c, NULL);
+ g_snprintf (c, 1024, "%s", location);
+ g_free(location);
}
if (file) {
sp_repr_save_stream (repr->document(), file, SP_SVG_NS_URI);
}
if (file) {
sp_repr_save_stream (repr->document(), file, SP_SVG_NS_URI);
}
}
}
}
- inkscape_load_menus(inkscape);
- sp_input_load_from_preferences();
+ if (use_gui) {
+ inkscape_load_menus(inkscape);
+ sp_input_load_from_preferences();
+ }
/* set language for user interface according setting in preferences */
Glib::ustring ui_language = prefs->getString("/ui/language");
/* set language for user interface according setting in preferences */
Glib::ustring ui_language = prefs->getString("/ui/language");
profile_path(const char *filename)
{
static const gchar *prefdir = NULL;
profile_path(const char *filename)
{
static const gchar *prefdir = NULL;
+
+
if (!prefdir) {
if (!prefdir) {
+ // First check for a custom environment variable for a "portable app"
+ gchar const *val = g_getenv("INKSCAPE_PORTABLE_PROFILE_DIR");
+ if (val) {
+ prefdir = g_strdup(val);
+ }
+
#ifdef HAS_SHGetSpecialFolderLocation
// prefer c:\Documents and Settings\UserName\Application Data\ to
// c:\Documents and Settings\userName\;
#ifdef HAS_SHGetSpecialFolderLocation
// prefer c:\Documents and Settings\UserName\Application Data\ to
// c:\Documents and Settings\userName\;