Commit 104758d6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix import resource name

parent c68abd95
Pipeline #24060 canceled with stage
......@@ -368,6 +368,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
QDir().mkpath(copyToDirName);
file->copyTo(copyToDirName);
resourceName = file->name();
const QString configPath = copyToDirName + QLatin1Char('/') + resourceName;
......
......@@ -203,6 +203,7 @@ void ImportAddressbookJobInterface::restoreResources()
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
QDir().mkpath(copyToDirName);
copyArchiveFileTo(file, copyToDirName);
resourceName = file->name();
filename = Utils::akonadiAgentName(copyToDirName + QLatin1Char('/') + resourceName);
......
......@@ -156,6 +156,7 @@ void ImportAlarmJobInterface::restoreResources()
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
QDir().mkpath(copyToDirName);
copyArchiveFileTo(file, copyToDirName);
resourceName = file->name();
filename = Utils::akonadiAgentName(copyToDirName + QLatin1Char('/') + resourceName);
......
akonadi_vcard_resource
Notes
Path /tmp/backupaddressbook//akonadi_vcard_resource_1.zip
Path /tmp/backupaddressbook//0/
0
--------------------------
akonadi_vcarddir_resource
Notes
Path /tmp/backupaddressbook//0/
Path /tmp/backupaddressbook//1/
1
--------------------------
akonadi_contacts_resource
Notes
Path /tmp/backupaddressbook//1/
Path /tmp/backupaddressbook//2/
1
--------------------------
akonadi_vcard_resource_new_resource_0
......
akonadi_kalarm_dir_resource
Active Alarms2
Path /tmp/backupalarm//0/
1
--------------------------
......
akonadi_ical_resource
schedule.ics
Path /tmp/backupcalendar//0/
0
--------------------------
......
......@@ -294,6 +294,7 @@ void ImportCalendarJobInterface::restoreResources()
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
QDir().mkpath(copyToDirName);
copyArchiveFileTo(file, copyToDirName);
resourceName = file->name();
filename = Utils::akonadiAgentName(copyToDirName + QLatin1Char('/') + resourceName);
......
......@@ -460,6 +460,7 @@ void ImportMailJobInterface::restoreMails()
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
QDir().mkpath(copyToDirName);
copyArchiveFileTo(file, copyToDirName);
resourceName = file->name();
filename = Utils::akonadiAgentName(copyToDirName + QLatin1Char('/') + resourceName);
......
......@@ -183,6 +183,7 @@ void ImportNotesJobInterface::restoreResources()
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(akonadiAgentConfigEntry);
QDir().mkpath(copyToDirName);
copyArchiveFileTo(file, copyToDirName);
resourceName = file->name();
filename = Utils::akonadiAgentName(copyToDirName + QLatin1Char('/') + resourceName);
......
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