Skip to content

Commit

Permalink
Toggle bool variable
Browse files Browse the repository at this point in the history
  • Loading branch information
uclaros authored and nyalldawson committed Aug 5, 2021
1 parent 974c55e commit baa9062
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -10963,12 +10963,13 @@ void QgisApp::toggleEditing()
const QList<QgsMapLayer *> layerList = layerTreeView()->selectedLayers();
if ( !layerList.isEmpty() )
{
// if there are selected layers, try to toggle those
const bool shouldStartEditing = !mActionToggleEditing->isChecked();
// if there are selected layers, try to toggle those.
// mActionToggleEditing has already been triggered at this point so its checked status has changed
const bool shouldStartEditing = mActionToggleEditing->isChecked();
for ( const auto layer : layerList )
{
if ( layer->supportsEditing() &&
shouldStartEditing == layer->isEditable() )
shouldStartEditing != layer->isEditable() )
{
toggleEditing( layer, true );
}
Expand Down

0 comments on commit baa9062

Please sign in to comment.