Skip to content

Commit

Permalink
bugfix: move pin to group action was rejected if only 1 pin in target…
Browse files Browse the repository at this point in the history
… group
  • Loading branch information
joern274 committed Jun 5, 2023
1 parent 99e1256 commit 591d2d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ namespace hal
class Grouping;
class Searchbar;
class SelectionTreeView;
class ModuleDetailsWidget;
class GateDetailsWidget;
class NetDetailsWidget;
class UserAction;
class UserActionObject;
class SettingsItemCheckbox;
Expand Down Expand Up @@ -344,9 +341,6 @@ namespace hal

QStackedWidget* mStackedWidget;

GateDetailsWidget* mGateDetails;
NetDetailsWidget* mNetDetails;
ModuleDetailsWidget* mModuleDetails;
QLabel* mItemDeletedLabel;
QLabel* mNoSelectionLabel;

Expand Down
13 changes: 8 additions & 5 deletions plugins/gui/src/user_action/action_reorder_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ namespace hal
return false;
}
auto pinGroup = pin->get_group().first;
if (pinGroup && pinGroup->size() > 1)
if (pinGroup)
{
oldIndex = pin->get_group().second;
auto result = mod->move_pin_within_group(pinGroup, pin, mNewIndex);
if (result.is_error())
if (pinGroup->size() > 1)
{
return false;
oldIndex = pin->get_group().second;
auto result = mod->move_pin_within_group(pinGroup, pin, mNewIndex);
if (result.is_error())
{
return false;
}
}
}
else
Expand Down

0 comments on commit 591d2d1

Please sign in to comment.