Explorer; libede: Fixes to compile, warnings; fixed single window coming up when...
[ede] / explorer / src / ExplorerWindow.ec
index f1c0a2d..d22c0d2 100644 (file)
@@ -66,7 +66,7 @@ enum Icon
    searchInSubDirs, searchStart, searchStop,
    hasHeader
 };
-static char * iconNames[Icon::enumSize] =
+static const char * iconNames[Icon::enumSize] =
 {
    "<:ecere>emblems/unreadable.png",         /* missing */
 
@@ -152,7 +152,7 @@ class ExplorerWindow : Window
 
    int treeSplit;
    int searchSplit;
-   
+
    ExplorerToolId lastViewId;
 */
 
@@ -162,7 +162,7 @@ class ExplorerWindow : Window
 
 
    menu = Menu { };
-   
+
    Menu fileMenu { menu, "File", f };
    Menu windowMenu { menu, "Window", w };
       MenuItem itemNewWindow { windowMenu, "New Window", n, NotifySelect = NewWindow_NotifySelect };
@@ -445,7 +445,7 @@ class ExplorerWindow : Window
    IconToolButton goUp { toolBar, this, icon = goUp, hotKey = { up, alt = true }, toolTip = "Go to Parent Folder";
       bool NotifyClicked(Button button, int x, int y, Modifiers mods)
       {
-         char * path = view.path;
+         const char * path = view.path;
          char * newPath = new char[strlen(path)+1];
          StripLastDirectory(path, newPath);
          if(!newPath[0])
@@ -881,6 +881,7 @@ class ExplorerWindow : Window
       {
          //((FileSystemCacheIterator)fileSystemIterator).cache = testCache;
          //((FileSystemIterator)fileSystemIterator)
+         return true;
       }
 
       bool NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection)
@@ -931,7 +932,7 @@ class ExplorerWindow : Window
 
          //PrintLn(node.name);
          if(box.selection.nodes.count == 1)
-            itemString = node.name;
+            itemString = CopyString(node.name);
          else
             itemString = PrintString(box.selection.nodes.count, " items");
          text = PrintString("Open ", itemString);
@@ -1102,6 +1103,7 @@ class ExplorerWindow : Window
          if(CreateNewFileDialog { /*master = */ew/*, parent = parent*/, currentDirectory = selection ? ew.view.selection.node.path : ew.view.path }.Modal() == ok )
             ew.Refresh();
       }
+      return true;
    }
 
    //void NewFolder()
@@ -1113,10 +1115,11 @@ class ExplorerWindow : Window
          if(CreateDirectoryDialog { /*master = */ew/*, parent = parent*/, currentDirectory = selection ? ew.view.selection.node.path : ew.view.path }.Modal() == ok )
             ew.Refresh();
       }
+      return true;
    }
 
    //void GoTo(char * location/*, bool viewIsAtLocation, bool treeIsAtLocation*/)
-   property char * location
+   property const char * location
    {
       set
       {
@@ -1317,7 +1320,7 @@ class ExplorerWindow : Window
       }
       return true;
    }*/
-   
+
    /*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
    {
       ExplorerFileBranch branch = tree.branch;
@@ -1326,14 +1329,14 @@ class ExplorerWindow : Window
          if(item.type.isFolderType)
          {
             ExplorerFileBranch child;
-            
+
             if(!branch.loaded || !branch.childrenLoaded)
                BranchLoad(branch, tree.tree);
 
             for(child = branch.children.first; child; child = child.next)
                if(!strcmp(child.name, item.name))
                   break;
-            
+
             if(child)
             {
                if(branch.row.collapsed)
@@ -1409,7 +1412,7 @@ class ExplorerWindow : Window
          NotifyItemOpen = ViewNotifyItemOpen;
       };
       lastViewId = viewList;
-      
+
       tree.Load();
       view.Load(tree.root);
    }*/