don't try to find the given file in the browser dialog if it doesn't exist.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14249 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2007-08-08 23:23:28 +00:00
parent f3498db0d4
commit 0fc30fbea5

View file

@ -40,10 +40,10 @@ void BrowseDirtree::setDir(QDir &dir)
{
qDebug() << "BrowseDirtree::setDir()" << model.index(dir.absolutePath());
// do not try to hilight directory if it's not valid.
if(!dir.exists()) return;
// hilight the set directory if it's valid
if(model.index(dir.absolutePath()).isValid()) {
model.index(dir.absolutePath()).parent();
QModelIndex p = model.index(dir.absolutePath());
ui.tree->setCurrentIndex(p);
ui.tree->scrollTo(p);