Commit 46f7ce8f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove unused variable

parent 82d17387
Pipeline #42932 canceled with stage
......@@ -101,44 +101,47 @@ void RestoreLdapSettingsJob::restoreSettingsDone()
deleteLater();
}
void RestoreLdapSettingsJob::saveLdapSettings()
void RestoreLdapSettingsJob::saveNextSelectHostSettings()
{
mConfig->deleteGroup(QStringLiteral("LDAP"));
mCurrentGroup = KConfigGroup(mConfig, QStringLiteral("LDAP"));
//Move async
for (int i = 0; i < mNumSelHosts - 1; ++i) {
auto job = new KLDAP::LdapClientSearchConfigWriteConfigJob;
if (mCurrentIndex < mNumSelHosts - 1) {
auto job = new KLDAP::LdapClientSearchConfigWriteConfigJob(this);
connect(job, &KLDAP::LdapClientSearchConfigWriteConfigJob::configSaved, this, &RestoreLdapSettingsJob::saveNextSelectHostSettings);
job->setActive(true);
job->setConfig(mCurrentGroup);
job->setServer(mSelHosts.at(i));
job->setServerIndex(i);
job->setServer(mSelHosts.at(mCurrentIndex));
job->setServerIndex(mCurrentIndex);
job->start();
} else {
mCurrentIndex = 0;
saveNextHostSettings();
}
}
for (int i = 0; i < mNumHosts; ++i) {
auto job = new KLDAP::LdapClientSearchConfigWriteConfigJob;
void RestoreLdapSettingsJob::saveNextHostSettings()
{
if (mCurrentIndex < mNumHosts) {
auto job = new KLDAP::LdapClientSearchConfigWriteConfigJob(this);
connect(job, &KLDAP::LdapClientSearchConfigWriteConfigJob::configSaved, this, &RestoreLdapSettingsJob::saveNextHostSettings);
job->setActive(false);
job->setConfig(mCurrentGroup);
job->setServer(mHosts.at(i));
job->setServerIndex(i);
job->setServer(mHosts.at(mCurrentIndex));
job->setServerIndex(mCurrentIndex);
job->start();
} else {
mCurrentGroup.writeEntry(QStringLiteral("NumSelectedHosts"), mNumSelHosts - 1);
mCurrentGroup.writeEntry(QStringLiteral("NumHosts"), mNumHosts);
mConfig->sync();
restoreSettingsDone();
}
mCurrentGroup.writeEntry(QStringLiteral("NumSelectedHosts"), mNumSelHosts - 1);
mCurrentGroup.writeEntry(QStringLiteral("NumHosts"), mNumHosts);
mConfig->sync();
restoreSettingsDone();
}
KLDAP::LdapClientSearchConfig *RestoreLdapSettingsJob::clientSearchConfig() const
void RestoreLdapSettingsJob::saveLdapSettings()
{
return mClientSearchConfig;
}
mConfig->deleteGroup(QStringLiteral("LDAP"));
mCurrentGroup = KConfigGroup(mConfig, QStringLiteral("LDAP"));
void RestoreLdapSettingsJob::setClientSearchConfig(KLDAP::LdapClientSearchConfig *clientSearchConfig)
{
mClientSearchConfig = clientSearchConfig;
mCurrentIndex = 0;
saveNextSelectHostSettings();
}
int RestoreLdapSettingsJob::entry() const
......@@ -164,5 +167,5 @@ void RestoreLdapSettingsJob::setConfig(KConfig *config)
bool RestoreLdapSettingsJob::canStart() const
{
return (mConfig != nullptr) && (mEntry != -1) && mClientSearchConfig;
return (mConfig != nullptr) && (mEntry != -1);
}
......@@ -11,9 +11,6 @@
#include <KLDAP/LdapServer>
#include <KConfigGroup>
class KConfig;
namespace KLDAP {
class LdapClientSearchConfig;
}
class RestoreLdapSettingsJob : public QObject
{
Q_OBJECT
......@@ -28,9 +25,6 @@ public:
Q_REQUIRED_RESULT int entry() const;
void setEntry(int entry);
KLDAP::LdapClientSearchConfig *clientSearchConfig() const;
void setClientSearchConfig(KLDAP::LdapClientSearchConfig *clientSearchConfig);
Q_SIGNALS:
void restoreDone();
private:
......@@ -41,6 +35,8 @@ private:
void restoreSettingsDone();
void loadNextSelectHostSettings();
void loadNextHostSettings();
void saveNextSelectHostSettings();
void saveNextHostSettings();
QVector<KLDAP::LdapServer> mSelHosts;
QVector<KLDAP::LdapServer> mHosts;
int mEntry = -1;
......@@ -49,7 +45,6 @@ private:
int mCurrentIndex = 0;
KConfig *mConfig = nullptr;
KConfigGroup mCurrentGroup;
KLDAP::LdapClientSearchConfig *mClientSearchConfig = nullptr;
};
#endif // RESTORELDAPSETTINGSJOB_H
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