4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-14 11:29:33 +00:00

server mechlist combining and provider selection

svn path=/trunk/kdesupport/qca/; revision=837810
This commit is contained in:
Justin Karneges 2008-07-25 19:18:11 +00:00
parent bb94d89a93
commit 4c65063212

@ -2147,15 +2147,42 @@ private slots:
private:
QStringList combine_mechlists()
{
// TODO
return saslProviders[0].mechlist;
QStringList out;
// FIXME: consider prioritizing certain mechs?
foreach(const SaslProvider &sp, saslProviders)
{
foreach(const QString &mech, sp.mechlist)
{
if(!out.contains(mech))
out += mech;
}
}
return out;
}
int choose_provider(const QString &mech)
{
// TODO
Q_UNUSED(mech);
return 0;
int at = -1;
// find a provider for this mech
for(int n = 0; n < saslProviders.count(); ++n)
{
const SaslProvider &sp = saslProviders[n];
if(sp.mechlist.contains(mech))
{
at = n;
break;
}
}
// no provider offered this mech? then just go with the
// first provider
if(at == -1)
at = 0;
return at;
}
};