[vlc-devel] [PATCH] gui/qt: AddonsListModel::flags: fix disabling of addon
Filip Roséen
filip at atch.se
Sun May 21 20:50:04 CEST 2017
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.
---
modules/gui/qt/dialogs/plugins.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/modules/gui/qt/dialogs/plugins.cpp b/modules/gui/qt/dialogs/plugins.cpp
index ab81ecef0e..c1d7463a20 100644
--- a/modules/gui/qt/dialogs/plugins.cpp
+++ b/modules/gui/qt/dialogs/plugins.cpp
@@ -908,9 +908,7 @@ Qt::ItemFlags AddonsListModel::flags( const QModelIndex &index ) const
int i_state = data( index, StateRole ).toInt();
if ( i_state == ADDON_UNINSTALLING || i_state == ADDON_INSTALLING )
- {
- i_flags &= !Qt::ItemIsEnabled;
- }
+ i_flags &= ~Qt::ItemIsEnabled;
i_flags |= Qt::ItemIsEditable;
--
2.13.0
More information about the vlc-devel
mailing list