Commit 7da4978b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement job

parent 10276732
Pipeline #41899 canceled with stage
......@@ -28,15 +28,21 @@ LdapClientSearchConfigReadConfigJob::~LdapClientSearchConfigReadConfigJob()
bool LdapClientSearchConfigReadConfigJob::canStart() const
{
return true;
//TODO check mConfig too
return mServerIndex != -1;
}
void LdapClientSearchConfigReadConfigJob::searchLdapClientConfigFinished()
{
Q_EMIT configLoaded(mServer);
deleteLater();
}
void LdapClientSearchConfigReadConfigJob::start()
{
if (!canStart()) {
//Failed !
Q_EMIT configLoaded(mServer);
deleteLater();
searchLdapClientConfigFinished();
return;
}
readConfig();
......@@ -171,6 +177,5 @@ void LdapClientSearchConfigReadConfigJob::readConfig()
mServer.setMech(mConfig.readEntry(prefix + QStringLiteral("Mech%1").arg(mServerIndex), QString()));
mServer.setFilter(mConfig.readEntry(prefix + QStringLiteral("UserFilter%1").arg(mServerIndex), QString()));
mServer.setCompletionWeight(mConfig.readEntry(prefix + QStringLiteral("CompletionWeight%1").arg(mServerIndex), -1));
Q_EMIT configLoaded(mServer);
deleteLater();
searchLdapClientConfigFinished();
}
......@@ -34,6 +34,7 @@ Q_SIGNALS:
void configLoaded(const KLDAP::LdapServer &server);
private:
void searchLdapClientConfigFinished();
void readConfig();
int mServerIndex = -1;
KConfigGroup mConfig;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment