summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBilly Biggs <bbiggs>2005-12-15 22:31:21 +0000
committerBilly Biggs <bbiggs>2005-12-15 22:31:21 +0000
commit6c386a85b2fcec15338a76bc07c3d8445c00e60a (patch)
tree700c4725b71030910480e1b5bbbbaa1b559f96d3
parente223da7239a9c69b91d906ba8b0970dc3f423df6 (diff)
downloadeclipse.platform.swt-6c386a85b2fcec15338a76bc07c3d8445c00e60a.tar.gz
eclipse.platform.swt-6c386a85b2fcec15338a76bc07c3d8445c00e60a.tar.xz
eclipse.platform.swt-6c386a85b2fcec15338a76bc07c3d8445c00e60a.zip
118796 - DirectoryDialog.open does not return choosen directory
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
index f2ba3bc167..9e9a6390f3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -168,22 +168,23 @@ String openChooserDialog () {
String answer = null;
int response = OS.gtk_dialog_run (handle);
if (response == OS.GTK_RESPONSE_OK) {
- int /*long*/ folder = OS.gtk_file_chooser_get_current_folder (handle);
- if (folder != 0) {
- int /*long*/ utf8Ptr = OS.g_filename_to_utf8 (folder, -1, null, null, null);
+ int /*long*/ path = OS.gtk_file_chooser_get_filename (handle);
+ if (path != 0) {
+ int /*long*/ utf8Ptr = OS.g_filename_to_utf8 (path, -1, null, null, null);
+ OS.g_free (path);
if (utf8Ptr != 0) {
int /*long*/ [] items_written = new int /*long*/ [1];
int /*long*/ utf16Ptr = OS.g_utf8_to_utf16 (utf8Ptr, -1, null, items_written, null);
+ OS.g_free (utf8Ptr);
if (utf16Ptr != 0) {
int clength = (int)/*64*/items_written [0];
char [] chars = new char [clength];
OS.memmove (chars, utf16Ptr, clength * 2);
- filterPath = answer = new String (chars);
OS.g_free (utf16Ptr);
+ answer = new String (chars);
+ filterPath = answer.substring (answer.lastIndexOf (SEPARATOR) + 1);
}
- OS.g_free (utf8Ptr);
}
- OS.g_free (folder);
}
}
OS.gtk_widget_destroy (handle);