libede:FileSystemSearch: migration to FileSystemBox mostly done
[ede] / libede / src / FileSystemBox.ec
index 24c443d..8557aac 100644 (file)
@@ -475,8 +475,9 @@ private:
 
       bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
       {
+         bool result = !(selection && selection.type.isFolder && bits.navigateFolders);
          OpenNode();
-         return false;
+         return result;
       }
 
       bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
@@ -494,12 +495,8 @@ private:
    {
       bool result;
       if(selection && selection.type.isFolder && bits.navigateFolders)
-      {
          property::path = selection.path;
-         result = true;
-      }
-      else
-         result = NotifyNodeOpen(this.master, this, selection);
+      result = NotifyNodeOpen(this.master, this, selection);
       return result;
    }
 
@@ -585,14 +582,7 @@ private:
             (bits.filesOnly && listing.stats.attribs.isFile))
          {
             FileSystemNode node = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
-            DataRow row = list.AddRow();
-            row.tag = (int)node;
-            row.SetData(nameField, node);
-            if(bits.details)
-            {
-               row.SetData(typeField, node.extension);
-               row.SetData(sizeField, (void *)node.stats.size);
-            }
+            AddNode(node);
          }
       }
       list.Sort(nameField, 1);
@@ -738,6 +728,18 @@ private:
       parent.childrenLoaded = true;
    }
 
+   void AddNode(FileSystemNode node)
+   {
+      DataRow row = list.AddRow();
+      row.tag = (int)node;
+      row.SetData(nameField, node);
+      if(bits.details)
+      {
+         row.SetData(typeField, node.extension);
+         row.SetData(sizeField, (void *)node.stats.size);
+      }
+   }
+
    void AddTreeNode(FileSystemNode node, bool loaded, bool addLoader, FileSystemNode addTo)
    {
       DataRow row = (addTo && addTo.row) ? addTo.row.AddRow() : list.AddRow();
@@ -750,6 +752,11 @@ private:
       row.tag = (int)node;
       node.row = row;
       row.SetData(null, node);
+      if(bits.details)
+      {
+         row.SetData(typeField, node.extension);
+         row.SetData(sizeField, (void *)node.stats.size);
+      }
 
       node.loaded = loaded;
       if(addLoader)
@@ -1874,12 +1881,15 @@ public:
          }
       }
       else
+      {
 /*#ifdef __WIN32__
          strcpy(outputPath, "/");
 #else*/
-         strcpy(outputPath, name);
+         //strcpy(outputPath, name);
+         strcpy(outputPath, path);
+         PathCat(outputPath, name);
 //#endif
-
+      }
    }
 
    bool IsChildOf(FileSystemNode node)
@@ -2111,7 +2121,8 @@ public:
    }
    return node;
 }*/
-static FileSystemNode MakeFileSystemNode(const FileStats stats,
+
+FileSystemNode MakeFileSystemNode(const FileStats stats,
       const char * fileName, const char * filePath,
       const bool previewPicture, const DisplaySystem displaySystem)
 {