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

Use identifier directly

parent cff78f1e
......@@ -311,9 +311,8 @@ void AbstractImportExportJob::copyToFile(const KArchiveFile *archivefile, const
}
}
void AbstractImportExportJob::backupResourceFile(const Akonadi::AgentInstance &agent, const QString &defaultPath)
void AbstractImportExportJob::backupResourceFile(const QString &identifier, const QString &defaultPath)
{
const QString identifier = agent.identifier();
const QString archivePath = defaultPath + identifier + QLatin1Char('/');
ResourceConverterImpl converter;
......
......@@ -90,7 +90,7 @@ protected:
Q_REQUIRED_RESULT int mergeConfigMessageBox(const QString &configName) const;
Q_REQUIRED_RESULT bool overwriteConfigMessageBox(const QString &configName) const;
Q_REQUIRED_RESULT Akonadi::Collection::Id convertPathToId(const QString &path);
void backupResourceFile(const Akonadi::AgentInstance &agent, const QString &defaultPath);
void backupResourceFile(const QString &agentIdentifier, const QString &defaultPath);
Q_REQUIRED_RESULT QStringList restoreResourceFile(const QString &resourceName, const QString &defaultPath, const QString &storePath, bool overwriteResources = false);
virtual void addSpecificResourceSettings(const KSharedConfig::Ptr &resourceConfig, const QString &resourceName, QMap<QString, QVariant> &settings);
void restoreConfigFile(const QString &configNameStr);
......
......@@ -89,7 +89,7 @@ void ExportAddressbookJobInterfaceImpl::slotWriteNextArchiveResource()
QTimer::singleShot(0, this, &ExportAddressbookJobInterfaceImpl::slotAddressbookJobTerminated);
}
} else if (identifier.contains(QLatin1String("akonadi_vcard_resource_"))) {
backupResourceFile(agent, Utils::addressbookPath());
backupResourceFile(identifier, Utils::addressbookPath());
QTimer::singleShot(0, this, &ExportAddressbookJobInterfaceImpl::slotAddressbookJobTerminated);
} else {
QTimer::singleShot(0, this, &ExportAddressbookJobInterfaceImpl::slotAddressbookJobTerminated);
......
......@@ -86,7 +86,7 @@ void ExportAlarmJobInterfaceImpl::slotWriteNextArchiveResource()
QTimer::singleShot(0, this, &ExportAlarmJobInterfaceImpl::slotAlarmJobTerminated);
}
} else if (identifier.contains(QLatin1String("akonadi_kalarm_resource_"))) {
backupResourceFile(agent, Utils::alarmPath());
backupResourceFile(identifier, Utils::alarmPath());
QTimer::singleShot(0, this, &ExportAlarmJobInterfaceImpl::slotAlarmJobTerminated);
} else {
QTimer::singleShot(0, this, &ExportAlarmJobInterfaceImpl::slotAlarmJobTerminated);
......
......@@ -104,7 +104,7 @@ void ExportCalendarJobInterfaceImpl::slotWriteNextArchiveResource()
QTimer::singleShot(0, this, &ExportCalendarJobInterfaceImpl::slotCalendarJobTerminated);
}
} else if (identifier.contains(QLatin1String("akonadi_ical_resource_"))) {
backupResourceFile(agent, Utils::calendarPath());
backupResourceFile(identifier, Utils::calendarPath());
QTimer::singleShot(0, this, &ExportCalendarJobInterfaceImpl::slotCalendarJobTerminated);
} else {
QTimer::singleShot(0, this, &ExportCalendarJobInterfaceImpl::slotCalendarJobTerminated);
......
......@@ -110,7 +110,7 @@ void ExportMailJobInterfaceImpl::slotWriteNextArchiveResource()
QTimer::singleShot(0, this, &ExportMailJobInterfaceImpl::slotMailsJobTerminated);
}
} else if (identifier.contains(QLatin1String("akonadi_mbox_resource_"))) {
backupResourceFile(agent, Utils::addressbookPath());
backupResourceFile(identifier, Utils::addressbookPath());
QTimer::singleShot(0, this, &ExportMailJobInterfaceImpl::slotMailsJobTerminated);
} else {
QTimer::singleShot(0, this, &ExportMailJobInterfaceImpl::slotMailsJobTerminated);
......
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