Skip to content

Commit

Permalink
std::tie is not equal to the unpack operator []
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb authored and JorisGoosen committed Nov 15, 2024
1 parent b9879fd commit 71a7a07
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions QMLComponents/models/listmodellayersassigned.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ Terms ListModelLayersAssigned::addTerms(const Terms& terms, int dropItemIndex, c

beginResetModel();

int layer = _variablesPerLayer.length();
int indexInLayer = 0;
if (dropItemIndex >= 0)
auto [layer, indexInLayer] = _getLayer(dropItemIndex, true);
auto [layer, indexInLayer] = (dropItemIndex >= 0) ? _getLayer(dropItemIndex, true) : std::make_pair(int(_variablesPerLayer.length()), 0);

if (layer >= _variablesPerLayer.length())
{
Expand All @@ -133,10 +130,7 @@ void ListModelLayersAssigned::moveTerms(const QList<int> &indexes, int dropItemI
{
beginResetModel();

int layerDrop = _variablesPerLayer.length();
int indexInLayerDrop = 0;
if (dropItemIndex >= 0)
auto [layerDrop, indexInLayerDrop] = _getLayer(dropItemIndex, true);
auto [layerDrop, indexInLayerDrop] = (dropItemIndex >= 0) ? _getLayer(dropItemIndex, true): std::make_pair(int(_variablesPerLayer.length()), 0);

if (layerDrop >= _variablesPerLayer.length())
{
Expand Down

0 comments on commit 71a7a07

Please sign in to comment.