Commit 8e9885f4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement autotest

parent 16aaee40
......@@ -375,7 +375,8 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
ResourceConverterImpl converter;
QString newUrl;
if (overwriteResources) {
newUrl = converter.resourcePath(resourceConfig);
//TODO fix me too
newUrl = converter.ResourceConverterBase::resourcePath(resourceConfig);
} else {
newUrl = converter.adaptResourcePath(resourceConfig, storePath);
}
......
......@@ -90,8 +90,7 @@ void ExportAddressbookJobInterface::slotWriteNextArchiveResource()
if (identifier.contains(QLatin1String("akonadi_vcarddir_resource_")) || identifier.contains(QLatin1String("akonadi_contacts_resource_"))) {
const QString archivePath = Utils::addressbookPath() + identifier + QLatin1Char('/');
ResourceConverterImpl converter;
const QString url = converter.resourcePath(identifier, QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/contacts/"));
const QString url = resourcePath(identifier, QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/contacts/"));
if (!mAgentPaths.contains(url)) {
if (!url.isEmpty()) {
mAgentPaths << url;
......
......@@ -42,6 +42,7 @@ protected:
void slotCheckBackupConfig();
virtual void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) = 0;
virtual Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() = 0;
virtual Q_REQUIRED_RESULT QString resourcePath(const QString &agentIdentifier, const QString &defaultPath) const = 0;
private:
void slotCheckBackupResource();
......
......@@ -82,3 +82,10 @@ void ExportAddressbookJobInterfaceImpl::exportResourceToArchive(const QString &a
connect(resourceJob, &ExportResourceArchiveJob::terminated, this, &ExportAddressbookJobInterfaceImpl::slotAddressbookJobTerminated);
resourceJob->start();
}
QString ExportAddressbookJobInterfaceImpl::resourcePath(const QString &agentIdentifier, const QString &defaultPath) const
{
ResourceConverterImpl converter;
const QString url = converter.resourcePath(agentIdentifier, defaultPath);
return url;
}
......@@ -38,6 +38,7 @@ protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) override;
Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() override;
Q_REQUIRED_RESULT QString resourcePath(const QString &agentIdentifier, const QString &defaultPath) const override;
};
#endif // EXPORTADDRESSBOOKINTERFACEIMPL_H
......@@ -71,8 +71,7 @@ void ExportAlarmJobInterface::slotWriteNextArchiveResource()
if (identifier.contains(QLatin1String("akonadi_kalarm_dir_resource_"))) {
const QString archivePath = Utils::alarmPath() + identifier + QLatin1Char('/');
ResourceConverterImpl converter;
const QString url = converter.resourcePath(identifier);
const QString url = resourcePath(identifier);
if (!mAgentPaths.contains(url)) {
if (!url.isEmpty()) {
mAgentPaths << url;
......
......@@ -39,6 +39,7 @@ protected:
void slotCheckBackupConfig();
virtual void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) = 0;
virtual Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() = 0;
virtual Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const = 0;
private:
void slotCheckBackupResource();
......
......@@ -70,3 +70,11 @@ void ExportAlarmJobInterfaceImpl::exportResourceToArchive(const QString &archive
connect(resourceJob, &ExportResourceArchiveJob::terminated, this, &ExportAlarmJobInterfaceImpl::slotAlarmJobTerminated);
resourceJob->start();
}
QString ExportAlarmJobInterfaceImpl::resourcePath(const QString &identifier) const
{
ResourceConverterImpl converter;
const QString url = converter.resourcePath(identifier);
return url;
}
......@@ -37,6 +37,7 @@ protected:
void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) override;
Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() override;
Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const override;
};
#endif // EXPORTALARMJOBINTERFACEIMPL_H
......@@ -74,6 +74,13 @@ void ExportAddressbookJobInterfaceTestImpl::convertCollectionListToRealPath(KCon
resourceConverter.convertCollectionListToRealPath(group, currentKey);
}
QString ExportAddressbookJobInterfaceTestImpl::resourcePath(const QString &agentIdentifier, const QString &defaultPath) const
{
ResourceConverterTest converter;
const QString url = converter.resourcePath(agentIdentifier, defaultPath);
return url;
}
ExportAddressbookJobInterfaceTest::ExportAddressbookJobInterfaceTest(QObject *parent)
: QObject(parent)
{
......@@ -97,3 +104,5 @@ void ExportAddressbookJobInterfaceTest::exportAddressBookConfig()
file->start();
delete exportNote;
}
......@@ -41,6 +41,7 @@ protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) override;
Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() override;
Q_REQUIRED_RESULT QString resourcePath(const QString &agentIdentifier, const QString &defaultPath = QString()) const override;
private:
QVector<Utils::AkonadiInstanceInfo> mListAkonadiInstanceInfo;
};
......
......@@ -63,6 +63,13 @@ void ExportAlarmJobInterfaceTestImpl::exportResourceToArchive(const QString &arc
//TODO implement me
}
QString ExportAlarmJobInterfaceTestImpl::resourcePath(const QString &identifier) const
{
ResourceConverterTest converter;
const QString url = converter.resourcePath(identifier);
return url;
}
ExportAlarmJobInterfaceTest::ExportAlarmJobInterfaceTest(QObject *parent)
: QObject(parent)
{
......
......@@ -36,6 +36,7 @@ protected:
Q_REQUIRED_RESULT Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override;
void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) override;
Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() override;
Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const override;
private:
QVector<Utils::AkonadiInstanceInfo> mListAkonadiInstanceInfo;
};
......
......@@ -96,3 +96,10 @@ void ExportCalendarsJobInterfaceTest::exportCalendarConfig()
file->start();
delete exportNote;
}
QString ExportCalendarsJobInterfaceTestImpl::resourcePath(const QString &identifier) const
{
ResourceConverterTest converter;
const QString url = converter.resourcePath(identifier);
return url;
}
......@@ -39,6 +39,7 @@ protected:
void convertCollectionListToRealPath(KConfigGroup &group, const QString &currentKey) override;
void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) override;
Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() override;
Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const override;
private:
QVector<Utils::AkonadiInstanceInfo> mListAkonadiInstanceInfo;
};
......
......@@ -117,3 +117,11 @@ QString ExportMailJobInterfaceTestImpl::convertToFullCollectionPath(const qlongl
ResourceConverterTest converter;
return converter.convertToFullCollectionPath(collectionValue);
}
QString ExportMailJobInterfaceTestImpl::resourcePath(const QString &identifier) const
{
ResourceConverterTest converter;
const QString url = converter.resourcePath(identifier);
return url;
}
......@@ -48,6 +48,7 @@ protected:
void exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) override;
Q_REQUIRED_RESULT QVector<Utils::AkonadiInstanceInfo> listOfResource() override;
Q_REQUIRED_RESULT QString storeResources(KZip *archive, const QString &identifier, const QString &path) override;
Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const override;
};
class ExportMailJobInterfaceTest : 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