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

Make method virtual pure

parent fdc436fd
......@@ -258,12 +258,6 @@ Akonadi::Collection::Id AbstractImportExportJob::convertPathToId(const QString &
return id;
}
//Allow to remove dependancy against MailCommon::Util
Akonadi::Collection::Id AbstractImportExportJob::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void AbstractImportExportJob::initializeImportJob()
{
if (mTempDir) {
......
......@@ -127,7 +127,7 @@ protected:
void convertCollectionListStrToAkonadiId(const KSharedConfig::Ptr &config, const QString &groupName, const QString &key, bool addCollectionPrefix);
void convertRealPathToCollectionList(KConfigGroup &group, const QString &currentKey, bool addCollectionPrefix = true);
virtual Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path);
virtual Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) = 0;
private:
void slotAllResourceSynchronized();
void slotSynchronizeInstanceDone(const QString &, const QString &identifier);
......
......@@ -21,7 +21,7 @@
#include "exportresourcearchivejob.h"
#include <AkonadiCore/AgentManager>
#include <MailCommon/MailUtil>
#include <KLocalizedString>
#include <QTemporaryFile>
......@@ -111,3 +111,8 @@ void ExportAddressbookJobInterfaceImpl::convertCollectionListToRealPath(KConfigG
ResourceConverterImpl converter;
converter.convertCollectionListToRealPath(group, currentKey);
}
Akonadi::Collection::Id ExportAddressbookJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -35,6 +35,7 @@ protected:
void exportArchiveResource() override;
void convertCollectionToRealPath(KConfigGroup &group, const QString &currentKey) override;
void convertCollectionListToRealPath(KConfigGroup &group, const QString &currentKey) override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotWriteNextArchiveResource();
void slotAddressbookJobTerminated();
......
......@@ -19,7 +19,7 @@
#include "importaddressbookjobinterfaceimpl.h"
#include "archivestorage.h"
#include <MailCommon/MailUtil>
#include <PimCommonAkonadi/CreateResource>
#include <KLocalizedString>
......@@ -124,3 +124,8 @@ void ImportAddressbookJobInterfaceImpl::restoreResources()
//It's maildir support. Need to add support
startSynchronizeResources(listResource);
}
Akonadi::Collection::Id ImportAddressbookJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -34,6 +34,7 @@ public:
protected:
void restoreResources() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
#endif // IMPORTADDRESSBOOKJOBINTERFACEIMPL_H
......@@ -18,7 +18,7 @@
*/
#include "exportakregatorjobinterface.h"
#include <MailCommon/MailUtil>
#include <AkonadiCore/AgentManager>
#include <KLocalizedString>
#include <KZip>
......@@ -49,6 +49,11 @@ void ExportAkregatorJobInterface::start()
}
}
Akonadi::Collection::Id ExportAkregatorJobInterface::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void ExportAkregatorJobInterface::slotCheckBackupConfig()
{
increaseProgressDialog();
......
......@@ -32,7 +32,8 @@ public:
~ExportAkregatorJobInterface() override;
void start() override;
protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotCheckBackupConfig();
void slotCheckBackupData();
......
......@@ -20,6 +20,7 @@
#include "importakregatorjobinterface.h"
#include "archivestorage.h"
#include <MailCommon/MailUtil>
#include <PimCommonAkonadi/CreateResource>
#include <KArchive>
......@@ -48,6 +49,11 @@ void ImportAkregatorJobInterface::start()
QTimer::singleShot(0, this, &ImportAkregatorJobInterface::slotNextStep);
}
Akonadi::Collection::Id ImportAkregatorJobInterface::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void ImportAkregatorJobInterface::slotNextStep()
{
++mIndex;
......
......@@ -33,6 +33,9 @@ public:
void start() override;
protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotNextStep() override;
......
......@@ -22,6 +22,7 @@
#include <AkonadiCore/AgentManager>
#include <KLocalizedString>
#include <MailCommon/MailUtil>
#include <QTemporaryFile>
#include <QTimer>
......@@ -100,3 +101,8 @@ void ExportAlarmJobInterfaceImpl::exportArchiveResource()
{
QTimer::singleShot(0, this, &ExportAlarmJobInterfaceImpl::slotWriteNextArchiveResource);
}
Akonadi::Collection::Id ExportAlarmJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -33,6 +33,7 @@ public:
protected:
void exportArchiveResource() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotAlarmJobTerminated();
......
......@@ -21,6 +21,7 @@
#include "archivestorage.h"
#include <PimCommonAkonadi/CreateResource>
#include <MailCommon/MailUtil>
#include <KArchive>
#include <KLocalizedString>
......@@ -115,3 +116,8 @@ void ImportAlarmJobInterfaceImpl::restoreResources()
//It's maildir support. Need to add support
startSynchronizeResources(listResource);
}
Akonadi::Collection::Id ImportAlarmJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -32,6 +32,7 @@ public:
~ImportAlarmJobInterfaceImpl() override;
protected:
void restoreResources() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
#endif // IMPORTALARMJOBINTERFACEIMPL_H
......@@ -86,3 +86,10 @@ void ExportAddressbookJobInterfaceTest::exportAddressBookConfigTest1()
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/export/test1"));
compareExportFile.compareFiles();
}
Akonadi::Collection::Id ExportAddressbookJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
//TODO
return -1;
}
......@@ -37,6 +37,7 @@ protected:
protected:
void convertCollectionToRealPath(KConfigGroup &group, const QString &currentKey) override;
void convertCollectionListToRealPath(KConfigGroup &group, const QString &currentKey) override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
class ExportAddressbookJobInterfaceTest : public QObject
......
......@@ -75,3 +75,10 @@ void ExportAlarmJobInterfaceTest::exportAlarmConfigTest1()
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/export/test1"));
compareExportFile.compareFiles();
}
Akonadi::Collection::Id ExportAlarmJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
//TODO
return -1;
}
......@@ -33,6 +33,7 @@ public:
protected:
void exportArchiveResource() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
class ExportAlarmJobInterfaceTest : public QObject
......
......@@ -75,3 +75,10 @@ void ExportCalendarsJobInterfaceTest::exportCalendarConfigTest1()
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/export/test1"));
compareExportFile.compareFiles();
}
Akonadi::Collection::Id ExportCalendarsJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
//TODO
return -1;
}
......@@ -33,6 +33,7 @@ public:
protected:
void exportArchiveResource() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
class ExportCalendarsJobInterfaceTest : public QObject
......
......@@ -98,3 +98,10 @@ void ExportMailJobInterfaceTest::exportMailConfigTest1()
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/export/test1"));
compareExportFile.compareFiles();
}
Akonadi::Collection::Id ExportMailJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
//TODO
return -1;
}
......@@ -40,6 +40,8 @@ protected:
void convertCollectionIdsToRealPath(KConfigGroup &group, const QString &currentKey, const QString &prefixCollection) override;
void backupResources() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
class ExportMailJobInterfaceTest : public QObject
......
......@@ -81,3 +81,10 @@ void ExportNotesJobInterfaceTest::exportNoteConfigTest1()
compareExportFile.setListFilePath(QStringLiteral(PIMDATAEXPORTER_DIR "/export/test1"));
compareExportFile.compareFiles();
}
Akonadi::Collection::Id ExportNotesJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
//TODO
return -1;
}
......@@ -34,6 +34,7 @@ public:
protected:
void exportArchiveResource() override;
void convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr) override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
};
class ExportNotesJobInterfaceTest : public QObject
......
......@@ -66,3 +66,10 @@ void ImportNotesJobInterfaceTest::importNoteConfigTest1()
delete importNote;
delete archiveStorage;
}
Akonadi::Collection::Id ImportNotesJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
//TODO
return -1;
}
......@@ -31,6 +31,9 @@ public:
explicit ImportNotesJobInterfaceTestImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportNotesJobInterfaceTestImpl();
protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void restoreResources() override;
};
......
......@@ -49,6 +49,11 @@ void ExportCalendarJobInterfaceImpl::exportArchiveResource()
QTimer::singleShot(0, this, &ExportCalendarJobInterfaceImpl::slotWriteNextArchiveResource);
}
Akonadi::Collection::Id ExportCalendarJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void ExportCalendarJobInterfaceImpl::slotCalendarJobTerminated()
{
if (wasCanceled()) {
......
......@@ -33,6 +33,7 @@ public:
protected:
void exportArchiveResource() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotCalendarJobTerminated();
......
......@@ -31,6 +31,7 @@
#include "pimdataexportcore_debug.h"
#include <MailCommon/MailUtil>
#include <QFile>
#include <QDir>
#include <QStandardPaths>
......@@ -54,6 +55,11 @@ ImportCalendarJobInterfaceImpl::~ImportCalendarJobInterfaceImpl()
{
}
Akonadi::Collection::Id ImportCalendarJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void ImportCalendarJobInterfaceImpl::restoreResources()
{
Q_EMIT info(i18n("Restore resources..."));
......
......@@ -31,6 +31,9 @@ class PIMDATAEXPORTER_TESTS_EXPORT ImportCalendarJobInterfaceImpl : public Impor
public:
explicit ImportCalendarJobInterfaceImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportCalendarJobInterfaceImpl() override;
protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void restoreResources() override;
};
......
......@@ -156,6 +156,11 @@ void ExportMailJobInterfaceImpl::backupResources()
Q_EMIT info(i18n("Resources backup done."));
}
Akonadi::Collection::Id ExportMailJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void ExportMailJobInterfaceImpl::convertCollectionIdsToRealPath(KConfigGroup &group, const QString &currentKey, const QString &prefixCollection)
{
ResourceConverterImpl converter;
......
......@@ -40,6 +40,7 @@ protected:
void convertCollectionListToRealPath(KConfigGroup &group, const QString &currentKey) override;
void exportArchiveResource() override;
void backupResources() override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotCheckBackupMails();
void slotWriteNextArchiveResource();
......
......@@ -527,6 +527,11 @@ void ImportMailJobInterface::restoreResources()
QTimer::singleShot(0, this, &ImportMailJobInterface::slotNextStep);
}
Collection::Id ImportMailJobInterface::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
void ImportMailJobInterface::restoreMails()
{
increaseProgressDialog();
......
......@@ -50,6 +50,7 @@ protected:
void convertCollectionStrToAkonadiId(const KSharedConfig::Ptr &config, const QString &groupName, const QString &key);
virtual void restoreMails();
virtual void restoreResources();
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void registerSpecialCollection(Akonadi::SpecialMailCollections::Type type, qint64 colId);
void restoreTransports();
......
......@@ -22,7 +22,7 @@
#include "resourceconverterimpl.h"
#include <AkonadiCore/AgentManager>
#include <MailCommon/MailUtil>
#include <KLocalizedString>
#include <KZip>
#include <QTemporaryFile>
......@@ -102,3 +102,8 @@ void ExportNotesJobInterfaceImpl::convertCollectionIdsToRealPath(KConfigGroup &s
ResourceConverterImpl resourceImpl;
resourceImpl.convertCollectionIdsToRealPath(selectFolderNoteGroup, selectFolderNoteGroupStr);
}
Akonadi::Collection::Id ExportNotesJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -34,6 +34,7 @@ public:
protected:
void exportArchiveResource() override;
void convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr) override;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void slotNoteJobTerminated();
void slotWriteNextArchiveResource();
......
......@@ -19,7 +19,7 @@
#include "importnotesjobinterfaceimpl.h"
#include "archivestorage.h"
#include <MailCommon/MailUtil>
#include <PimCommonAkonadi/CreateResource>
#include <KArchive>
......@@ -111,3 +111,9 @@ void ImportNotesJobInterfaceImpl::restoreResources()
//It's maildir support. Need to add support
startSynchronizeResources(listResource);
}
Akonadi::Collection::Id ImportNotesJobInterfaceImpl::convertFolderPathToCollectionId(const QString &path)
{
return MailCommon::Util::convertFolderPathToCollectionId(path);
}
......@@ -31,8 +31,12 @@ public:
explicit ImportNotesJobInterfaceImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ImportNotesJobInterfaceImpl() override;
protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
private:
void restoreResources() override;
};
#endif // IMPORTNOTESJOB_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