Commit 13991d56 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Move method in importmailjobinterfaceimpl class

parent abeaa340
......@@ -286,6 +286,7 @@ void ImportMailJobInterface::addMailTransport(MailTransport::Transport *mt, int
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()
......@@ -949,7 +950,6 @@ void ImportMailJobInterface::restoreIdentity()
Q_EMIT error(i18n("emailidentities file could not be found in the archive."));
} else {
Q_EMIT info(i18n("Restoring identities..."));
const KArchiveEntry *identity = mArchiveDirectory->entry(path);
if (identity && identity->isFile()) {
const KArchiveFile *fileIdentity = static_cast<const KArchiveFile *>(identity);
......@@ -1014,17 +1014,6 @@ void ImportMailJobInterface::restoreIdentity()
QTimer::singleShot(0, this, &ImportMailJobInterface::slotNextStep);
}
QString ImportMailJobInterface::uniqueIdentityName(const QString &name)
{
QString newName(name);
int i = 0;
while (!mIdentityManager->isUnique(newName)) {
newName = QStringLiteral("%1_%2").arg(name).arg(i);
++i;
}
return newName;
}
void ImportMailJobInterface::importMailArchiveConfig(const KArchiveFile *archiveconfiguration, const QString &archiveconfigurationrc, const QString &filename, const QString &prefix)
{
copyToFile(archiveconfiguration, archiveconfigurationrc, filename, prefix);
......
......@@ -59,7 +59,6 @@ protected:
virtual void importFilters(const QVector<MailCommon::MailFilter *> &filters) = 0;
virtual Q_REQUIRED_RESULT QString adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData) = 0;
virtual void addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) = 0;
Q_REQUIRED_RESULT QString uniqueIdentityName(const QString &name);
QHash<int, uint> mHashIdentity;
......
......@@ -98,3 +98,15 @@ void ImportMailJobInterfaceImpl::addNewIdentity(const QString &name, KConfigGrou
}
mIdentityManager->commit();
}
QString ImportMailJobInterfaceImpl::uniqueIdentityName(const QString &name)
{
QString newName(name);
int i = 0;
while (!mIdentityManager->isUnique(newName)) {
newName = QStringLiteral("%1_%2").arg(name).arg(i);
++i;
}
return newName;
}
......@@ -48,6 +48,8 @@ protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
Q_REQUIRED_RESULT QString adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) override;
void addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) override;
private:
Q_REQUIRED_RESULT QString uniqueIdentityName(const QString &name);
};
#endif // ImportMailJob_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