Skip to content
Permalink
Browse files

Move change data source under filter

  • Loading branch information
elpaso committed Nov 8, 2018
1 parent c74ce88 commit ba4981a1f4d36f19513c3178fe1930fd820f0daf
@@ -199,26 +199,6 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()

menu->addSeparator();

// change data source is only supported for vectors and rasters
if ( ( vlayer || rlayer ) )
{

QAction *a = new QAction( tr( "Change data source…" ), menu );
if ( layer->isEditable() )
{
a->setEnabled( false );
}
else
{
connect( a, &QAction::triggered, [ = ]
{
QgisApp::instance()->changeDataSource( layer );
} );
}
menu->addAction( a );
// Disable when layer is editable
}

if ( vlayer )
{
QAction *toggleEditingAction = QgisApp::instance()->actionToggleEditing();
@@ -259,6 +239,26 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
}
}

// change data source is only supported for vectors and rasters
if ( vlayer || rlayer )
{

QAction *a = new QAction( tr( "Change data source…" ), menu );
// Disable when layer is editable
if ( layer->isEditable() )
{
a->setEnabled( false );
}
else
{
connect( a, &QAction::triggered, [ = ]
{
QgisApp::instance()->changeDataSource( layer );
} );
}
menu->addAction( a );
}

menu->addSeparator();

if ( layer && layer->isSpatial() )
Binary file not shown.

0 comments on commit ba4981a

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