Showing with 21 additions and 0 deletions.
  1. +13 −0 src/browser/qgsbrowser.cpp
  2. +1 −0 src/browser/qgsbrowser.h
  3. +7 −0 src/core/qgsbrowsermodel.cpp
13 changes: 13 additions & 0 deletions src/browser/qgsbrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,19 @@ void QgsBrowser::keyPressEvent( QKeyEvent * e )
}
}

void QgsBrowser::keyReleaseEvent( QKeyEvent * e )
{
QgsDebugMsg( "Entered" );
if ( treeView->hasFocus() && ( e->key() == Qt::Key_Up || e->key() == Qt::Key_Down ) )
{
itemClicked( treeView->selectionModel()->currentIndex() );
}
else
{
e->ignore();
}
}

void QgsBrowser::stopRendering()
{
// you might have seen this already in QgisApp
Expand Down
1 change: 1 addition & 0 deletions src/browser/qgsbrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class QgsBrowser : public QMainWindow, private Ui::QgsBrowserBase

protected:
void keyPressEvent( QKeyEvent * e );
void keyReleaseEvent( QKeyEvent * e );

bool layerClicked( QgsLayerItem* ptr );

Expand Down
7 changes: 7 additions & 0 deletions src/core/qgsbrowsermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ void QgsBrowserModel::addRootItems()
mRootItems << item;
}

#ifdef Q_WS_MAC
QString path = QString( "/Volumes" );
QgsDirectoryItem *vols = new QgsDirectoryItem( NULL, path, path );
connectItem( vols );
mRootItems << vols;
#endif

// Add non file top level items
QStringList providersList = QgsProviderRegistry::instance()->providerList();
providersList.sort();
Expand Down