From kde-commits Mon Sep 14 09:05:33 2009 From: George Goldberg Date: Mon, 14 Sep 2009 09:05:33 +0000 To: kde-commits Subject: playground/network/telepathy-accounts-kcm-plugins/gabble Message-Id: <1252919133.618867.1986.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125291914101705 SVN commit 1023215 by gberg: Use new validation support on int and uint entry fields. M +21 -0 proxy-settings-widget.cpp M +14 -0 server-settings-widget.cpp --- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/proxy-settings-widget.cpp #1023214:1023215 @@ -312,6 +312,27 @@ { kDebug(); + // Validate all the int's and uint's. + if (d->ui->stunPortLineEdit->validity() != QValidator::Acceptable) { + KMessageBox::error(this, + i18n("\"%1\" is not an acceptable value for %2") + .arg(d->ui->stunPortLineEdit->text()) + .arg(d->ui->stunPortLabel->text())); + return false; + } else if (d->ui->fallbackStunPortLineEdit->validity() != QValidator::Acceptable) { + KMessageBox::error(this, + i18n("\"%1\" is not an acceptable value for %2") + .arg(d->ui->fallbackStunPortLineEdit->text()) + .arg(d->ui->fallbackStunPortLabel->text())); + return false; + } else if (d->ui->httpsProxyPortLineEdit->validity() != QValidator::Acceptable) { + KMessageBox::error(this, + i18n("\"%1\" is not an acceptable value for %2") + .arg(d->ui->httpsProxyPortLineEdit->text()) + .arg(d->ui->httpsProxyPortLabel->text())); + return false; + } + return true; } --- trunk/playground/network/telepathy-accounts-kcm-plugins/gabble/server-settings-widget.cpp #1023214:1023215 @@ -264,6 +264,20 @@ { kDebug(); + if (d->ui->portLineEdit->validity() != QValidator::Acceptable) { + KMessageBox::error(this, + i18n("\"%1\" is not an acceptable value for %2") + .arg(d->ui->portLineEdit->text()) + .arg(d->ui->portLabel->text())); + return false; + } else if (d->ui->keepaliveIntervalLineEdit->validity() != QValidator::Acceptable) { + KMessageBox::error(this, + i18n("\"%1\" is not an acceptable value for %2") + .arg(d->ui->keepaliveIntervalLineEdit->text()) + .arg(d->ui->keepaliveIntervalLabel->text())); + return false; + } + return true; }