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

Move to importmailjobinterfaceimpl directly

parent 00acc2d6
......@@ -198,18 +198,6 @@ void ImportMailJobInterface::restoreTransports()
QTimer::singleShot(0, this, &ImportMailJobInterface::slotNextStep);
}
void ImportMailJobInterface::addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId)
{
mt->forceUniqueName();
mt->save();
MailTransport::TransportManager::self()->addTransport(mt);
if (transportId == defaultTransport) {
MailTransport::TransportManager::self()->setDefaultTransport(mt->id());
}
mHashTransport.insert(transportId, mt->id());
qDebug() << " void ImportMailJobInterface::addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId)" << transportId;
}
void ImportMailJobInterface::restoreResources()
{
increaseProgressDialog();
......
......@@ -61,9 +61,9 @@ protected:
virtual void addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) = 0;
virtual void importCustomMailTransport(const QString &identifierValue, const KConfigGroup &group, int defaultTransport, int transportId) = 0;
virtual void importSmtpMailTransport(const KConfigGroup &group, int defaultTransport, int transportId) = 0;
void addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId);
QHash<int, uint> mHashIdentity;
QHash<int, int> mHashTransport;
private:
void restoreTransports();
......@@ -87,7 +87,6 @@ private:
void mergeSieveTemplate(const KArchiveFile *archivefile, const QString &filename, const QString &prefix);
void importSimpleFilesInDirectory(const QString &relativePath);
QHash<int, int> mHashTransport;
QHash<QString, QString> mHashResources;
QStringList mFileList;
};
......
......@@ -199,3 +199,15 @@ void ImportMailJobInterfaceImpl::importSmtpMailTransport(const KConfigGroup &gro
}
addMailTransport(mt, defaultTransport, transportId);
}
void ImportMailJobInterfaceImpl::addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId)
{
mt->forceUniqueName();
mt->save();
MailTransport::TransportManager::self()->addTransport(mt);
if (transportId == defaultTransport) {
MailTransport::TransportManager::self()->setDefaultTransport(mt->id());
}
mHashTransport.insert(transportId, mt->id());
qDebug() << " void ImportMailJobInterface::addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId)" << transportId;
}
......@@ -50,6 +50,7 @@ protected:
void addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) override;
void importCustomMailTransport(const QString &identifierValue, const KConfigGroup &group, int defaultTransport, int transportId) override;
void importSmtpMailTransport(const KConfigGroup &group, int defaultTransport, int transportId) override;
void addMailTransport(MailTransport::Transport *mt, int defaultTransport, int transportId);
private:
Q_REQUIRED_RESULT QString uniqueIdentityName(const QString &name);
};
......
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