if(oldid == currentId) {
select = true;
currentId = 0;
+ ui.networkList->clearSelection();
}
int row = ui.networkList->row(i);
if(row >= 0) {
- qDebug() << "ABOUT TO REMOVE: id=" << oldid << "from row" << row;
QListWidgetItem *olditem = ui.networkList->takeItem(row);
- qDebug() << "Successfully removed item from list.";
- if(!olditem) {
- qWarning() << "NetworksSettingsPage::setItemState(): Why the heck don't we have an itempointer here?";
- Q_ASSERT(olditem); // abort non-gracefully, I need to figure out what's causing this
- }
- else delete olditem;
+ Q_ASSERT(olditem);
+ delete olditem;
}
networkInfos.remove(oldid);
break;
foreach(QVariant v, info.serverList) {
ui.serverList->addItem(QString("%1:%2").arg(v.toMap()["Host"].toString()).arg(v.toMap()["Port"].toUInt()));
}
- setItemState(id);
+ //setItemState(id);
ui.randomServer->setChecked(info.useRandomServer);
ui.performEdit->setPlainText(info.perform.join("\n"));
ui.autoIdentify->setChecked(info.useAutoIdentify);
QVariant ServerEditDlg::serverData() const {
QVariantMap _serverData;
- _serverData["Host"] = ui.host->text();
+ _serverData["Host"] = ui.host->text().trimmed();
_serverData["Port"] = ui.port->value();
_serverData["Password"] = ui.password->text();
_serverData["UseSSL"] = ui.useSSL->isChecked();
}
void ServerEditDlg::on_host_textChanged() {
- ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(ui.host->text().isEmpty());
+ ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(ui.host->text().trimmed().isEmpty());
}
/**************************************************************************