{
char * home = getenv("HOME");
if(home && home[0] && FileExists(home).isDirectory)
- view.path = home;
+ GoToLocation(home, false, false);
break;
}
case goUp:
newPath[0] = '/';
newPath[1] = 0;
}
- view.path = newPath;
+ GoToLocation(newPath, false, false);
delete newPath;
break;
}
bool NotifyModified(PathBox pathBox)
{
- view.path = pathBox.path;
+ GoToLocation(pathBox.path, false, false);
return true;
}
};
{
char p[MAX_LOCATION];
node.GetPath(p);
- view.path = node.path;
+ GoToLocation(node.path, false, true);
return true;
}
};
lastViewId = viewId;
}*/
- /*void GoToLocation(char * location)
+ void GoToLocation(char * location, bool viewIsAtLocation, bool treeIsAtLocation)
{
- 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)
{