Commit 29fbce73 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Move method to ResourceConverterBase

parent 2161b5ad
......@@ -114,5 +114,6 @@ void ExportAddressbookJobInterfaceImpl::convertCollectionListToRealPath(KConfigG
Akonadi::Collection::Id ExportAddressbookJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
......@@ -127,5 +127,6 @@ void ImportAddressbookJobInterfaceImpl::restoreResources()
Akonadi::Collection::Id ImportAddressbookJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
......@@ -104,5 +104,6 @@ void ExportAlarmJobInterfaceImpl::exportArchiveResource()
Akonadi::Collection::Id ExportAlarmJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
......@@ -119,5 +119,6 @@ void ImportAlarmJobInterfaceImpl::restoreResources()
Akonadi::Collection::Id ImportAlarmJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
......@@ -32,3 +32,11 @@ QString ResourceConverterTest::convertToFullCollectionPath(const qlonglong colle
qDebug() << " QString ResourceConverterTest::convertToFullCollectionPath(const qlonglong collectionValue) not implemented yet!";
return QStringLiteral("COLLECTION_CONVERTED");
}
Akonadi::Collection::Id ResourceConverterTest::convertFolderPathToCollectionId(const QString &path)
{
//TODO implement it
qDebug() << " Akonadi::Collection::Id ResourceConverterTest::convertFolderPathToCollectionId(const QString &path) not implemented yet";
return -1;
}
......@@ -28,6 +28,8 @@ public:
ResourceConverterTest();
~ResourceConverterTest() override;
Q_REQUIRED_RESULT QString convertToFullCollectionPath(const qlonglong collectionValue) override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
#endif // RESOURCECONVERTERTEST_H
......@@ -51,7 +51,8 @@ void ExportCalendarJobInterfaceImpl::exportArchiveResource()
Akonadi::Collection::Id ExportCalendarJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
void ExportCalendarJobInterfaceImpl::slotCalendarJobTerminated()
......
......@@ -57,7 +57,8 @@ ImportCalendarJobInterfaceImpl::~ImportCalendarJobInterfaceImpl()
Akonadi::Collection::Id ImportCalendarJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
void ImportCalendarJobInterfaceImpl::restoreResources()
......
......@@ -157,7 +157,8 @@ void ExportMailJobInterfaceImpl::backupResources()
Akonadi::Collection::Id ExportMailJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
void ExportMailJobInterfaceImpl::convertCollectionIdsToRealPath(KConfigGroup &group, const QString &currentKey, const QString &prefixCollection)
......
......@@ -529,7 +529,8 @@ void ImportMailJobInterface::restoreResources()
Collection::Id ImportMailJobInterface::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
void ImportMailJobInterface::restoreMails()
......
......@@ -105,5 +105,6 @@ void ExportNotesJobInterfaceImpl::convertCollectionIdsToRealPath(KConfigGroup &s
Akonadi::Collection::Id ExportNotesJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
......@@ -115,5 +115,6 @@ void ImportNotesJobInterfaceImpl::restoreResources()
Akonadi::Collection::Id ImportNotesJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
ResourceConverterImpl converter;
return converter.convertFolderPathToCollectionId(path);
}
......@@ -23,6 +23,7 @@
#include "pimdataexporter_export.h"
#include <QString>
#include <KSharedConfig>
#include <AkonadiCore/Collection>
class PIMDATAEXPORTER_EXPORT ResourceConverterBase
{
public:
......@@ -36,6 +37,7 @@ public:
Q_REQUIRED_RESULT QString resourcePath(const KSharedConfigPtr &resourceConfig, const QString &defaultPath = QString());
Q_REQUIRED_RESULT QString adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData);
virtual Q_REQUIRED_RESULT QString convertToFullCollectionPath(const qlonglong collectionValue) = 0;
virtual Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) = 0;
};
#endif // RESOURCECONVERTER_H
......@@ -32,3 +32,8 @@ QString ResourceConverterImpl::convertToFullCollectionPath(const qlonglong colle
{
return MailCommon::Util::fullCollectionPath(Akonadi::Collection(collectionValue));
}
Akonadi::Collection::Id ResourceConverterImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -28,6 +28,7 @@ public:
ResourceConverterImpl();
~ResourceConverterImpl() override;
Q_REQUIRED_RESULT QString convertToFullCollectionPath(const qlonglong collectionValue) override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
#endif // RESOURCECONVERTERIMPL_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