[Kde-games-devel] Krazy Issues

Frederik Schwarzer schwarzerf at gmail.com
Mon Dec 8 19:32:32 CET 2008


On Monday 08 December 2008 18:47:29 Matthew Woehlke wrote:

Hi,

> Also, in kgame/dialogs/kgamedialogconfig.cpp, why only replace QLineEdit 
> with KLineEdit? Maybe it would be better to do as the TODO suggests and 
> use KIntNumInput instead?

Ok, I looked at it with the following outcome:

@@ -451,15 +451,11 @@
  l->setSpacing( KDialog::spacingHint() );

  l->addWidget(new QLabel(i18n("Maximal number of clients (-1 = infinite):"), dialog));
- QLineEdit* edit = new QLineEdit(dialog);//TODO: use KIntNumInput
+ KIntNumInput* edit = new KIntNumInput(dialog);
  l->addWidget(edit);
 // edit->setText(QString::number(max)); // current max clients! //TODO
  if (dialog->exec() == QDialog::Accepted) {
-       bool ok;
-       max = edit->text().toInt(&ok);
-       if (ok) {
-               game()->setMaxClients(max);
-       }
+       game()->setMaxClients(edit->value());
  }


Unfortunately this dialog is not used at the moment so I cannot check it.
However, does not look harmful, does it?

Regards


More information about the kde-games-devel mailing list