summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6cc599b)
raw | patch | inline | side by side (parent: 6cc599b)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 2 Feb 2009 15:49:47 +0000 (15:49 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 2 Feb 2009 15:49:47 +0000 (15:49 +0000) |
src/selection-chemistry.cpp | patch | blob | history |
index 9081bbdb2fceabeb9f803f950fd882fa8c06b443..badf27ecb45caa4d93541f5e806a371f43b66fd9 100644 (file)
#include "libnr/nr-convert2geom.h"
#include "display/curve.h"
#include "display/canvas-bpath.h"
+#include "inkscape-private.h"
// For clippath editing
#include "tools-switch.h"
// Imagemagick is known not to handle spaces in filenames, so we replace anything but letters,
// digits, and a few other chars, with "_"
filename = g_strcanon (filename, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.=+~$#@^&!?", '_');
- // Build the complete path by adding document->base if set
- gchar *filepath = g_build_filename (document->base?document->base:"", filename, NULL);
+
+ // Build the complete path by adding document base dir, if set, otherwise home dir
+ gchar * directory = NULL;
+ if (SP_DOCUMENT_URI(document)) {
+ directory = g_dirname(SP_DOCUMENT_URI(document));
+ }
+ if (directory == NULL) {
+ directory = homedir_path(NULL);
+ }
+ gchar *filepath = g_build_filename (directory, filename, NULL);
//g_print ("%s\n", filepath);