summaryrefslogtreecommitdiffstats
path: root/src/inkscape.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2012-10-08 18:55:32 +0000
committer~suv <suv-sf@users.sourceforge.net>2012-10-08 18:55:32 +0000
commit823318895dfecc05e8376e557543ea9e89c362b2 (patch)
treed8a7b66f0ede52e0bc5415eb103e7e89ea436953 /src/inkscape.cpp
parentchanges_2012_10_04b.patch: fixes one small memory issue (bytes allocated and ... (diff)
parentGerman translation update 93% (diff)
downloadinkscape-823318895dfecc05e8376e557543ea9e89c362b2.tar.gz
inkscape-823318895dfecc05e8376e557543ea9e89c362b2.zip
merge from trunk (r11760)
(bzr r11668.1.25)
Diffstat (limited to 'src/inkscape.cpp')
-rw-r--r--src/inkscape.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index b1cc53b4e..0a94d0742 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -309,8 +309,24 @@ static gint inkscape_autosave(gpointer)
GDir *autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL);
if( !autosave_dir_ptr ){
- g_warning("Cannot open autosave directory!");
- return TRUE;
+ // Try to create the autosave directory if it doesn't exist
+ if (g_mkdir(autosave_dir.c_str(), 0755)) {
+ // the creation failed
+ Glib::ustring msg = Glib::ustring::format(
+ _("Autosave failed! Cannot create directory "), Glib::filename_to_utf8(autosave_dir));
+ g_warning("%s", msg.c_str());
+ SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str());
+ return TRUE;
+ }
+ // Try to read dir again
+ autosave_dir_ptr = g_dir_open(autosave_dir.c_str(), 0, NULL);
+ if( !autosave_dir_ptr ){
+ Glib::ustring msg = Glib::ustring::format(
+ _("Autosave failed! Cannot open directory "), Glib::filename_to_utf8(autosave_dir));
+ g_warning("%s", msg.c_str());
+ SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::ERROR_MESSAGE, msg.c_str());
+ return TRUE;
+ }
}
time_t sptime = time(NULL);