Commit 3dd9cac4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use mPathConfig

parent 1a674a3e
......@@ -43,7 +43,7 @@ void ExportAddressbookJobInterfaceTestImpl::exportArchiveResource()
Akonadi::Collection::Id ExportAddressbookJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
ResourceConverterTest resourceConverterTest;
resourceConverterTest.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
resourceConverterTest.setTestPath(mPathConfig);
return resourceConverterTest.convertFolderPathToCollectionId(path);
}
......@@ -67,25 +67,30 @@ void ExportAddressbookJobInterfaceTestImpl::setListOfResource(const QVector<Util
void ExportAddressbookJobInterfaceTestImpl::convertCollectionToRealPath(KConfigGroup &group, const QString &currentKey)
{
ResourceConverterTest resourceConverter;
resourceConverter.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
resourceConverter.setTestPath(mPathConfig);
resourceConverter.convertCollectionToRealPath(group, currentKey);
}
void ExportAddressbookJobInterfaceTestImpl::convertCollectionListToRealPath(KConfigGroup &group, const QString &currentKey)
{
ResourceConverterTest resourceConverter;
resourceConverter.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
resourceConverter.setTestPath(mPathConfig);
resourceConverter.convertCollectionListToRealPath(group, currentKey);
}
QString ExportAddressbookJobInterfaceTestImpl::resourcePath(const QString &agentIdentifier, const QString &defaultPath) const
{
ResourceConverterTest converter;
converter.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
converter.setTestPath(mPathConfig);
const QString url = converter.resourcePath(agentIdentifier, defaultPath);
return url;
}
void ExportAddressbookJobInterfaceTestImpl::setPathConfig(const QString &pathConfig)
{
mPathConfig = pathConfig;
}
ExportAddressbookJobInterfaceTest::ExportAddressbookJobInterfaceTest(QObject *parent)
: QObject(parent)
{
......@@ -105,6 +110,7 @@ void ExportAddressbookJobInterfaceTest::exportAddressBookConfig()
TestExportFile *file = new TestExportFile(this);
file->setPathConfig(configpath);
ExportAddressbookJobInterfaceTestImpl *exportNote = new ExportAddressbookJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
exportNote->setPathConfig(QLatin1String(configpath));
file->setAbstractImportExportJob(exportNote);
file->start();
delete exportNote;
......
......@@ -32,6 +32,8 @@ public:
~ExportAddressbookJobInterfaceTestImpl();
void setListOfResource(const QVector<Utils::AkonadiInstanceInfo> &instanceInfoList);
void setPathConfig(const QString &pathConfig);
protected:
void exportArchiveResource() override;
......@@ -44,6 +46,7 @@ protected:
Q_REQUIRED_RESULT QString resourcePath(const QString &agentIdentifier, const QString &defaultPath = QString()) const override;
private:
QVector<Utils::AkonadiInstanceInfo> mListAkonadiInstanceInfo;
QString mPathConfig;
};
class ExportAddressbookJobInterfaceTest : public QObject
......
......@@ -38,7 +38,7 @@ ExportNotesJobInterfaceTestImpl::~ExportNotesJobInterfaceTestImpl()
void ExportNotesJobInterfaceTestImpl::convertCollectionIdsToRealPath(KConfigGroup &selectFolderNoteGroup, const QString &selectFolderNoteGroupStr)
{
ResourceConverterTest resourceConverterTest;
resourceConverterTest.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
resourceConverterTest.setTestPath(mPathConfig);
resourceConverterTest.convertCollectionIdsToRealPath(selectFolderNoteGroup, selectFolderNoteGroupStr);
}
......@@ -75,10 +75,19 @@ void ExportNotesJobInterfaceTestImpl::exportResourceToArchive(const QString &arc
Akonadi::Collection::Id ExportNotesJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path)
{
ResourceConverterTest resourceConverterTest;
resourceConverterTest.setTestPath(QLatin1String(PIMDATAEXPORTER_DIR));
resourceConverterTest.setTestPath(mPathConfig);
return resourceConverterTest.convertFolderPathToCollectionId(path);
}
QString ExportNotesJobInterfaceTestImpl::resourcePath(const QString &identifier) const
{
ResourceConverterTest converter;
converter.setTestPath(mPathConfig);
const QString url = converter.resourcePath(identifier);
return url;
}
ExportNotesJobInterfaceTest::ExportNotesJobInterfaceTest(QObject *parent)
: QObject(parent)
{
......@@ -131,10 +140,3 @@ void ExportNotesJobInterfaceTest::exportNoteConfigAndResource()
delete exportNote;
}
QString ExportNotesJobInterfaceTestImpl::resourcePath(const QString &identifier) const
{
ResourceConverterTest converter;
converter.setTestPath(mPathConfig);
const QString url = converter.resourcePath(identifier);
return url;
}
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