Skip to content
Permalink
Browse files
browser favourites fix
  • Loading branch information
blazek committed Nov 20, 2014
1 parent 869ad44 commit 47578074262a2757db914425ccbb92a296d37646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
@@ -333,7 +333,7 @@ void QgsBrowserDockWidget::showContextMenu( const QPoint & pt )
{
QSettings settings;
QStringList favDirs = settings.value( "/browser/favourites" ).toStringList();
bool inFavDirs = favDirs.contains( item->path() );
bool inFavDirs = item->parent() && item->parent()->type() == QgsDataItem::Favourites;

if ( item->parent() && !inFavDirs )
{
@@ -388,10 +388,11 @@ void QgsBrowserDockWidget::addFavourite()
if ( !item )
return;

if ( item->type() != QgsDataItem::Directory )
QgsDirectoryItem * dirItem = dynamic_cast<QgsDirectoryItem *>( item );
if ( !dirItem )
return;

addFavouriteDirectory( item->path() );
addFavouriteDirectory( dirItem->dirPath() );
}

void QgsBrowserDockWidget::addFavouriteDirectory()
@@ -271,6 +271,7 @@ class CORE_EXPORT QgsDirectoryItem : public QgsDataCollectionItem

QVector<QgsDataItem*> createChildren();

QString dirPath() const { return mDirPath; }
virtual bool equal( const QgsDataItem *other );
virtual QIcon icon();
virtual QWidget *paramWidget();

0 comments on commit 4757807

Please sign in to comment.