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

Qt: fix crashes possible in Hotkey settings.

parent 0310df17
...@@ -1248,6 +1248,7 @@ void KeySelectorControl::finish() ...@@ -1248,6 +1248,7 @@ void KeySelectorControl::finish()
void KeySelectorControl::select1Key() void KeySelectorControl::select1Key()
{ {
QTreeWidgetItem *keyItem = table->currentItem(); QTreeWidgetItem *keyItem = table->currentItem();
if( !keyItem ) return;
shortcutValue->setText( keyItem->text( 1 ) ); shortcutValue->setText( keyItem->text( 1 ) );
shortcutValue->setValue( keyItem->data( 1, Qt::UserRole ).toInt() ); shortcutValue->setValue( keyItem->data( 1, Qt::UserRole ).toInt() );
} }
...@@ -1293,6 +1294,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem ) ...@@ -1293,6 +1294,7 @@ void KeySelectorControl::selectKey( QTreeWidgetItem *keyItem )
void KeySelectorControl::setTheKey() void KeySelectorControl::setTheKey()
{ {
if( !table->currentItem() ) return;
table->currentItem()->setText( 1, shortcutValue->text() ); table->currentItem()->setText( 1, shortcutValue->text() );
table->currentItem()->setData( 1, Qt::UserRole, shortcutValue->getValue() ); table->currentItem()->setData( 1, Qt::UserRole, shortcutValue->getValue() );
} }
......
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