diff dwtx/jface/preference/DirectoryFieldEditor.d @ 97:0168c579a3f9

Fix path handling, thanks yidabu for reporting.
author Frank Benoit <benoit@tionex.de>
date Fri, 01 Aug 2008 07:06:52 +0200
parents 3ed358ab21c9
children
line wrap: on
line diff
--- a/dwtx/jface/preference/DirectoryFieldEditor.d	Sat Jul 26 14:39:08 2008 +0200
+++ b/dwtx/jface/preference/DirectoryFieldEditor.d	Fri Aug 01 07:06:52 2008 +0200
@@ -22,6 +22,7 @@
 
 import dwt.dwthelper.utils;
 import tango.io.FilePath;
+static import tango.io.Path;
 import tango.io.FileSystem;
 
 /**
@@ -56,7 +57,7 @@
      * Opens the directory chooser dialog and returns the selected directory.
      */
     protected override String changePressed() {
-        auto f = new FilePath(getTextControl().getText());
+        auto f = new FilePath(tango.io.Path.standard(getTextControl().getText()));
         if (!f.exists()) {
             f = cast(FilePath)null;
         }
@@ -78,7 +79,7 @@
         if (fileName.length is 0 && isEmptyStringAllowed()) {
             return true;
         }
-        auto file = new FilePath(fileName);
+        auto file = new FilePath(tango.io.Path.standard(fileName));
         return file.exists() && file.isFolder();
     }
 
@@ -98,7 +99,7 @@
         if (dir !is null) {
             dir = dir.trim();
             if (dir.length > 0) {
-                return new FilePath(dir);
+                return new FilePath(tango.io.Path.standard(dir));
             }
         }