Commit 6b5c4332 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to move as async

parent 8db70f50
Pipeline #40580 failed with stage
in 10 minutes
......@@ -52,27 +52,35 @@ void ReadServerSieveConfigJob::loadSettings(const QString &conf)
mCurrentSieveServerConfig.sieveSettings.authenticationType
= static_cast<MailTransport::Transport::EnumAuthenticationType::type>(group.readEntry(QStringLiteral("Authentication"),
static_cast<int>(MailTransport::Transport::EnumAuthenticationType::PLAIN)));
//Imap Account Settings
mCurrentSieveServerConfig.sieveImapAccountSettings.setPort(group.readEntry(QStringLiteral("ImapPort"), 0));
mCurrentSieveServerConfig.sieveImapAccountSettings.setServerName(group.readEntry(QStringLiteral("ImapServerName")));
mCurrentSieveServerConfig.sieveImapAccountSettings.setUserName(group.readEntry(QStringLiteral("ImapUserName")));
mCurrentSieveServerConfig.sieveImapAccountSettings.setAuthenticationType(
static_cast<KSieveUi::SieveImapAccountSettings::AuthenticationMode>(group.readEntry(QStringLiteral("ImapAuthentication"), static_cast<int>(KSieveUi::SieveImapAccountSettings::Plain))));
mCurrentSieveServerConfig.sieveImapAccountSettings.setEncryptionMode(
static_cast<KSieveUi::SieveImapAccountSettings::EncryptionMode>(group.readEntry(QStringLiteral("ImapEncrypt"), static_cast<int>(KSieveUi::SieveImapAccountSettings::SSLorTLS))));
//Read wallet
const QString walletEntry = mCurrentSieveServerConfig.sieveSettings.userName + QLatin1Char('@') + mCurrentSieveServerConfig.sieveSettings.serverName;
if (wallet && wallet->hasEntry(walletEntry)) {
QString passwd;
wallet->readPassword(walletEntry, passwd);
mCurrentSieveServerConfig.sieveSettings.password = passwd;
//Q_EMIT loadImapAccountSettingsRequested();
}
loadImapAccountSettings(group);
readSieveServerPasswordFinished();
}
void ReadServerSieveConfigJob::loadImapAccountSettings(const KConfigGroup &group)
void ReadServerSieveConfigJob::readSieveServerPasswordFinished()
{
loadImapAccountSettings();
}
void ReadServerSieveConfigJob::loadImapAccountSettings()
{
KWallet::Wallet *wallet = SieveEditorUtil::selectWalletFolder();
//Imap Account Settings
mCurrentSieveServerConfig.sieveImapAccountSettings.setPort(group.readEntry(QStringLiteral("ImapPort"), 0));
mCurrentSieveServerConfig.sieveImapAccountSettings.setServerName(group.readEntry(QStringLiteral("ImapServerName")));
mCurrentSieveServerConfig.sieveImapAccountSettings.setUserName(group.readEntry(QStringLiteral("ImapUserName")));
mCurrentSieveServerConfig.sieveImapAccountSettings.setAuthenticationType(
static_cast<KSieveUi::SieveImapAccountSettings::AuthenticationMode>(group.readEntry(QStringLiteral("ImapAuthentication"), static_cast<int>(KSieveUi::SieveImapAccountSettings::Plain))));
mCurrentSieveServerConfig.sieveImapAccountSettings.setEncryptionMode(
static_cast<KSieveUi::SieveImapAccountSettings::EncryptionMode>(group.readEntry(QStringLiteral("ImapEncrypt"), static_cast<int>(KSieveUi::SieveImapAccountSettings::SSLorTLS))));
if (!mCurrentSieveServerConfig.sieveImapAccountSettings.userName().isEmpty()
&& !mCurrentSieveServerConfig.sieveImapAccountSettings.serverName().isEmpty()
......
......@@ -37,7 +37,8 @@ Q_SIGNALS:
private:
void loadSettings(const QString &conf);
void slotReadNextConfig();
void loadImapAccountSettings(const KConfigGroup &group);
void loadImapAccountSettings();
void readSieveServerPasswordFinished();
QVector<SieveEditorUtil::SieveServerConfig> mLstConfig;
SieveEditorUtil::SieveServerConfig mCurrentSieveServerConfig;
QStringList mGroupsConfigs;
......
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