[vlc-commits] gui/qt: AddonsListModel::flags: fix disabling of addon

Filip Roséen git at videolan.org
Sun May 21 21:25:03 CEST 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Sun May 21 20:50:04 2017 +0200| [911f67ecfdf89d89829a7380510db59df74d3f32] | committer: Rémi Denis-Courmont

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 <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=911f67ecfdf89d89829a7380510db59df74d3f32
---

 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;
 



More information about the vlc-commits mailing list