summaryrefslogtreecommitdiffstats
path: root/src/dialogs/filedialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/filedialog.cpp')
-rw-r--r--src/dialogs/filedialog.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dialogs/filedialog.cpp b/src/dialogs/filedialog.cpp
index fb6e599a8..6bc56357d 100644
--- a/src/dialogs/filedialog.cpp
+++ b/src/dialogs/filedialog.cpp
@@ -25,6 +25,7 @@
#include <gtk/gtkentry.h>
#include <gtk/gtkexpander.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <glibmm/i18n.h>
#include <gtkmm/box.h>
@@ -1335,14 +1336,16 @@ FileSaveDialogImpl::~FileSaveDialogImpl()
-
/**
* Show this dialog modally. Return true if user hits [OK]
*/
bool
FileSaveDialogImpl::show()
{
- set_current_folder(get_current_folder()); //hack to force initial dir listing
+ Glib::ustring s = Glib::filename_to_utf8 (get_current_folder());
+ if (s.length() == 0)
+ s = getcwd (NULL, 0);
+ set_current_folder(Glib::filename_from_utf8(s)); //hack to force initial dir listing
set_modal (TRUE); //Window
sp_transientize((GtkWidget *)gobj()); //Make transient
gint b = run(); //Dialog