Resurrecting the title and tooltip of FolderNavigationWidget

This commit is contained in:
Robert Loehning
2010-04-21 13:42:36 +02:00
parent fa2d2717a9
commit ec688e5c62

View File

@@ -224,8 +224,13 @@ bool FolderNavigationWidget::setCurrentDirectory(const QString &directory)
// Set the root path on the model instead of changing the top index
// of the view to cause the model to clean out its file watchers.
const QModelIndex index = m_fileSystemModel->setRootPath(newDirectory);
QTC_ASSERT(index.isValid(), return false)
if (!index.isValid()) {
setCurrentTitle(QString(), QString());
return false;
}
m_listView->setRootIndex(m_filterModel->mapFromSource(index));
const QDir current(QDir::cleanPath(newDirectory));
setCurrentTitle(current.dirName(), current.absolutePath());
return !directory.isEmpty();
}