Code

Filter effects dialog:
[inkscape.git] / src / file.cpp
index efbada33253b0717ed81bb011f85b58b06ffcdd8..69d6da610383ec34533bebb3554e9cb750a4e546 100644 (file)
@@ -389,7 +389,9 @@ sp_file_open_dialog(gpointer object, gpointer data)
                  Inkscape::UI::Dialog::SVG_TYPES,
                  (char const *)_("Select file to open"));
         // allow easy access to our examples folder             
-        dynamic_cast<Gtk::FileChooser *>(openDialogInstance)->add_shortcut_folder(INKSCAPE_EXAMPLESDIR);
+        if (Inkscape::IO::file_test(INKSCAPE_EXAMPLESDIR, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
+            dynamic_cast<Gtk::FileChooser *>(openDialogInstance)->add_shortcut_folder(INKSCAPE_EXAMPLESDIR);
+        }
     }
 
 
@@ -621,6 +623,13 @@ sp_file_save_dialog(SPDocument *doc, bool is_copy)
     saveDialog->change_title(dialog_title);
     saveDialog->setSelectionType(extension);
 
+    // allow easy access to the user's own templates folder             
+    gchar *templates = profile_path ("templates");
+    if (Inkscape::IO::file_test(templates, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
+        dynamic_cast<Gtk::FileChooser *>(saveDialog)->add_shortcut_folder(templates);
+    }
+    g_free (templates);
+
     bool success = saveDialog->show();
     if (!success) {
         delete saveDialog;