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

Use async api here

parent 2d2647e8
Pipeline #40474 canceled with stage
......@@ -97,5 +97,6 @@ void ReadServerSieveConfigJob::start()
}
lstConfig.append(sieve);
}
//return lstConfig;
Q_EMIT finished(lstConfig);
deleteLater();
}
......@@ -20,6 +20,7 @@
#include "serversievelistwidget.h"
#include "serversievesettingsdialog.h"
#include "sieveserversettings.h"
#include "readserversieveconfigjob.h"
#include <KLocalizedString>
#include <QListWidgetItem>
......@@ -38,8 +39,14 @@ ServerSieveListWidget::~ServerSieveListWidget()
void ServerSieveListWidget::readConfig()
{
const QVector<SieveEditorUtil::SieveServerConfig> lstServer = SieveEditorUtil::readServerSieveConfig();
for (const SieveEditorUtil::SieveServerConfig &conf : lstServer) {
ReadServerSieveConfigJob *job = new ReadServerSieveConfigJob(this);
connect(job, &ReadServerSieveConfigJob::finished, this, &ServerSieveListWidget::slotReadServerSieveConfigDone);
job->start();
}
void ServerSieveListWidget::slotReadServerSieveConfigDone(const QVector<SieveEditorUtil::SieveServerConfig> &lstConfig)
{
for (const SieveEditorUtil::SieveServerConfig &conf : lstConfig) {
auto *item = new ServerSieveListWidgetItem(this);
item->setServerConfig(conf);
}
......
......@@ -52,6 +52,7 @@ public Q_SLOTS:
void modifyServerConfig();
private:
void slotReadServerSieveConfigDone(const QVector<SieveEditorUtil::SieveServerConfig> &lstConfig);
void deletePasswords();
QStringList mNeedToRemovePasswordInWallet;
};
......
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