Fixes to run the new Explorer on Windows
authorJerome St-Louis <jerome@ecere.com>
Wed, 14 Sep 2011 20:14:59 +0000 (16:14 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 14 Sep 2011 20:14:59 +0000 (16:14 -0400)
libede/src/FileSystemBox.ec
newexplorer/src/Explorer.ec
newexplorer/src/ExplorerWindow.ec

index 61f5df9..9527e28 100644 (file)
@@ -425,7 +425,7 @@ static FileSystemNode MakeFileSystemNode(const FileStats stats,
    
    FileSystemNode node { stats = stats };
 
    
    FileSystemNode node { stats = stats };
 
-   //if(stats.attribs.isFile) // TODO fix this in ecere
+   //if(stats.attribs.isFile) // -- should work now
    if(stats.attribs.isDirectory)
    {
       extension[0] = '\0';
    if(stats.attribs.isDirectory)
    {
       extension[0] = '\0';
@@ -861,7 +861,7 @@ private:
       {
          if((!bits.foldersOnly && !bits.filesOnly) ||
             (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
       {
          if((!bits.foldersOnly && !bits.filesOnly) ||
             (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
-            (bits.filesOnly && !listing.stats.attribs.isDirectory/*listing.stats.attribs.isFile*/)) // TOCHECK: isFile broken?
+            (bits.filesOnly && listing.stats.attribs.isFile))
          {
             FileSystemNode node = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
             DataRow row = list.AddRow();
          {
             FileSystemNode node = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
             DataRow row = list.AddRow();
@@ -896,14 +896,14 @@ private:
       root = MakeFileSystemNode(FileStats { attribs = FileExists(path)}, path, path, bits.previewPictures, displaySystem);
    #ifdef __WIN32__
       //root.name = rootName;
       root = MakeFileSystemNode(FileStats { attribs = FileExists(path)}, path, path, bits.previewPictures, displaySystem);
    #ifdef __WIN32__
       //root.name = rootName;
-      AddTreeNode(root, true, false, null, list);
+      AddTreeNode(root, true, false, null);//, list);
    #else
       //root.name = "/";
    #endif
       AddTreeNode(root, false, true, null);
 
    // How can this make sense for linux? 
    #else
       //root.name = "/";
    #endif
       AddTreeNode(root, false, true, null);
 
    // How can this make sense for linux? 
-   #ifdef __WIN32__
+   /*#ifdef __WIN32__
       while(listing.Find())
       {
          int len = strlen(listing.name);
       while(listing.Find())
       {
          int len = strlen(listing.name);
@@ -937,7 +937,7 @@ private:
       node.row.collapsed = true;
       Sort(nameField, 1);
       SelectRow(root.row);
       node.row.collapsed = true;
       Sort(nameField, 1);
       SelectRow(root.row);
-   #endif
+   #endif*/
       LoadTreeNode(root);
       list.Sort(nameField, 1);
    }
       LoadTreeNode(root);
       list.Sort(nameField, 1);
    }
@@ -951,13 +951,13 @@ private:
          {
             FileListing listing { path, extensions = extensions };
             if(node.children.count == 1)
          {
             FileListing listing { path, extensions = extensions };
             if(node.children.count == 1)
-            DeleteNode(node.children.first);
+               DeleteNode(node.children.first);
 
             while(listing.Find())
             {
 
             while(listing.Find())
             {
-               if((!bits.foldersOnly && !bits.filesOnly) ||
+               if(!listing.stats.attribs.isRemovable && ((!bits.foldersOnly && !bits.filesOnly) ||
                   (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
                   (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
-                  (bits.filesOnly && !listing.stats.attribs.isDirectory/*listing.stats.attribs.isFile*/)) // TOCHECK: isFile broken?
+                  (bits.filesOnly && listing.stats.attribs.isFile)))
                {
                   FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
                   AddTreeNode(child, true, false, node);
                {
                   FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
                   AddTreeNode(child, true, false, node);
@@ -998,7 +998,7 @@ private:
          {
             if((!bits.foldersOnly && !bits.filesOnly) ||
                (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
          {
             if((!bits.foldersOnly && !bits.filesOnly) ||
                (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
-               (bits.filesOnly && !listing.stats.attribs.isDirectory/*listing.stats.attribs.isFile*/)) // TOCHECK: isFile broken?
+               (bits.filesOnly && listing.stats.attribs.isFile))
             {
                FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
                AddTreeNode(child, true, false, parent);
             {
                FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
                AddTreeNode(child, true, false, parent);
index cb9fa3d..455ef9d 100644 (file)
@@ -9,7 +9,9 @@ class Explorer : GuiApplication
       QuickPathTool goPath { };
       QuickPathTool searchPath { };
       char * findWhat = null;
       QuickPathTool goPath { };
       QuickPathTool searchPath { };
       char * findWhat = null;
+
       SetLoggingMode(debug, null);
       SetLoggingMode(debug, null);
+
       if(argc > 1)
       {
          if(!strcmpi(argv[1], "go") && argc > 2)
       if(argc > 1)
       {
          if(!strcmpi(argv[1], "go") && argc > 2)
index a1b1aa6..98b1971 100644 (file)
@@ -98,6 +98,11 @@ class ExplorerWindow : Window
                char * path = view.path;
                char * newPath = new char[strlen(path)];
                StripLastDirectory(path, newPath);
                char * path = view.path;
                char * newPath = new char[strlen(path)];
                StripLastDirectory(path, newPath);
+               if(!newPath[0])
+               {
+                  newPath[0] = '/';
+                  newPath[1] = 0;
+               }
                view.path = newPath;
                delete newPath;
                break;
                view.path = newPath;
                delete newPath;
                break;