]> git.sesse.net Git - vlc/commitdiff
Qt: preferences, fix conflict detection.
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 16 Nov 2011 21:43:58 +0000 (22:43 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 16 Nov 2011 21:43:58 +0000 (22:43 +0100)
Should close #3823 and #5052

modules/gui/qt4/components/preferences_widgets.cpp

index f26faf3a8ef919e8a5821a757a02238ab99541c9..f9cf579c1f2c95248ec7c060388e1fb223754d3a 100644 (file)
@@ -1545,16 +1545,16 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
 
 void KeyInputDialog::checkForConflicts( int i_vlckey )
 {
-     QList<QTreeWidgetItem *> conflictList =
-         table->findItems( VLCKeyToString( i_vlckey ), Qt::MatchExactly,
-                           b_global ? 2 : 1 );
+    QList<QTreeWidgetItem *> conflictList =
+        table->findItems( VLCKeyToString( i_vlckey ), Qt::MatchExactly,
+                          b_global ? 2 : 1 );
 
     if( conflictList.count() &&
-        conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toInt() > 1 )
-        /* Avoid 0 or -1 that are the "Unset" states */
+        !conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString().isEmpty() &&
+         conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString() != "Unset" )
     {
         warning->setText( qtr("Warning: the key is already assigned to \"") +
-                          conflictList[0]->text( 0 ) + "\"" );
+                conflictList[0]->text( 0 ) + "\"" );
         warning->show();
         buttonBox->show();