Commit dc980e4f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Reduce duplicate code

parent 5a1a9389
......@@ -55,11 +55,16 @@ void RestoreLdapSettingsJob::restore()
saveLdapSettings(cSelHosts, cHosts);
} else {
Q_EMIT restoreDone();
deleteLater();
restoreSettingsDone();
}
}
void RestoreLdapSettingsJob::restoreSettingsDone()
{
Q_EMIT restoreDone();
deleteLater();
}
void RestoreLdapSettingsJob::saveLdapSettings(int cSelHosts, int cHosts)
{
mConfig->deleteGroup(QStringLiteral("LDAP"));
......@@ -86,8 +91,7 @@ void RestoreLdapSettingsJob::saveLdapSettings(int cSelHosts, int cHosts)
group.writeEntry(QStringLiteral("NumSelectedHosts"), cSelHosts - 1);
group.writeEntry(QStringLiteral("NumHosts"), cHosts);
mConfig->sync();
Q_EMIT restoreDone();
deleteLater();
restoreSettingsDone();
}
KLDAP::LdapClientSearchConfig *RestoreLdapSettingsJob::clientSearchConfig() const
......
......@@ -35,6 +35,7 @@ Q_SIGNALS:
private:
void restore();
void saveLdapSettings(int cSelHosts, int cHosts);
void restoreSettingsDone();
QVector<KLDAP::LdapServer> mSelHosts;
QVector<KLDAP::LdapServer> mHosts;
int mEntry = -1;
......
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