Ecere Software
/
ede
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
24b8682
)
explorer: better internal GoToLocation code.
author
Rejean Loyer
<rejean.loyer@gmail.com>
Fri, 16 Sep 2011 12:52:52 +0000
(08:52 -0400)
committer
Rejean Loyer
<rejean.loyer@gmail.com>
Fri, 16 Sep 2011 12:52:52 +0000
(08:52 -0400)
explorer/src/ExplorerWindow.ec
patch
|
blob
|
history
diff --git
a/explorer/src/ExplorerWindow.ec
b/explorer/src/ExplorerWindow.ec
index
a2968e9
..
c557372
100644
(file)
--- a/
explorer/src/ExplorerWindow.ec
+++ b/
explorer/src/ExplorerWindow.ec
@@
-129,7
+129,7
@@
class ExplorerWindow : Window
{
char * home = getenv("HOME");
if(home && home[0] && FileExists(home).isDirectory)
{
char * home = getenv("HOME");
if(home && home[0] && FileExists(home).isDirectory)
-
view.path = home
;
+
GoToLocation(home, false, false)
;
break;
}
case goUp:
break;
}
case goUp:
@@
-142,7
+142,7
@@
class ExplorerWindow : Window
newPath[0] = '/';
newPath[1] = 0;
}
newPath[0] = '/';
newPath[1] = 0;
}
-
view.path = newPath
;
+
GoToLocation(newPath, false, false)
;
delete newPath;
break;
}
delete newPath;
break;
}
@@
-234,7
+234,7
@@
class ExplorerWindow : Window
bool NotifyModified(PathBox pathBox)
{
bool NotifyModified(PathBox pathBox)
{
-
view.path = pathBox.path
;
+
GoToLocation(pathBox.path, false, false)
;
return true;
}
};
return true;
}
};
@@
-326,7
+326,7
@@
class ExplorerWindow : Window
{
char p[MAX_LOCATION];
node.GetPath(p);
{
char p[MAX_LOCATION];
node.GetPath(p);
-
view.path = node.path
;
+
GoToLocation(node.path, false, true)
;
return true;
}
};
return true;
}
};
@@
-472,34
+472,13
@@
class ExplorerWindow : Window
lastViewId = viewId;
}*/
lastViewId = viewId;
}*/
-
/*void GoToLocation(char * l
ocation)
+
void GoToLocation(char * location, bool viewIsAtLocation, bool treeIsAtL
ocation)
{
{
- int c;
- char * temp;
- char step[MAX_LOCATION];
-
- StringArray steps { growingFactor = 4 };
- ExplorerFileBranch last = null;
-
- temp = CopyString(location);
- while(strlen(temp))
- {
- GetLastDirectory(temp, step);
- StripLastDirectory(temp, temp);
- steps.Add(CopyString(step));
- }
-
- for(c = steps._count - 1; c >= 0; c--)
- {
- last = tree.Find(steps._[c], last);
- if(!last)
- break;
- tree.Select(last);
- }
-
- delete temp;
- delete steps;
- }*/
+ if(!viewIsAtLocation)
+ view.path = location;
+ if(tree.visible && !treeIsAtLocation)
+ tree.SelectLocation(location);
+ }
/*void SearchLocation(char * location)
{
/*void SearchLocation(char * location)
{