Skip to content
Permalink
Browse files

Add a right click action to edit virtual layer settings

  • Loading branch information
Hugo Mercier
Hugo Mercier committed Mar 23, 2016
1 parent ee81c6b commit d87c3813e26158d73b8668b5b2578a30b1638f4a
@@ -249,6 +249,11 @@ QMenu* QgsAppLayerTreeViewMenuProvider::createContextMenu()

if ( mView->selectedNodes( true ).count() >= 2 )
menu->addAction( actions->actionGroupSelected( menu ) );

if ( layer && layer->type() == QgsMapLayer::VectorLayer && static_cast<QgsVectorLayer*>( layer )->providerType() == "virtual" )
{
menu->addAction( tr( "Edit virtual layer settings" ), QgisApp::instance(), SLOT( addVirtualLayer() ) );
}
}

}
@@ -237,7 +237,7 @@ bool QgsVirtualLayerProvider::createIt()
continue;

const QgsVectorLayer* vl = static_cast<const QgsVectorLayer*>( l );
if (( vl->name() == tname ) || ( vl->id() == tname ) )
if ( ( vl->name() == tname ) || ( vl->name().toLower() == tname.toLower() ) || ( vl->id() == tname ) )
{
mDefinition.addSource( tname, vl->id() );
found = true;

0 comments on commit d87c381

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