Commit 4a17e055 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Prepare to make it async

parent 9fa09a60
Pipeline #40782 canceled with stage
......@@ -51,13 +51,22 @@ void ImportImapSettingsAkonadiCheckJob::start()
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*rc"));
for (const QString &file : fileNames) {
if (resourceCanHaveSieveSupport(file)) {
//Move as Async
if (importSettings(dir, file)) {
mSettingsWereImported = true;
}
mSieveServerLst.insert(dir, file);
}
}
}
loadSieveServerSettings();
}
void ImportImapSettingsAkonadiCheckJob::loadSieveServerSettings()
{
QMapIterator<QString, QString> i(mSieveServerLst);
while (i.hasNext()) {
i.next();
if (importSettings(i.key(), i.value())) {
mSettingsWereImported = true;
}
}
checkNoSettingsImported();
}
......
......@@ -35,8 +35,10 @@ public:
Q_REQUIRED_RESULT QString name() const override;
private:
inline bool resourceCanHaveSieveSupport(const QString &filename) const;
bool importSettings(const QString &directory, const QString &filename);
inline Q_REQUIRED_RESULT bool resourceCanHaveSieveSupport(const QString &filename) const;
void loadSieveServerSettings();
Q_REQUIRED_RESULT bool importSettings(const QString &directory, const QString &filename);
QMultiMap<QString, QString> mSieveServerLst;
};
#endif // IMPORTIMAPSETTINGSAKONADICHECKJOB_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