Commit 1a674a3e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Reduce duplicate code

parent f28c043f
......@@ -50,6 +50,7 @@ Akonadi::Collection::Id ExportAddressbookJobInterfaceTestImpl::convertFolderPath
void ExportAddressbookJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
//TODO implement it
slotAddressbookJobTerminated();
}
QVector<Utils::AkonadiInstanceInfo> ExportAddressbookJobInterfaceTestImpl::listOfResource()
......
......@@ -62,6 +62,7 @@ Akonadi::Collection::Id ExportAlarmJobInterfaceTestImpl::convertFolderPathToColl
void ExportAlarmJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
//TODO implement me
slotAlarmJobTerminated();
}
QString ExportAlarmJobInterfaceTestImpl::resourcePath(const QString &identifier) const
......
......@@ -57,6 +57,7 @@ QString ExportCalendarsJobInterfaceTestImpl::convertToFullCollectionPath(const q
void ExportCalendarsJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
//TODO implement it
slotCalendarJobTerminated();
}
QVector<Utils::AkonadiInstanceInfo> ExportCalendarsJobInterfaceTestImpl::listOfResource()
......
......@@ -53,6 +53,11 @@ void ExportNotesJobInterfaceTestImpl::setListOfResource(const QVector<Utils::Ako
mListAkonadiInstanceInfo = instanceInfoList;
}
void ExportNotesJobInterfaceTestImpl::setPathConfig(const QString &pathConfig)
{
mPathConfig = pathConfig;
}
QVector<Utils::AkonadiInstanceInfo> ExportNotesJobInterfaceTestImpl::listOfResource()
{
qDebug() << " QVector<Utils::AkonadiInstanceInfo> ExportNotesJobInterfaceTestImpl::listOfResource()";
......@@ -63,6 +68,8 @@ void ExportNotesJobInterfaceTestImpl::exportResourceToArchive(const QString &arc
{
//TODO implement it
qDebug() << " void ExportNotesJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)" << archivePath << " url " << url << " identifier " << identifier;
//TODO implement it
slotNoteJobTerminated();
}
Akonadi::Collection::Id ExportNotesJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
......@@ -118,6 +125,7 @@ void ExportNotesJobInterfaceTest::exportNoteConfigAndResource()
ExportNotesJobInterfaceTestImpl *exportNote = new ExportNotesJobInterfaceTestImpl(this, {Utils::StoredType::Config|Utils::StoredType::Resources}, file->archiveStorage(), 1);
exportNote->setListOfResource(lstInfo);
exportNote->setPathConfig(QLatin1String(configpath));
file->setAbstractImportExportJob(exportNote);
file->start();
delete exportNote;
......@@ -126,7 +134,7 @@ void ExportNotesJobInterfaceTest::exportNoteConfigAndResource()
QString ExportNotesJobInterfaceTestImpl::resourcePath(const QString &identifier) const
{
ResourceConverterTest converter;
converter.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
converter.setTestPath(mPathConfig);
const QString url = converter.resourcePath(identifier);
return url;
}
......@@ -32,6 +32,7 @@ public:
~ExportNotesJobInterfaceTestImpl();
void setListOfResource(const QVector<Utils::AkonadiInstanceInfo> &instanceInfoList);
void setPathConfig(const QString &pathConfig);
protected:
void exportArchiveResource() override;
......@@ -42,6 +43,7 @@ protected:
Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const override;
private:
QVector<Utils::AkonadiInstanceInfo> mListAkonadiInstanceInfo;
QString mPathConfig;
};
class ExportNotesJobInterfaceTest : public QObject
......
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