[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kcontrol/keyboard
From:       Andriy Rysin <arysin () gmail ! com>
Date:       2010-08-31 2:31:02
Message-ID: 20100831023102.13966AC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1170193 by rysin:

Don't crash if we can't find the xkb option info
BUG: 244913


 M  +8 -1      kcm_keyboard_widget.cpp  


--- trunk/KDE/kdebase/workspace/kcontrol/keyboard/kcm_keyboard_widget.cpp #1170192:1170193
@@ -481,10 +481,17 @@
 		button->setText(i18nc("no shortcuts defined", "None"));
 	break;
 	case 1: {
+		const QString& option = grpOptions.first();
 		const OptionGroupInfo* optionGroupInfo = rules->getOptionGroupInfo(groupName);
-		const OptionInfo* optionInfo = optionGroupInfo->getOptionInfo(grpOptions.first());
+		const OptionInfo* optionInfo = optionGroupInfo->getOptionInfo(option);
+		if( optionInfo == NULL || optionInfo->description == NULL ) {
+			kError() << "Could not find option info for " << option;
+			button->setText(grpOptions.first());
+		}
+		else {
 		button->setText(optionInfo->description);
 	}
+	}
 	break;
 	default:
 		button->setText(i18np("%1 shortcut", "%1 shortcuts", grpOptions.size()));
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic