changeset 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 b492ba44e44d
children cdf77a0793c2
files dwtx/core/runtime/Path.d dwtx/jface/preference/DirectoryFieldEditor.d dwtx/jface/preference/FileFieldEditor.d dwtx/jface/preference/PathEditor.d
diffstat 4 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dwtx/core/runtime/Path.d	Sat Jul 26 14:39:08 2008 +0200
+++ b/dwtx/core/runtime/Path.d	Fri Aug 01 07:06:52 2008 +0200
@@ -13,6 +13,7 @@
 module dwtx.core.runtime.Path;
 
 import tango.io.FilePath;
+static import tango.io.Path;
 import dwtx.core.runtime.IPath;
 import dwtx.core.runtime.Assert;
 
@@ -885,7 +886,7 @@
      * @see IPath#toFile()
      */
     public FilePath toFile() {
-        return new FilePath(toOSString());
+        return new FilePath(tango.io.Path.standard(toOSString()));
     }
 
     /* (Intentionally not included in javadoc)
--- 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));
             }
         }
 
--- a/dwtx/jface/preference/FileFieldEditor.d	Sat Jul 26 14:39:08 2008 +0200
+++ b/dwtx/jface/preference/FileFieldEditor.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;
 
 /**
@@ -102,7 +103,7 @@
      * Opens the file chooser dialog and returns the selected file.
      */
     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;
         }
@@ -133,7 +134,7 @@
                 msg = getErrorMessage();
             }
         } else {
-            auto file = new FilePath(path);
+            auto file = new FilePath(tango.io.Path.standard(path));
             if (/+file.isFile()+/ file.exists && !file.isFolder ) {
                 if (enforceAbsolute && !file.isAbsolute()) {
                     msg = JFaceResources
@@ -173,7 +174,7 @@
         if (file !is null) {
             file = file.trim();
             if (file.length > 0) {
-                return new FilePath(file);
+                return new FilePath(tango.io.Path.standard(file));
             }
         }
 
--- a/dwtx/jface/preference/PathEditor.d	Sat Jul 26 14:39:08 2008 +0200
+++ b/dwtx/jface/preference/PathEditor.d	Fri Aug 01 07:06:52 2008 +0200
@@ -15,6 +15,7 @@
 import dwtx.jface.preference.ListEditor;
 
 import tango.io.FilePath;
+static import tango.io.Path;
 import tango.io.model.IFile;
 
 // import java.util.ArrayList;
@@ -89,7 +90,7 @@
             dialog.setMessage(dirChooserLabelText);
         }
         if (lastPath !is null) {
-            if ((new FilePath(lastPath)).exists()) {
+            if ((new FilePath(tango.io.Path.standard(lastPath))).exists()) {
                 dialog.setFilterPath(lastPath);
             }
         }