SVN commit 1156780 by gberg: Hack around the password-now-optional change in gabble - this will be fixed properly when I finish my refactoring branch of the kcm M +21 -4 add-account-assistant.cpp M +4 -0 edit-account-dialog.cpp --- trunk/playground/network/telepathy-accounts-kcm/src/add-account-assistant.cpp #1156779:1156780 @@ -148,6 +148,27 @@ Tp::ProtocolParameterList mandatoryParameters = item->mandatoryParameters(); Tp::ProtocolParameterList mandatoryParametersLeft = item->mandatoryParameters(); + // Get the list of optional parameters for later + Tp::ProtocolParameterList optionalParameters = item->optionalParameters(); + Tp::ProtocolParameterList optionalParametersLeft = item->optionalParameters(); + + // HACK: Hack round gabble making password optional (FIXME once we sort out the plugin system) + Tp::ProtocolParameter *passwordParameter = 0; + + foreach (Tp::ProtocolParameter *oP, optionalParameters) { + if (oP->name() == "password") { + passwordParameter = oP; + } + } + + // If the password parameter is optional, add it to the mandatory lot for now instead. + optionalParameters.removeAll(passwordParameter); + optionalParametersLeft.removeAll(passwordParameter); + mandatoryParameters.append(passwordParameter); + mandatoryParametersLeft.append(passwordParameter); + + // HACK ends + // Create the custom UI or generic UI depending on available parameters. if (ui) { // UI does exist, set it up. @@ -188,10 +209,6 @@ else d->tabWidget->addTab(d->mandatoryParametersWidget, d->mandatoryPageDesc); - // Get the list of parameters - Tp::ProtocolParameterList optionalParameters = item->optionalParameters(); - Tp::ProtocolParameterList optionalParametersLeft = item->optionalParameters(); - int pageIndex = 0; // Check if the AbstractAccountUi exists. If not then we use the autogenerated UI for --- trunk/playground/network/telepathy-accounts-kcm/src/edit-account-dialog.cpp #1156779:1156780 @@ -224,6 +224,10 @@ foreach (Tp::ProtocolParameter *parameter, protocolParameters) { if (parameter->isRequired()) { d->mandatoryProtocolParameters.append(parameter); + // HACK Work around the password now optional in gabble issue + } else if (parameter->name() == "password") { + d->mandatoryProtocolParameters.append(parameter); + // HACK ends } else { d->optionalProtocolParameters.append(parameter); }