Commit 911f67ec authored by Filip Roséen's avatar Filip Roséen Committed by Rémi Denis-Courmont
Browse files

gui/qt: AddonsListModel::flags: fix disabling of addon



In the affected path we would like to toggle so that the addon is in a
state where it is not enabled by removing that flag (if present), we
would however remove all flags of the addon as the right-hand side
expression will always evaluate to 0.

This fixes the issue by proper use of bitwise negate.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent b8d9372b
...@@ -908,9 +908,7 @@ Qt::ItemFlags AddonsListModel::flags( const QModelIndex &index ) const ...@@ -908,9 +908,7 @@ Qt::ItemFlags AddonsListModel::flags( const QModelIndex &index ) const
int i_state = data( index, StateRole ).toInt(); int i_state = data( index, StateRole ).toInt();
if ( i_state == ADDON_UNINSTALLING || i_state == ADDON_INSTALLING ) if ( i_state == ADDON_UNINSTALLING || i_state == ADDON_INSTALLING )
{ i_flags &= ~Qt::ItemIsEnabled;
i_flags &= !Qt::ItemIsEnabled;
}
i_flags |= Qt::ItemIsEditable; i_flags |= Qt::ItemIsEditable;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment