Commit dbedf8d4 authored by Robert Knight's avatar Robert Knight
Browse files

Fix setting of key binding description /doh. Fix crash in key binding editor...

Fix setting of key binding description /doh.  Fix crash in key binding editor if used without setting it up with an existing translator.  Fixes crash in translator list if it is empty.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=677187
parent a37ed321
......@@ -640,7 +640,9 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
KeyBindingEditor* editor = new KeyBindingEditor;
dialog->setMainWidget(editor);
editor->setup(translator);
if ( translator )
editor->setup(translator);
if ( isNewTranslator )
editor->setDescription(i18n("New Key Binding List"));
......@@ -652,7 +654,9 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
if ( isNewTranslator )
newTranslator->setName(newTranslator->description());
qDebug() << "Adding new or modified translator to manager";
qDebug() << "Adding new or modified translator to manager" <<
newTranslator->name() << ", " << newTranslator->description();
KeyboardTranslatorManager::instance()->addTranslator( newTranslator );
updateKeyBindingsList();
......
......@@ -32,7 +32,7 @@ using namespace Konsole;
KeyBindingEditor::KeyBindingEditor(QWidget* parent)
: QWidget(parent)
, _translator(0)
, _translator(new KeyboardTranslator( QString() ))
{
_ui = new Ui::KeyBindingEditor();
_ui->setupUi(this);
......@@ -146,13 +146,10 @@ bool KeyBindingEditor::eventFilter( QObject* watched , QEvent* event )
void KeyBindingEditor::setDescription(const QString& newDescription)
{
if ( description() != newDescription )
{
_ui->descriptionEdit->setText(newDescription);
if ( _translator )
_translator->setDescription(newDescription);
}
_ui->descriptionEdit->setText(newDescription);
if ( _translator )
_translator->setDescription(newDescription);
}
QString KeyBindingEditor::description() const
{
......
Supports Markdown
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