From: Jerome St-Louis Date: Wed, 14 Sep 2011 20:14:59 +0000 (-0400) Subject: Fixes to run the new Explorer on Windows X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=ede;a=commitdiff_plain;h=c3c07aa52ae2c7d74ac9ffcbff9060dfae6404aa;hp=0e4fcdfc4d025c0e6136400d73f4c4b4f0bdb6d1 Fixes to run the new Explorer on Windows --- diff --git a/libede/src/FileSystemBox.ec b/libede/src/FileSystemBox.ec index 61f5df9..9527e28 100644 --- a/libede/src/FileSystemBox.ec +++ b/libede/src/FileSystemBox.ec @@ -425,7 +425,7 @@ static FileSystemNode MakeFileSystemNode(const FileStats 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'; @@ -861,7 +861,7 @@ private: { 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(); @@ -896,14 +896,14 @@ private: 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? - #ifdef __WIN32__ + /*#ifdef __WIN32__ while(listing.Find()) { int len = strlen(listing.name); @@ -937,7 +937,7 @@ private: node.row.collapsed = true; Sort(nameField, 1); SelectRow(root.row); - #endif + #endif*/ LoadTreeNode(root); list.Sort(nameField, 1); } @@ -951,13 +951,13 @@ private: { FileListing listing { path, extensions = extensions }; if(node.children.count == 1) - DeleteNode(node.children.first); + DeleteNode(node.children.first); while(listing.Find()) { - if((!bits.foldersOnly && !bits.filesOnly) || + if(!listing.stats.attribs.isRemovable && ((!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, node); @@ -998,7 +998,7 @@ private: { 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); diff --git a/newexplorer/src/Explorer.ec b/newexplorer/src/Explorer.ec index cb9fa3d..455ef9d 100644 --- a/newexplorer/src/Explorer.ec +++ b/newexplorer/src/Explorer.ec @@ -9,7 +9,9 @@ class Explorer : GuiApplication QuickPathTool goPath { }; QuickPathTool searchPath { }; char * findWhat = null; + SetLoggingMode(debug, null); + if(argc > 1) { if(!strcmpi(argv[1], "go") && argc > 2) diff --git a/newexplorer/src/ExplorerWindow.ec b/newexplorer/src/ExplorerWindow.ec index a1b1aa6..98b1971 100644 --- a/newexplorer/src/ExplorerWindow.ec +++ b/newexplorer/src/ExplorerWindow.ec @@ -98,6 +98,11 @@ class ExplorerWindow : Window 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;