Commit ae8b4b81 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: preferences, fix conflict detection.

Should close #3823 and #5052
parent b009862b
...@@ -1545,16 +1545,16 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table, ...@@ -1545,16 +1545,16 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
void KeyInputDialog::checkForConflicts( int i_vlckey ) void KeyInputDialog::checkForConflicts( int i_vlckey )
{ {
QList<QTreeWidgetItem *> conflictList = QList<QTreeWidgetItem *> conflictList =
table->findItems( VLCKeyToString( i_vlckey ), Qt::MatchExactly, table->findItems( VLCKeyToString( i_vlckey ), Qt::MatchExactly,
b_global ? 2 : 1 ); b_global ? 2 : 1 );
if( conflictList.count() && if( conflictList.count() &&
conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toInt() > 1 ) !conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString().isEmpty() &&
/* Avoid 0 or -1 that are the "Unset" states */ conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString() != "Unset" )
{ {
warning->setText( qtr("Warning: the key is already assigned to \"") + warning->setText( qtr("Warning: the key is already assigned to \"") +
conflictList[0]->text( 0 ) + "\"" ); conflictList[0]->text( 0 ) + "\"" );
warning->show(); warning->show();
buttonBox->show(); buttonBox->show();
......
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