Skip to content
Permalink
Browse files

[GRASS] disable drop to mapsets not owned

  • Loading branch information
blazek committed Oct 20, 2015
1 parent 295d64b commit 261df826e0fb83cfa9b9db49dab6f1b022463305
Showing with 10 additions and 2 deletions.
  1. +9 −1 src/providers/grass/qgsgrassprovidermodule.cpp
  2. +1 −1 src/providers/grass/qgsgrassprovidermodule.h
@@ -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;
@@ -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 ) )
@@ -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:

0 comments on commit 261df82

Please sign in to comment.
You can’t perform that action at this time.