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

Fix autotest + fix bug when we import resource

parent 0ee12845
......@@ -387,6 +387,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
Q_EMIT info(i18n("Resources restored."));
} else {
Q_EMIT error(i18n("No resources files found."));
qDebug() << " resourceBaseName " << resourceBaseName;
}
return resourceToSync;
}
......
......@@ -102,7 +102,7 @@ void ExportAlarmJobInterfaceTest::exportAlarm_data()
QTest::addColumn<Utils::StoredTypes>("options");
Utils::StoredTypes options = {Utils::StoredType::Config};
const QByteArray pathConfig(QByteArray(PIMDATAEXPORTER_DIR) + "/export/");
QTest::newRow("alarmonlyconfig") << pathConfig + QByteArray("alarmonlyconfig/");
QTest::newRow("alarmonlyconfig") << pathConfig + QByteArray("alarmonlyconfig/") << options;
options = {Utils::StoredType::Config|Utils::StoredType::Resources};
QTest::newRow("alarmonlyconfig") << pathConfig + QByteArray("alarmconfigresources/") << options;
}
......
calendar/akonadi_ical_resource_2/agent_config_akonadi_ical_resource_2
calendar/akonadi_ical_resource_2/akonadi_ical_resource_2rc
calendar/akonadi_ical_resource_2/std.ics
configs/korganizerrc
configs/eventviewsrc
configs/korgacrc
......
akonadi_ical_resource
schedule.ics
Path /tmp/backupcalendar//std.ics
0
--------------------------
akonadi_ical_resource_new_resource_0
--------------------------
......@@ -82,8 +82,8 @@ void ImportCalendarJobInterfaceTest::importCalendar_data()
const QByteArray pathConfig(QByteArray(PIMDATAEXPORTER_DIR) + "/import/");
QTest::newRow("calendaronlyconfig") << QString::fromLatin1(pathConfig) << QStringLiteral("/calendaronlyconfig/") << options;
options = {Utils::StoredType::Config|Utils::StoredType::Resources};
QTest::newRow("calendarconfigandresource") << QString::fromLatin1(pathConfig) << QStringLiteral("/calendarconfigandresource/") << options;
options = {Utils::StoredType::Config|Utils::StoredType::Resources};
QTest::newRow("calendarconfigandresource") << QString::fromLatin1(pathConfig) << QStringLiteral("/calendarconfigandresource/") << options;
}
void ImportCalendarJobInterfaceTest::importCalendar()
......
......@@ -263,8 +263,7 @@ void ImportCalendarJobInterface::restoreResources()
for (int i = 0; i < numberOfResourceFile; ++i) {
ResourceFiles value = mListResourceFile.at(i);
QMap<QString, QVariant> settings;
if (value.akonadiConfigFile.contains(QLatin1String("akonadi_icaldir_resource_"))
|| value.akonadiConfigFile.contains(QLatin1String("akonadi_ical_resource_"))) {
if (value.akonadiConfigFile.contains(QLatin1String("akonadi_icaldir_resource_"))) {
const KArchiveEntry *fileResouceEntry = mArchiveDirectory->entry(value.akonadiConfigFile);
if (fileResouceEntry && fileResouceEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(fileResouceEntry);
......
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