diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-04-06 16:10:31 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-04-06 16:10:31 +0000 |
| commit | 165d9b0f3bf7ddcf0e565184e3a2b9179f357262 (patch) | |
| tree | 1588021146fdfae506d2ec07781ea99f073229ab /src/file.cpp | |
| parent | * Update of Khmer translation by Sokhem (diff) | |
| download | inkscape-165d9b0f3bf7ddcf0e565184e3a2b9179f357262.tar.gz inkscape-165d9b0f3bf7ddcf0e565184e3a2b9179f357262.zip | |
some people reported crashes when adding nonexisting dirs to dialog - though it did not crash for me
(bzr r2825)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/file.cpp b/src/file.cpp index 0a81069d9..69d6da610 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -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); + } } @@ -623,7 +625,9 @@ sp_file_save_dialog(SPDocument *doc, bool is_copy) // allow easy access to the user's own templates folder gchar *templates = profile_path ("templates"); - dynamic_cast<Gtk::FileChooser *>(saveDialog)->add_shortcut_folder(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(); |
