- Files were not showing at startup
- Toggling details wasn't working
- Toggling showcase didn't reset the view properly
"Folder" : "extern",
"Files" : [
{
"Folder" : "extern",
"Files" : [
{
- "FileName" : "../../../sdk/extras/gui/controls/ToolBar.ec",
+ "FileName" : "$(ECERE_SDK_SRC)/extras/gui/controls/ToolBar.ec",
"Options" : {
"ExcludeFromBuild" : true
}
},
"Options" : {
"ExcludeFromBuild" : true
}
},
- "../../../sdk/extras/gui/controls/SearchBox.ec"
+ "$(ECERE_SDK_SRC)/extras/gui/controls/SearchBox.ec"
],
"Configurations" : [
{
],
"Configurations" : [
{
ListBox list
{
parent = this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true;
ListBox list
{
parent = this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true;
}
// what if a child of some parent was added before that parent, should check to remove
// or is it imposible to get the backwards order from GetMultiSelection
}
// what if a child of some parent was added before that parent, should check to remove
// or is it imposible to get the backwards order from GetMultiSelection
//for(branch = (ExplorerFileBranch)row.tag; branch; branch = branch.parent)
// branches.Add(branch);
}
//for(branch = (ExplorerFileBranch)row.tag; branch; branch = branch.parent)
// branches.Add(branch);
}
parent.DuplicateChildren(true, true, root, list);
}
}
parent.DuplicateChildren(true, true, root, list);
}
}
*/
/*
copies.count = branches.count;
*/
/*
copies.count = branches.count;
{
bool added = true;
uint b;
{
bool added = true;
uint b;
openArgsStartAt = 2;
else if(!strcmpi(argv[1], "find") && argc > 2)
{
openArgsStartAt = 2;
else if(!strcmpi(argv[1], "find") && argc > 2)
{
- StripQuotes(argv[2], unquoted);
+ {
+ findWhat = new char[strlen(argv[2])+1];
+ StripQuotes(argv[2], findWhat);
+ }
- unquoted = argv[2];
- findWhat = CopyString(unquoted);
+ findWhat = CopyString(argv[2]);
if(argc > 3)
{
if(!strcmpi(argv[3], "in") && argc > 4)
if(argc > 3)
{
if(!strcmpi(argv[3], "in") && argc > 4)
}
else
searchPath = ""; // same
}
else
searchPath = ""; // same
else if(!strcmpi(argv[1], "search") && argc > 2)
searchPath = argv[2];
else if(!strcmpi(argv[1], "compare") && argc > 2)
else if(!strcmpi(argv[1], "search") && argc > 2)
searchPath = argv[2];
else if(!strcmpi(argv[1], "compare") && argc > 2)
if(argc == 3)
{
goPath = ""; // current dir
if(argc == 3)
{
goPath = ""; // current dir
- comparedPaths.Add(goPath);
+ comparedPaths.Add(CopyString((const char *)goPath)); // TODO: Review whether this gets freed?
}
for(c = 2; c < argc; c++)
{
}
for(c = 2; c < argc; c++)
{
goPath = argv[c];
s = goPath;
if(s)
goPath = argv[c];
s = goPath;
if(s)
explorerWnd.Create();
explorerWnd.location = goPath;//explorerWnd.GoTo(goPath, false, false);
}
explorerWnd.Create();
explorerWnd.location = goPath;//explorerWnd.GoTo(goPath, false, false);
}
+ if(openArgsStartAt == -1)
+ break;
explorerWnd.Create();
explorerWnd.view.columnsCompareStyle = true;
explorerWnd.comparedLocations = comparedPaths;
explorerWnd.Create();
explorerWnd.view.columnsCompareStyle = true;
explorerWnd.comparedLocations = comparedPaths;
// delete comparedPaths;
}
// delete comparedPaths;
}
+ if(comparedPaths)
+ {
+ comparedPaths.Free();
+ delete comparedPaths;
+ }
{
char path[MAX_LOCATION];
{
char path[MAX_LOCATION];
GetWorkingDir(path, MAX_LOCATION);
if(value[0] == '\"')
GetWorkingDir(path, MAX_LOCATION);
if(value[0] == '\"')
+ {
+ char * unquoted = new char[strlen(value) + 1];
StripQuotes(value, unquoted);
StripQuotes(value, unquoted);
+ PathCat(path, unquoted);
+ delete unquoted;
+ }
- unquoted = value;
- PathCat(path, unquoted);
if(!FileExists(path))
{
// this incomplete functionality is not quite at it's place in this class
if(!FileExists(path))
{
// this incomplete functionality is not quite at it's place in this class
StripLastDirectory(path, path);
if(FileExists(path))
{
StripLastDirectory(path, path);
if(FileExists(path))
{
- // TODO: message location does not exist,
+ // TODO: message location does not exist,
// this higher location exists though
// go there?
break;
// this higher location exists though
// go there?
break;
- // TODO: message location does not exist,
+ // TODO: message location does not exist,
// unable to select alternate location
}
path[0] = '\0';
// unable to select alternate location
}
path[0] = '\0';
searchInSubDirs, searchStart, searchStop,
hasHeader
};
searchInSubDirs, searchStart, searchStop,
hasHeader
};
-static char * iconNames[Icon::enumSize] =
+static const char * iconNames[Icon::enumSize] =
{
"<:ecere>emblems/unreadable.png", /* missing */
{
"<:ecere>emblems/unreadable.png", /* missing */
int treeSplit;
int searchSplit;
int treeSplit;
int searchSplit;
ExplorerToolId lastViewId;
*/
ExplorerToolId lastViewId;
*/
Menu fileMenu { menu, "File", f };
Menu windowMenu { menu, "Window", w };
MenuItem itemNewWindow { windowMenu, "New Window", n, NotifySelect = NewWindow_NotifySelect };
Menu fileMenu { menu, "File", f };
Menu windowMenu { menu, "Window", w };
MenuItem itemNewWindow { windowMenu, "New Window", n, NotifySelect = NewWindow_NotifySelect };
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)
{
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])
char * newPath = new char[strlen(path)+1];
StripLastDirectory(path, newPath);
if(!newPath[0])
ToggleIconToolButton viewDetails { toolBar, this, icon = viewDetails, toolTip = "Toggle Listing Details";
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
ToggleIconToolButton viewDetails { toolBar, this, icon = viewDetails, toolTip = "Toggle Listing Details";
bool NotifyClicked(Button button, int x, int y, Modifiers mods)
{
+ view.details = button.checked;
view.treeBranches = false;
view.Refresh();
view.Activate();
view.treeBranches = false;
view.Refresh();
view.Activate();
{
//((FileSystemCacheIterator)fileSystemIterator).cache = testCache;
//((FileSystemIterator)fileSystemIterator)
{
//((FileSystemCacheIterator)fileSystemIterator).cache = testCache;
//((FileSystemIterator)fileSystemIterator)
}
bool NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection)
}
bool NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection)
//PrintLn(node.name);
if(box.selection.nodes.count == 1)
//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);
else
itemString = PrintString(box.selection.nodes.count, " items");
text = PrintString("Open ", itemString);
if(CreateNewFileDialog { /*master = */ew/*, parent = parent*/, currentDirectory = selection ? ew.view.selection.node.path : ew.view.path }.Modal() == ok )
ew.Refresh();
}
if(CreateNewFileDialog { /*master = */ew/*, parent = parent*/, currentDirectory = selection ? ew.view.selection.node.path : ew.view.path }.Modal() == ok )
ew.Refresh();
}
if(CreateDirectoryDialog { /*master = */ew/*, parent = parent*/, currentDirectory = selection ? ew.view.selection.node.path : ew.view.path }.Modal() == ok )
ew.Refresh();
}
if(CreateDirectoryDialog { /*master = */ew/*, parent = parent*/, currentDirectory = selection ? ew.view.selection.node.path : ew.view.path }.Modal() == ok )
ew.Refresh();
}
}
//void GoTo(char * location/*, bool viewIsAtLocation, bool treeIsAtLocation*/)
}
//void GoTo(char * location/*, bool viewIsAtLocation, bool treeIsAtLocation*/)
- property char * location
+ property const char * location
void UpdateHistoryItem(FileSystemBoxSelection selection)
{
void UpdateHistoryItem(FileSystemBoxSelection selection)
{
- HistoryItem item = history[historyIndex];
-
- if(!item.holdRecordingSelection)
+ if(history.count > historyIndex) // TODO: Review why this would happen...
- if(selection.node || (selection.nodes && selection.nodes.count))
+ HistoryItem item = history[historyIndex];
+
+ if(!item.holdRecordingSelection)
- item.selection.Free();
- if(selection.nodes.count)
+ if(selection.node || (selection.nodes && selection.nodes.count))
- for(node : selection.nodes)
- item.selection.Add(CopyString(node.path));
+ item.selection.Free();
+ if(selection.nodes.count)
+ {
+ for(node : selection.nodes)
+ item.selection.Add(CopyString(node.path));
+ }
+ else if(selection.node)
+ item.selection.Add(CopyString(selection.node.path));
- else if(selection.node)
- item.selection.Add(CopyString(selection.node.path));
+ else
+ item.holdRecordingSelection = false;
- else
- item.holdRecordingSelection = false;
/*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
{
ExplorerFileBranch branch = tree.branch;
/*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
{
ExplorerFileBranch branch = tree.branch;
if(item.type.isFolderType)
{
ExplorerFileBranch child;
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(!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)
if(child)
{
if(branch.row.collapsed)
//userMode = true;
addressBar.path = view.path;
ReadyTree();
//userMode = true;
addressBar.path = view.path;
ReadyTree();
NotifyItemOpen = ViewNotifyItemOpen;
};
lastViewId = viewList;
NotifyItemOpen = ViewNotifyItemOpen;
};
lastViewId = viewList;
tree.Load();
view.Load(tree.root);
}*/
tree.Load();
view.Load(tree.root);
}*/
void SearchStart()
{
char text[2048];
void SearchStart()
{
char text[2048];
searchThread.active = true;
searchThread.optionSubdirs = options.subdirs.checked;
searchThread.active = true;
searchThread.optionSubdirs = options.subdirs.checked;
strcpy(searchThread.location, location.GetText());
strcpy(searchThread.nameSearch, findName.GetText());
strcpy(searchThread.contentSearch, findTextContent.GetText());
strcpy(searchThread.location, location.GetText());
strcpy(searchThread.nameSearch, findName.GetText());
strcpy(searchThread.contentSearch, findTextContent.GetText());
actions.startStop.text = "Stop Search";
actions.clear.disabled = false;
view.results.Clear();
actions.startStop.text = "Stop Search";
actions.clear.disabled = false;
view.results.Clear();
view.browser.text = "Browser";
sprintf(text, "Search Results (Searching %s)", location.GetText());
view.results.text = text;
view.browser.text = "Browser";
sprintf(text, "Search Results (Searching %s)", location.GetText());
view.results.text = text;
void SearchTerminate()
{
char text[1024];
void SearchTerminate()
{
char text[1024];
if(searchThread.terminate)
sprintf(text, "Search Results (%d item(s) found), Search was aborted.", searchThread.matchCount);
else
if(searchThread.terminate)
sprintf(text, "Search Results (%d item(s) found), Search was aborted.", searchThread.matchCount);
else
view.results.text = text;
sprintf(text, "Browser (%d item(s) searched)", searchThread.count);
view.browser.text = text;
view.results.text = text;
sprintf(text, "Browser (%d item(s) searched)", searchThread.count);
view.browser.text = text;
actions.startStop.text = "Start Search";
}
actions.startStop.text = "Start Search";
}
class ExplorerSearchViewTree : ExplorerSearchView
{
class ExplorerSearchViewTree : ExplorerSearchView
{
DataField resultsFieldPath { "char *" };
ListBox results
DataField resultsFieldPath { "char *" };
ListBox results
{
OldList selection;
Link item;
{
OldList selection;
Link item;
listBox.GetMultiSelection(selection);
listBox.GetMultiSelection(selection);
for(item = selection.first; item; item = item.next)
{
char path[MAX_LOCATION];
for(item = selection.first; item; item = item.next)
{
char path[MAX_LOCATION];
}
bool Lists_NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
}
bool Lists_NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
if(listBox.currentRow)
{
char path[MAX_LOCATION];
if(listBox.currentRow)
{
char path[MAX_LOCATION];
"DefaultNameSpace" : "ede",
"TargetType" : "SharedLibrary",
"TargetFileName" : "EDE",
"DefaultNameSpace" : "ede",
"TargetType" : "SharedLibrary",
"TargetFileName" : "EDE",
- "TargetDirectory" : "obj/$(CONFIG).$(PLATFORM)",
- "ObjectsDirectory" : "obj/$(CONFIG).$(PLATFORM)",
"Libraries" : [
"ecere"
]
"Libraries" : [
"ecere"
]
- property char * currentDirectory
+ property const char * currentDirectory
PathCat(currentDirectory, value);
FileFixCase(currentDirectory);
}
PathCat(currentDirectory, value);
FileFixCase(currentDirectory);
}
- get { return (char *)currentDirectory; }
+ get { return currentDirectory; }
GetWorkingDir(currentDirectory, MAX_DIRECTORY);
FileFixCase(currentDirectory);
GetWorkingDir(currentDirectory, MAX_DIRECTORY);
FileFixCase(currentDirectory);
#ifdef __WIN32__
static char * rootName = "Entire Computer";
#ifdef __WIN32__
static char * rootName = "Entire Computer";
-static char * msNetwork = "Microsoft Windows Network";
+static const char * msNetwork = "Microsoft Windows Network";
-static char * rootName = "File System";
+static const char * rootName = "File System";
#endif
private:
define guiApp = (GuiApplication)((__thisModule).application);
define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
#endif
private:
define guiApp = (GuiApplication)((__thisModule).application);
define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
-void MessageBoxTodo(char * message)
+void MessageBoxTodo(const char * message)
{
PrintLn("MessageBoxTodo(char * message) -- ", message);
MessageBox { type = ok, text = "MessageBoxTodo(char * message)", contents = message }.Modal();
}
{
PrintLn("MessageBoxTodo(char * message) -- ", message);
MessageBox { type = ok, text = "MessageBoxTodo(char * message)", contents = message }.Modal();
}
-static char * fileIconNames[] =
+static const char * fileIconNames[] =
{
"<:ecere>mimeTypes/file.png", /* none */
{
"<:ecere>mimeTypes/file.png", /* none */
"<:ecere>mimeTypes/package.png", /* treeLoader */
"<:ecere>places/startHere.png", /* lineNumbers */
"<:ecere>mimeTypes/package.png", /* treeLoader */
"<:ecere>places/startHere.png", /* lineNumbers */
""
};
define countOfCompIconNames = 6;
""
};
define countOfCompIconNames = 6;
-static char * compIconNames[] =
+static const char * compIconNames[] =
public enum _FileType
{
none,
public enum _FileType
{
none,
normalFile, ewsFile, epjFile, ecFile, ehFile, cFile, hFile, cppFile, hppFile,
textFile, webFile, pictureFile, soundFile,
archiveFile, packageFile, opticalMediaImageFile, /* these (all previous) are sort equal */
normalFile, ewsFile, epjFile, ecFile, ehFile, cFile, hFile, cppFile, hppFile,
textFile, webFile, pictureFile, soundFile,
archiveFile, packageFile, opticalMediaImageFile, /* these (all previous) are sort equal */
folder, folderOpen, computer,
drive, netDrive, cdrom, removable, floppy, network, server, share, // these are sort equal
folder, folderOpen, computer,
drive, netDrive, cdrom, removable, floppy, network, server, share, // these are sort equal
// utilities
treeLoader,
lineNumbers;
// utilities
treeLoader,
lineNumbers;
virtual bool Window::NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection);
virtual bool Window::NotifyNodeMenu(FileSystemBox box, Menu menu, FileSystemBoxSelection selection);
virtual bool Window::NotifyIteratorInit(FileSystemBox box, FileSystemIterator fileSystemIterator);
virtual bool Window::NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection);
virtual bool Window::NotifyNodeMenu(FileSystemBox box, Menu menu, FileSystemBoxSelection selection);
virtual bool Window::NotifyIteratorInit(FileSystemBox box, FileSystemIterator fileSystemIterator);
+
+ property const char * path
+ if(comparedPaths)
+ {
+ comparedPaths.Free();
+ delete comparedPaths;
+ }
if(value && value.count)
comparedPaths = value;
if(locationBox)
if(value && value.count)
comparedPaths = value;
if(locationBox)
split.leftPane = value ? list : null;
split.visible = value;
show.visible = value;
split.leftPane = value ? list : null;
split.visible = value;
show.visible = value;
+ if(!value)
+ {
+ list.parent = this;
+ list.anchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 };
+ }
}
get { return bits.preview; }
};
property bool columnsCompareStyle { set { bits.columnsCompareStyle = value; } get { return bits.columnsCompareStyle; } };
property bool textFileLinesStyle { set { bits.textFileLinesStyle = value; } get { return bits.textFileLinesStyle; } };
}
get { return bits.preview; }
};
property bool columnsCompareStyle { set { bits.columnsCompareStyle = value; } get { return bits.columnsCompareStyle; } };
property bool textFileLinesStyle { set { bits.textFileLinesStyle = value; } get { return bits.textFileLinesStyle; } };
property FileSystemNode node
{
get
property FileSystemNode node
{
get
- FileSystemNode SelectLocation(char * location)
+ FileSystemNode SelectLocation(const char * location)
for(c = steps.count - 1; c >= 0; c--)
{
for(c = steps.count - 1; c >= 0; c--)
{
node = Find(steps[c], node);
if(!node)
break;
node = Find(steps[c], node);
if(!node)
break;
bool MenuOpen(MenuItem selection, Modifiers mods)
{
OpenNode();
bool MenuOpen(MenuItem selection, Modifiers mods)
{
OpenNode();
}
bool MenuReplaceListItemByContainingDir(MenuItem selection, Modifiers mods)
}
bool MenuReplaceListItemByContainingDir(MenuItem selection, Modifiers mods)
+ char wd[MAX_LOCATION];
+ GetWorkingDir(wd, sizeof(wd));
+ property::path = wd;
+
InitFileIcons();
InitCompIcons(); // todo: these icons should not be initialize, they should be set
// or at least initalized when the comparison listing is requested
InitFileIcons();
InitCompIcons(); // todo: these icons should not be initialize, they should be set
// or at least initalized when the comparison listing is requested
+ if(comparedPaths)
+ {
+ comparedPaths.Free();
+ delete comparedPaths;
+ }
delete extensions;
delete path;
}
delete extensions;
delete path;
}
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
popup = PopupMenu
{
master = this, menu = menu,
popup = PopupMenu
{
master = this, menu = menu,
- position = {
- x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
+ position = {
+ x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
- FileSystemNode node = (FileSystemNode)row.tag;
+ //FileSystemNode node = (FileSystemNode)row.tag;
- FileSystemNode node = (FileSystemNode)row.tag;
+ //FileSystemNode node = (FileSystemNode)row.tag;
- FileSystemNode node = (FileSystemNode)row.tag;
+ //FileSystemNode node = (FileSystemNode)row.tag;
bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
{
bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
{
if((SmartKey)key == enter)
if((SmartKey)key == enter)
+ /*result = */OpenNode();
#if 0
else if((SmartKey)key == f2)
#if 0
else if((SmartKey)key == f2)
+ /*result = */RenameNode();
#endif
else if((SmartKey)key == f2)
{
FileSystemNode node = selection.node;
node.row.Edit(nameField);
}
#endif
else if((SmartKey)key == f2)
{
FileSystemNode node = selection.node;
node.row.Edit(nameField);
}
+ //else
+ //result = true;
int wWnd = fsb.show.clientSize.w;
int hWnd = fsb.show.clientSize.h;
int wWnd = fsb.show.clientSize.w;
int hWnd = fsb.show.clientSize.h;
- int wList = 0;//fsb.list.size.w + fsb.split.size.w;
+ //int wList = 0;//fsb.list.size.w + fsb.split.size.w;
- float scale = Min((float)(wWnd - 10) / wBmp, (float)(hWnd - 10) / hBmp);
+ //float scale = Min((float)(wWnd - 10) / wBmp, (float)(hWnd - 10) / hBmp);
- int wDraw = (int)(wBmp * scale);
- int hDraw = (int)(hBmp * scale);
+ //int wDraw = (int)(wBmp * scale);
+ //int hDraw = (int)(hBmp * scale);
#ifndef __linux__
surface.Filter(fsb.bitmap, (wWnd - wDraw) / 2, (hWnd - hDraw) / 2, 0, 0, wDraw, hDraw, wBmp, hBmp);
#ifndef __linux__
surface.Filter(fsb.bitmap, (wWnd - wDraw) / 2, (hWnd - hDraw) / 2, 0, 0, wDraw, hDraw, wBmp, hBmp);
surface.Area(0, 0, fsb.clientSize.w - 1, fsb.clientSize.h - 1);
}
}
surface.Area(0, 0, fsb.clientSize.w - 1, fsb.clientSize.h - 1);
}
}
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
- // WHY is this crashing ?
+ // WHY is this crashing ?
/*void OnResize(int width, int height)
{
if(this && nameField)
/*void OnResize(int width, int height)
{
if(this && nameField)
{
bool isRoot = !strcmp(path, "/");
char name[MAX_LOCATION];
{
bool isRoot = !strcmp(path, "/");
char name[MAX_LOCATION];
- FileSystemNode parent;
- FileSystemNode node;
- FileListing listing { path, extensions = extensions };
+ //FileSystemNode parent;
+ //FileSystemNode node;
+ //FileListing listing { path, extensions = extensions };
if(!isRoot)
GetLastDirectory(path, name);
else
name[0] = '\0';
if(!isRoot)
GetLastDirectory(path, name);
else
name[0] = '\0';
/*if(!path)
GetWorkingDir(startPath, sizeof(startPath));
else
strcpy(path, startPath);*/
/*if(!path)
GetWorkingDir(startPath, sizeof(startPath));
else
strcpy(path, startPath);*/
delete root;
#ifdef __WIN32__
if(isRoot)
delete root;
#ifdef __WIN32__
if(isRoot)
- bool ListIterator_OnObject(char * name, char * path, FileStats stats, bool isRootObject)
+ bool ListIterator_OnObject(const char * name, const char * path, FileStats stats, bool isRootObject)
{
ProcessListItem(name, path, stats, false);
return false;
{
ProcessListItem(name, path, stats, false);
return false;
//void ListIterator_OnLeavingDirectory(char * path) { }
//void ListIterator_OnLeavingDirectory(char * path) { }
- void ProcessListItem(char * name, char * path, FileStats stats, bool isListItem)
+ void ProcessListItem(const char * name, const char * path, FileStats stats, bool isListItem)
{
if((!bits.foldersOnly && !bits.filesOnly) || (bits.foldersOnly && stats.attribs.isDirectory) || (bits.filesOnly && stats.attribs.isFile))
{
{
if((!bits.foldersOnly && !bits.filesOnly) || (bits.foldersOnly && stats.attribs.isDirectory) || (bits.filesOnly && stats.attribs.isFile))
{
FileListing listing { path, extensions = extensions };
while(listing.Find())
{
FileListing listing { path, extensions = extensions };
while(listing.Find())
{
FileSystemNode child = null;
if((!bits.foldersOnly && !bits.filesOnly) ||
(bits.foldersOnly && listing.stats.attribs.isDirectory) ||
(bits.filesOnly && listing.stats.attribs.isFile))
child = MakeAndAddToTreeFileSystemNodeFromFileListing(listing, parent);
if(child)
FileSystemNode child = null;
if((!bits.foldersOnly && !bits.filesOnly) ||
(bits.foldersOnly && listing.stats.attribs.isDirectory) ||
(bits.filesOnly && listing.stats.attribs.isFile))
child = MakeAndAddToTreeFileSystemNodeFromFileListing(listing, parent);
if(child)
- test = child.name;
- if(!test)
- PrintLn("error");
+ /*
+ test = child.name;
+ if(!test)
+ PrintLn("error");
+ */
+ }
}
if(!added)
added = true;
}
if(!added)
added = true;
void LoadComparedList()
{
void LoadComparedList()
{
- int c, cmp/*, smallest*/, icon;//, equalCount;
+ int c/*, cmp*/ /*, smallest*/, icon;//, equalCount;
int count = comparedPaths ? comparedPaths.count : 0;
//bool allDone = false;
bool not;
int count = comparedPaths ? comparedPaths.count : 0;
//bool allDone = false;
bool not;
void AddNode(FileSystemNode node)
{
DataRow row = list.AddRow();
void AddNode(FileSystemNode node)
{
DataRow row = list.AddRow();
+ row.tag = (intptr)node;
node.row = row;
incref node;
row.SetData(nameField, node);
node.row = row;
incref node;
row.SetData(nameField, node);
(bits.filesOnly && listing.stats.attribs.isFile)))*/
{
bool textFileLinesStyle = false;
(bits.filesOnly && listing.stats.attribs.isFile)))*/
{
bool textFileLinesStyle = false;
- char * test = listing.name;
+ const char * test = listing.name;
if(!test)
PrintLn("error");
result = MakeFileSystemNode(listing.stats, listing.name, listing.path, false, bits.previewPictures, false, displaySystem);
if(!test)
PrintLn("error");
result = MakeFileSystemNode(listing.stats, listing.name, listing.path, false, bits.previewPictures, false, displaySystem);
node.indent = addTo.indent + 1;
addTo.children.Add(node);
}
node.indent = addTo.indent + 1;
addTo.children.Add(node);
}
+ row.tag = (intptr)node;
node.row = row;
row.SetData(null, node);
if(bits.pathColumn)
node.row = row;
row.SetData(null, node);
if(bits.pathColumn)
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
{
_[c].Free();
delete _[c];
{
_[c].Free();
delete _[c];
int hWnd = clientSize.h;
int wList = view.list.size.w + view.split.size.w;
int hWnd = clientSize.h;
int wList = view.list.size.w + view.split.size.w;
float scale = Min((float)(wWnd - 10) / wBmp, (float)(hWnd - 10) / hBmp);
float scale = Min((float)(wWnd - 10) / wBmp, (float)(hWnd - 10) / hBmp);
int wDraw = (int)(wBmp * scale);
int hDraw = (int)(hBmp * scale);
int wDraw = (int)(wBmp * scale);
int hDraw = (int)(hBmp * scale);
for(pos = 0; pos < selectedItems.count; pos++)
{
Bitmap bitmap { };
for(pos = 0; pos < selectedItems.count; pos++)
{
Bitmap bitmap { };
- selItem = (ExplorerFileItem)selectedItems._[pos];
+ selItem = (ExplorerFileItem)selectedItems._[pos];
bitmap.Load(selItem.path, null, displaySystem);
//view.bitmaps.Add(bitmap);
bitmap.Load(selItem.path, null, displaySystem);
//view.bitmaps.Add(bitmap);
if(item && item.type == pictureFile)
{
view.bitmap = Bitmap { };
if(item && item.type == pictureFile)
{
view.bitmap = Bitmap { };
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
FileSystemNode selection;
virtual bool Window::NotifyNodeSelect(ExplorerTree tree, FileSystemNode node);
FileSystemNode selection;
virtual bool Window::NotifyNodeSelect(ExplorerTree tree, FileSystemNode node);
property FileSystemNode node
{
get
property FileSystemNode node
{
get
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
popup = PopupMenu
{
master = this, menu = menu,
popup = PopupMenu
{
master = this, menu = menu,
- position = {
- x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
+ position = {
+ x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
- // WHY is this crashing ?
+ // WHY is this crashing ?
/-*void OnResize(int width, int height)
{
if(this && nameField)
/-*void OnResize(int width, int height)
{
if(this && nameField)
#endif
AddTreeNode(root, true, false, false, null, tree);
#endif
AddTreeNode(root, true, false, false, null, tree);
- // How can this make sense for linux?
+ // How can this make sense for linux?
#ifdef __WIN32__
while(listing.Find())
{
int len = strlen(listing.name);
char info[MAX_LOCATION];
char name[MAX_LOCATION];
#ifdef __WIN32__
while(listing.Find())
{
int len = strlen(listing.name);
char info[MAX_LOCATION];
char name[MAX_LOCATION];
- if(listing.stats.attribs.isDrive &&
+ if(listing.stats.attribs.isDrive &&
len > 3 && !strncmp(&listing.name[1], ": [", 3))
{
strncpy(name, listing.name, 2);
len > 3 && !strncmp(&listing.name[1], ": [", 3))
{
strncpy(name, listing.name, 2);
ClipBoard clipBoard { };
if(clipBoard.Allocate(size+1))
{
ClipBoard clipBoard { };
if(clipBoard.Allocate(size+1))
{
- GetSel(clipBoard.memory, true);
+ GetSel(clipBoard.memory, true);
// Save clipboard
clipBoard.Save();
}
// Save clipboard
clipBoard.Save();
}
If hGlobal Then 'if the globalalloc worked
lpGlobal = GlobalLock(hGlobal) 'lock the hGlobal
DF.pFiles = Len(DF) 'set the size of the files
If hGlobal Then 'if the globalalloc worked
lpGlobal = GlobalLock(hGlobal) 'lock the hGlobal
DF.pFiles = Len(DF) 'set the size of the files
Call CopyMem(ByVal lpGlobal, DF, Len(DF)) 'copy df to the lpglobal
Call CopyMem(ByVal (lpGlobal + Len(DF)), ByVal strFiles, Len(strFiles)) 'copy strfiles to lpglobal
Call GlobalUnlock(hGlobal) 'unlock hglobal again
Call CopyMem(ByVal lpGlobal, DF, Len(DF)) 'copy df to the lpglobal
Call CopyMem(ByVal (lpGlobal + Len(DF)), ByVal strFiles, Len(strFiles)) 'copy strfiles to lpglobal
Call GlobalUnlock(hGlobal) 'unlock hglobal again
SetClipboardData CF_HDROP, hGlobal 'put files to the clipboard
End If
*-/
SetClipboardData CF_HDROP, hGlobal 'put files to the clipboard
End If
*-/
}
BSloc Remove(FileSystemNode item)
{
}
BSloc Remove(FileSystemNode item)
{
//float scale = Min((float)clientSize.w / (float)bitmap.width, (float)clientSize.h / (float)bitmap.height);
int w = 16; //(int)(bitmap.width * scale);
int h = 16; //(int)(bitmap.height * scale);
//float scale = Min((float)clientSize.w / (float)bitmap.width, (float)clientSize.h / (float)bitmap.height);
int w = 16; //(int)(bitmap.width * scale);
int h = 16; //(int)(bitmap.height * scale);
Bitmap icon;
icon = control.fileIcons[type].bitmap;
Bitmap icon;
icon = control.fileIcons[type].bitmap;
indentSize = 8;
}
textOffset = indent * indentSize + (icon ? (icon.width + 6) : 0);
indentSize = 8;
}
textOffset = indent * indentSize + (icon ? (icon.width + 6) : 0);
if(info)
sprintf(label, "%s [%s]", name, info);
else
if(info)
sprintf(label, "%s [%s]", name, info);
else
{
//_[c].Free()
delete _[c];
{
//_[c].Free()
delete _[c];
char info[MAX_LOCATION];
char name[MAX_LOCATION];
char extension[MAX_EXTENSION];
char info[MAX_LOCATION];
char name[MAX_LOCATION];
char extension[MAX_EXTENSION];
ExplorerFileItem item { };
//if(stats.attribs.isFile) // -- should work now
ExplorerFileItem item { };
//if(stats.attribs.isFile) // -- should work now
item.type = cdrom;
if(attribs.isRemote)
item.type = netDrive;
item.type = cdrom;
if(attribs.isRemote)
item.type = netDrive;
- if(attribs.isRemovable)
+ if(attribs.isRemovable)
{
if(fileName[0] == 'A' || fileName[0] == 'B')
item.type = floppy;
{
if(fileName[0] == 'A' || fileName[0] == 'B')
item.type = floppy;
GetExtension(fileName, extension);
//strupr(extension);
strlwr(extension);
GetExtension(fileName, extension);
//strupr(extension);
strlwr(extension);
item.type = _FileType::SelectByExtension(extension);
}
item.type = _FileType::SelectByExtension(extension);
}
len > 3 && !strncmp(&fileName[1], ": [", 3))
{
strncpy(name, fileName, 2);
len > 3 && !strncmp(&fileName[1], ": [", 3))
{
strncpy(name, fileName, 2);
- /*//LinkElement<FileSystemNode> link;
+ /* LinkElement<FileSystemNode> link;
FileSystemNode parent;
FileSystemNodeType type;
FileSystemNode parent;
FileSystemNodeType type;
property bool isListItem { set { bits.isListItem = value; } get { return bits.isListItem; } };
property bool isListItem { set { bits.isListItem = value; } get { return bits.isListItem; } };
+ property const char * path
{
set { delete path; if(value && value[0]) path = CopyString(value); }
get { return path; } isset { return path && path[0]; }
}
{
set { delete path; if(value && value[0]) path = CopyString(value); }
get { return path; } isset { return path && path[0]; }
}
+ property const char * name
{
set { delete name; if(value && value[0]) name = CopyString(value); }
get { return name; } isset { return name && name[0]; }
{
set { delete name; if(value && value[0]) name = CopyString(value); }
get { return name; } isset { return name && name[0]; }
set { delete extension; if(value && value[0]) extension = CopyString(value); }
get { return extension; } isset { return extension && extension[0]; }
}
set { delete extension; if(value && value[0]) extension = CopyString(value); }
get { return extension; } isset { return extension && extension[0]; }
}
+ property const char * label
{
set { delete label; if(value && value[0]) label = CopyString(value); }
get { return label; } isset { return label && label[0]; }
}
{
set { delete label; if(value && value[0]) label = CopyString(value); }
get { return label; } isset { return label && label[0]; }
}
+ property const char * info
{
set { delete info; if(value && value[0]) info = CopyString(value); }
get { return info; } isset { return info && info[0]; }
{
set { delete info; if(value && value[0]) info = CopyString(value); }
get { return info; } isset { return info && info[0]; }
Array<int> exists; // would use (see) BoolArrayInt to pack this into an int if could be accessed as an array
void GetPath(String outputPath)
Array<int> exists; // would use (see) BoolArrayInt to pack this into an int if could be accessed as an array
void GetPath(String outputPath)
if(path)
strcpy(outputPath, path);
else if(parent)
if(path)
strcpy(outputPath, path);
else if(parent)
PathCat(temp, outputPath);
strcpy(outputPath, temp);
}
PathCat(temp, outputPath);
strcpy(outputPath, temp);
}
- /*else
- {
- /-*#ifdef __WIN32__
- strcpy(outputPath, "/");
- #else*-/
- //strcpy(outputPath, name);
- strcpy(outputPath, path);
- PathCat(outputPath, name);
- //#endif
- }*/
+ else
+ strcpy(outputPath, name ? name : "");
}
bool IsChildOf(FileSystemNode node)
}
bool IsChildOf(FileSystemNode node)
if(children.first)
{
FileSystemNode child;
if(children.first)
{
FileSystemNode child;
for(child = children.first; child; child = child.next)
{
FileSystemNode copy { };
for(child = children.first; child; child = child.next)
{
FileSystemNode copy { };
void EnsureVisible(bool expand)
{
if(parent)
void EnsureVisible(bool expand)
{
if(parent)
void OnDisplay(Surface surface, int x, int y, int width, FileSystemBox fsb, Alignment alignment, DataDisplayFlags displayFlags)
{
//int indentSize = (displayFlags.dropBox) ? 0 : 10;
void OnDisplay(Surface surface, int x, int y, int width, FileSystemBox fsb, Alignment alignment, DataDisplayFlags displayFlags)
{
//int indentSize = (displayFlags.dropBox) ? 0 : 10;
int xStart;
int len;
int w, h;
int xStart;
int len;
int w, h;
comp = fsb.comparedPaths && fsb.comparedPaths.count > 1;
comp = fsb.comparedPaths && fsb.comparedPaths.count > 1;
icon = fsb.fileIcons[type].bitmap;
alt = bits.isListItem ? path : name;
if(comp && !fsb.bits.columnsCompareStyle && cmpIcon)
icon = fsb.fileIcons[type].bitmap;
alt = bits.isListItem ? path : name;
if(comp && !fsb.bits.columnsCompareStyle && cmpIcon)
strcpy(text, label ? label : alt); //"%d-%d/%s", stats.inode, stats.nlink
//sprintf(text, "%d-%d/%s", stats.inode, stats.nlink, label ? label : alt);
len = strlen(text);
strcpy(text, label ? label : alt); //"%d-%d/%s", stats.inode, stats.nlink
//sprintf(text, "%d-%d/%s", stats.inode, stats.nlink, label ? label : alt);
len = strlen(text);
if(!icon)
{
if(type == folder || type == folderOpen)
if(!icon)
{
if(type == folder || type == folderOpen)
indent = 8;
}
//textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
indent = 8;
}
//textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
surface.SetForeground(displayFlags.selected ? fsb.selectionText : fsb.foreground);
surface.TextOpacity(false);
surface.TextExtent(text, len, &w, &h);
h = Max(h, 16);
surface.SetForeground(displayFlags.selected ? fsb.selectionText : fsb.foreground);
surface.TextOpacity(false);
surface.TextExtent(text, len, &w, &h);
h = Max(h, 16);
// Draw the current row stipple
if(displayFlags.selected)
//surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
//surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
// Draw the current row stipple
if(displayFlags.selected)
//surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
//surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
//surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, alt, strlen(alt));
surface.WriteTextDots(alignment, xStart, y + 2, width, text, len);
//surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, alt, strlen(alt));
surface.WriteTextDots(alignment, xStart, y + 2, width, text, len);
- bool OnGetDataFromString(char * string)
+ bool OnGetDataFromString(const char * string)
{
#if 0
if(string && *string)
{
#if 0
if(string && *string)
- char * OnGetString(char * tempString, FileSystemToolWindow fileSysToolWnd, bool * needClass)
+ const char * OnGetString(char * tempString, void * unused /*FileSystemToolWindow fileSysToolWnd*/, bool * needClass)
{
return name ? name : "";
}
{
return name ? name : "";
}
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
- if(stats.attribs.isRemovable)
+ if(stats.attribs.isRemovable)
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
const bool pathAddName,
const bool previewPicture,
const bool isListItem,
const bool pathAddName,
const bool previewPicture,
const bool isListItem,
- const DisplaySystem displaySystem)
+ /*const */DisplaySystem displaySystem)
{
int len = strlen(name);
char info[MAX_LOCATION];
char name2[MAX_LOCATION];
char extension[MAX_EXTENSION];
{
int len = strlen(name);
char info[MAX_LOCATION];
char name2[MAX_LOCATION];
char extension[MAX_EXTENSION];
FileSystemNode node { stats = stats };
/*if(!pathAddName)
FileSystemNode node { stats = stats };
/*if(!pathAddName)
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
- if(stats.attribs.isRemovable)
+ if(stats.attribs.isRemovable)
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
{
GetExtension(name, extension);
strlwr(extension);
{
GetExtension(name, extension);
strlwr(extension);
node.type = _FileType::SelectByExtension(extension);
}
node.type = _FileType::SelectByExtension(extension);
}
- if(stats.attribs.isDrive &&
+ if(stats.attribs.isDrive &&
len > 3 && !strncmp(&name[1], ": [", 3))
{
strncpy(name2, name, 2);
len > 3 && !strncmp(&name[1], ": [", 3))
{
strncpy(name2, name, 2);
- bool isFile = stats.attribs.isFile;
- bool isFolder = stats.attribs.isDirectory;
+ //bool isFile = stats.attribs.isFile;
+ //bool isFolder = stats.attribs.isDirectory;
char full[MAX_LOCATION];
strcpy(full, path);
PathCat(full, name);
char full[MAX_LOCATION];
strcpy(full, path);
PathCat(full, name);
const bool previewPicture,
const int cmpIcon,
const bool cmpNot,
const bool previewPicture,
const int cmpIcon,
const bool cmpNot,
- const Array<int> exists,
- const DisplaySystem displaySystem)
+ /*const */Array<int> exists,
+ /*const */DisplaySystem displaySystem)
{
FileSystemNode node = MakeFileSystemNode(stats, name, path, pathAddName, previewPicture, false, displaySystem);
if(node)
{
FileSystemNode node = MakeFileSystemNode(stats, name, path, pathAddName, previewPicture, false, displaySystem);
if(node)
iterateStartPath = true;
// COMPILER TOFIX: this will not compile (error: method class must be derived from class) -- bool Whatever/*FileSystemCache*/::OnFolder(...)
iterateStartPath = true;
// COMPILER TOFIX: this will not compile (error: method class must be derived from class) -- bool Whatever/*FileSystemCache*/::OnFolder(...)
- bool /*FileSystemCache*/DummyFileSystemCacheWindow::OnObject(char * name, char * path, FileStats stats, bool isRootObject)
+ bool /*FileSystemCache*/DummyFileSystemCacheWindow::OnObject(const char * name, const char * path, FileStats stats, bool isRootObject)
{
bool result = true;
FileSystemCache cache = this.cache;
{
bool result = true;
FileSystemCache cache = this.cache;
- uint dev = stats.dev;
- uint inode = stats.inode;
+ //uint dev = stats.dev;
+ //uint inode = stats.inode;
char * p;
FSCacheObject parent = isRootObject ? null : cache.normalParentStack.lastIterator.data;
FSCacheObject o { parent, name = CopyString(isRootObject ? path : name), stats = stats };
char * p;
FSCacheObject parent = isRootObject ? null : cache.normalParentStack.lastIterator.data;
FSCacheObject o { parent, name = CopyString(isRootObject ? path : name), stats = stats };
if(isRootObject)
{
// TODO see if we can find a parent for it
if(isRootObject)
{
// TODO see if we can find a parent for it
}
cache.objects.Add(o);
#if _DEBUG
}
cache.objects.Add(o);
#if _DEBUG
if(cache.objects.count % 1000 == 0)
PrintLn(path, " ----- ", cache.objects.count / 1000, " --------- ", dev);
if(cache.objects.count % 1000 == 0)
PrintLn(path, " ----- ", cache.objects.count / 1000, " --------- ", dev);
- FileGetStatsLink(path, s);
+ */
+ //FileGetStatsLink(path, s);
+ /*
if(s.inode != inode)
{
PrintLn(s.inode);
PrintLn(inode);
if(s.inode != inode)
{
PrintLn(s.inode);
PrintLn(inode);
p = o.GetPath();
if(strcmp(p, path))
{
int c;
p = o.GetPath();
if(strcmp(p, path))
{
int c;
PrintLn(p);
for(c = 0; c < cache.normalParentStack.count; c++)
{
PrintLn(p);
for(c = 0; c < cache.normalParentStack.count; c++)
{
PrintLn(p);
}
PrintLn(path);
PrintLn(p);
}
PrintLn(path);
if(dev && inode && cache.bits.indexInodes)
{
FileSystemDeviceCache devCache = cache.deviceCaches[dev];
if(dev && inode && cache.bits.indexInodes)
{
FileSystemDeviceCache devCache = cache.deviceCaches[dev];
- void /*FileSystemCache*/DummyFileSystemCacheWindow::OnEnteringDirectory(char * path)
+ void /*FileSystemCache*/DummyFileSystemCacheWindow::OnEnteringDirectory(const char * path)
{
FileSystemCache cache = this.cache;
FSCacheObject o = cache.objects.lastIterator.data;
cache.normalParentStack.Add(o);
}
{
FileSystemCache cache = this.cache;
FSCacheObject o = cache.objects.lastIterator.data;
cache.normalParentStack.Add(o);
}
- void /*FileSystemCache*/DummyFileSystemCacheWindow::OnLeavingDirectory(char * path)
+ void /*FileSystemCache*/DummyFileSystemCacheWindow::OnLeavingDirectory(const char * path)
{
FileSystemCache cache = this.cache;
cache.normalParentStack.lastIterator.Remove();
{
FileSystemCache cache = this.cache;
cache.normalParentStack.lastIterator.Remove();
void Special(char * path/*, Map<String, bool> linksPaths*//*Map<uint, Map<uint, bool>> devsInodesDone*/, DummyFileSystemCacheWindow dummyWindow)
{
FileSystemCacheIterator fsci { owner = dummyWindow, cache = this, iterateStartPath = true;
void Special(char * path/*, Map<String, bool> linksPaths*//*Map<uint, Map<uint, bool>> devsInodesDone*/, DummyFileSystemCacheWindow dummyWindow)
{
FileSystemCacheIterator fsci { owner = dummyWindow, cache = this, iterateStartPath = true;
- bool /*FileSystemCache*/DummyFileSystemCacheWindow::OnObject(char * name, char * path, FileStats stats, bool isRootObject)
+ bool /*FileSystemCache*/DummyFileSystemCacheWindow::OnObject(const char * name, const char * path,
+ FileStats stats, bool isRootObject)
uint dev = stats.dev;
uint inode = stats.inode;
FileSystemCache cache = this.cache;
uint dev = stats.dev;
uint inode = stats.inode;
FileSystemCache cache = this.cache;
}
else
PrintLn("no dev/inode");
}
else
PrintLn("no dev/inode");
-Array<String> GetPathDirNamesArray(char * path)
+Array<String> GetPathDirNamesArray(const char * path)
{
Array<String> names;
if(path && path[0])
{
{
Array<String> names;
if(path && path[0])
{
char rest[MAX_LOCATION];
char name[MAX_FILENAME];
names = { };
char rest[MAX_LOCATION];
char name[MAX_FILENAME];
names = { };
{
char name[MAX_LOCATION] = "";
FileStats stats;
{
char name[MAX_LOCATION] = "";
FileStats stats;
FileGetStats(startPath, stats);
FileGetStats(startPath, stats);
- else
- FileGetStatsLink(startPath, stats);
+ /*else
+ FileGetStatsLink(startPath, stats);*/
GetLastDirectory(startPath, name);
listDirEntries = OnObject(owner, name, startPath, stats, true);
if(listDirEntries)
GetLastDirectory(startPath, name);
listDirEntries = OnObject(owner, name, startPath, stats, true);
if(listDirEntries)
{
if(frame.listing.Find())
{
{
if(frame.listing.Find())
{
- FileStats stats = followLinks ? frame.listing.stats : frame.listing.lstats;
+ FileStats stats = /*followLinks ? */frame.listing.stats /*: frame.listing.lstats*/;
listDirEntries = OnObject(owner, frame.listing.name, frame.listing.path, stats, !iterateStartPath && stack.count == 1);
if(stats.attribs.isDirectory)
{
listDirEntries = OnObject(owner, frame.listing.name, frame.listing.path, stats, !iterateStartPath && stack.count == 1);
if(stats.attribs.isDirectory)
{
bool iterateStartPath;
virtual bool Iterate(char * startPath, bool followLinks);
bool iterateStartPath;
virtual bool Iterate(char * startPath, bool followLinks);
- virtual bool any_object::OnObject(/*any_object data, */char * name, char * path, FileStats stats, bool isRootObject);
- virtual void any_object::OnEnteringDirectory(/*any_object data, */char * path);
- virtual void any_object::OnLeavingDirectory(/*any_object data, */char * path);
+ virtual bool any_object::OnObject(/*any_object data, */const char * name, const char * path, FileStats stats, bool isRootObject);
+ virtual void any_object::OnEnteringDirectory(/*any_object data, */const char * path);
+ virtual void any_object::OnLeavingDirectory(/*any_object data, */const char * path);
private:
}
// TODO: implement threaded iteration somehow....
private:
}
// TODO: implement threaded iteration somehow....
static class IteratorThread : Thread
{
void Temp()
{
static class IteratorThread : Thread
{
void Temp()
{
- //listing = FileListing { dir, extensions = filter.extensions }; // there should be a sorted = true/false
+ //listing = FileListing { dir, extensions = filter.extensions }; // there should be a sorted = true/false
int tag;
char path[MAX_LOCATION];
FileListing listing;
int tag;
char path[MAX_LOCATION];
FileListing listing;
bool branched;
//DataRow result;
//DataRow browse;
bool branched;
//DataRow result;
//DataRow browse;
- virtual bool Window::NotifyUpdateSearchLocation(FileSystemSearch search, char * location);
+ virtual bool Window::NotifyUpdateSearchLocation(FileSystemSearch search, const char * location);
virtual bool Window::NotifySearchSortResults(FileSystemSearch search);
virtual bool Window::NotifySearchSortBrowser(FileSystemSearch search);
virtual bool Window::NotifySearchTerminated(FileSystemSearch search);
virtual bool Window::NotifySearchSortResults(FileSystemSearch search);
virtual bool Window::NotifySearchSortBrowser(FileSystemSearch search);
virtual bool Window::NotifySearchTerminated(FileSystemSearch search);
- bool SearchFileContent(String path)
+ bool SearchFileContent(const String path)
{
bool match = false;
File file = FileOpen(path, read);
{
bool match = false;
File file = FileOpen(path, read);
find = SearchString(buffer, start, contentSearch, optionContentMatchCase, optionContentMatchWord);
// todo add a maximum line length possibility as param
find = SearchString(buffer, start, contentSearch, optionContentMatchCase, optionContentMatchWord);
// todo add a maximum line length possibility as param
- for(bstart = start;
- bstart < readCount && newLine && (!find || newLine < find);
+ for(bstart = start;
+ bstart < readCount && newLine && (!find || newLine < find);
bstart += (newLine - &buffer[bstart]) / sizeof(char))
{
newLine = strstr(&buffer[bstart], "\n");
bstart += (newLine - &buffer[bstart]) / sizeof(char))
{
newLine = strstr(&buffer[bstart], "\n");
find = SearchString(buffer, start, contentSearch, optionContentMatchCase, optionContentMatchWord);
file.Seek(seekBack, current);
}
find = SearchString(buffer, start, contentSearch, optionContentMatchCase, optionContentMatchWord);
file.Seek(seekBack, current);
}
}
delete file;
}
return match;
}
}
delete file;
}
return match;
}
-
- // I wonder if this is optimized at the c level to be compiled inline
+
+ // I wonder if this is optimized at the c level to be compiled inline
// and to use in-place in-stack memory for both the return value and the parameters
// if not, c should be more optimized...
// would the const have any impact on optimization?
// and to use in-place in-stack memory for both the return value and the parameters
// if not, c should be more optimized...
// would the const have any impact on optimization?
// \\Nateus\data\ is not remote, etc...
// How to?
FileStats stats;
// \\Nateus\data\ is not remote, etc...
// How to?
FileStats stats;
terminate = false;
count = 0;
matchCount = 0;
terminate = false;
count = 0;
matchCount = 0;
hasNameSearch = (strlen(nameSearch) != 0);
hasSizeSearch = false; // this is temporary
hasContentSearch = (strlen(contentSearch) != 0);
listLines = true;
lines = OldList { };
hasNameSearch = (strlen(nameSearch) != 0);
hasSizeSearch = false; // this is temporary
hasContentSearch = (strlen(contentSearch) != 0);
listLines = true;
lines = OldList { };
//SearchDir(location);
FileGetStats(location, stats);
strcpy(stack[0].path, location);
//SearchDir(location);
FileGetStats(location, stats);
strcpy(stack[0].path, location);
- stack[0].listing = FileListing { stack[0].path }; // there should be a sorted = true/false
+ stack[0].listing = FileListing { stack[0].path }; // there should be a sorted = true/false
//fsb.list.Clear();
// Binary Search sorting...
//fsb.list.Clear();
// Binary Search sorting...
for(frame = 0; frame >= 0 && !terminate; )
{
guiApp.Lock();
for(frame = 0; frame >= 0 && !terminate; )
{
guiApp.Lock();
if(stack[frame].listing.Find())
{
count++;
if(stack[frame].listing.Find())
{
count++;
//match = (strcmp(stack[frame].listing.name, nameSearch) == 0);
//match = (stack[frame].listing.name[0] == nameSearch[0]);
//match = (bool)strstr(stack[frame].listing.name, nameSearch);
//match = (strcmp(stack[frame].listing.name, nameSearch) == 0);
//match = (stack[frame].listing.name[0] == nameSearch[0]);
//match = (bool)strstr(stack[frame].listing.name, nameSearch);
- match = (bool)SearchString(stack[frame].listing.name, 0, nameSearch, optionNameMatchCase, optionNameMatchWord);
+ match = SearchString(stack[frame].listing.name, 0, nameSearch, optionNameMatchCase, optionNameMatchWord) != null;