Skip to content

Commit

Permalink
[GRASS] disable drop to mapsets not owned
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Oct 20, 2015
1 parent 295d64b commit 261df82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/providers/grass/qgsgrassprovidermodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,10 @@ bool QgsGrassMapsetItem::objectInImports( QgsGrassObject grassObject )
}
if ( import->names().contains( grassObject.name() ) )
{
return true;
return true; if ( !QgsGrass::isOwner( mGrassObject.gisdbase(), mGrassObject.location(), mGrassObject.mapset() ) )
{
return false;
}
}
}
return false;
Expand Down Expand Up @@ -603,6 +606,11 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
return items;
}

bool QgsGrassMapsetItem::acceptDrop()
{
return QgsGrass::isOwner( mGrassObject.gisdbase(), mGrassObject.location(), mGrassObject.mapset() );
}

bool QgsGrassMapsetItem::handleDrop( const QMimeData * data, Qt::DropAction )
{
if ( !QgsMimeDataUtils::isUriList( data ) )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassprovidermodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class QgsGrassMapsetItem : public QgsDirectoryItem, public QgsGrassObjectItemBas

QVector<QgsDataItem*> createChildren() override;
virtual QList<QAction*> actions() override { return mActions->actions(); }
virtual bool acceptDrop() override { return true; }
virtual bool acceptDrop() override;
virtual bool handleDrop( const QMimeData * data, Qt::DropAction action ) override;

public slots:
Expand Down

0 comments on commit 261df82

Please sign in to comment.