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

Fix coding style

parent 47a66d42
......@@ -336,13 +336,13 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
if (value.akonadiConfigFile.contains(resourceBaseName + QLatin1Char('_'))) {
const KArchiveEntry *fileResouceEntry = mArchiveDirectory->entry(value.akonadiConfigFile);
if (fileResouceEntry && fileResouceEntry->isFile()) {
const auto file =
static_cast<const KArchiveFile *>(fileResouceEntry);
if (!file->copyTo(copyToDirName)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "AbstractImportExportJob file " << value.akonadiConfigFile
<< " can not copy to " << copyToDirName;
}
const auto file =
static_cast<const KArchiveFile *>(fileResouceEntry);
if (!file->copyTo(copyToDirName)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "AbstractImportExportJob file " << value.akonadiConfigFile
<< " can not copy to " << copyToDirName;
}
QString resourceName(file->name());
QString filename(file->name());
......@@ -355,13 +355,13 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
const QString dataFile = value.akonadiResources;
const KArchiveEntry *dataResouceEntry = mArchiveDirectory->entry(dataFile);
if (dataResouceEntry->isFile()) {
const auto file =
static_cast<const KArchiveFile *>(dataResouceEntry);
if (!file->copyTo(newUrl)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "AbstractImportExportJob: file " << dataFile << " can not copy to "
<< newUrl;
}
const auto file =
static_cast<const KArchiveFile *>(dataResouceEntry);
if (!file->copyTo(newUrl)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "AbstractImportExportJob: file " << dataFile << " can not copy to "
<< newUrl;
}
}
settings.insert(QStringLiteral("Path"), newUrl);
......@@ -369,13 +369,13 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
if (!agentConfigFile.isEmpty()) {
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const auto file = static_cast<const KArchiveFile *>(
akonadiAgentConfigEntry);
file->copyTo(copyToDirName);
resourceName = file->name();
const QString configPath =
copyToDirName + QLatin1Char('/') + resourceName;
filename = Utils::akonadiAgentName(configPath);
const auto file = static_cast<const KArchiveFile *>(
akonadiAgentConfigEntry);
file->copyTo(copyToDirName);
resourceName = file->name();
const QString configPath =
copyToDirName + QLatin1Char('/') + resourceName;
filename = Utils::akonadiAgentName(configPath);
}
}
......
......@@ -308,33 +308,33 @@ void ImportCalendarJobInterface::restoreResources()
bool isDirResource = value.akonadiConfigFile.contains(
QLatin1String("akonadi_icaldir_resource_"));
if (dataResouceEntry->isFile()) {
const auto fileEntry =
static_cast<const KArchiveFile *>(dataResouceEntry);
// TODO adapt directory name too
extractZipFile(
fileEntry, copyToDirName, newUrlInfo.path(),
value.akonadiConfigFile.contains(
QLatin1String("akonadi_icaldir_resource_")));
const auto fileEntry =
static_cast<const KArchiveFile *>(dataResouceEntry);
// TODO adapt directory name too
extractZipFile(
fileEntry, copyToDirName, newUrlInfo.path(),
value.akonadiConfigFile.contains(
QLatin1String("akonadi_icaldir_resource_")));
}
settings.insert(QStringLiteral("Path"), newUrl);
settings.insert(QStringLiteral("Path"), newUrl);
const QString agentConfigFile = value.akonadiAgentConfigFile;
if (!agentConfigFile.isEmpty()) {
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const QString agentConfigFile = value.akonadiAgentConfigFile;
if (!agentConfigFile.isEmpty()) {
const KArchiveEntry *akonadiAgentConfigEntry = mArchiveDirectory->entry(agentConfigFile);
if (akonadiAgentConfigEntry->isFile()) {
const auto fileEntry = static_cast<const KArchiveFile *>(
akonadiAgentConfigEntry);
copyArchiveFileTo(fileEntry, copyToDirName);
resourceName = fileEntry->name();
filename = Utils::akonadiAgentName(
copyToDirName + QLatin1Char('/') + resourceName);
}
}
const QString resourceTypeName = isDirResource ? QStringLiteral("akonadi_icaldir_resource") : QStringLiteral("akonadi_ical_resource");
const QString newResource = createResource(resourceTypeName, filename, settings, true);
infoAboutNewResource(newResource);
listResource << newResource;
qCDebug(PIMDATAEXPORTERCORE_LOG) << " newResource" << newResource;
}
}
const QString resourceTypeName = isDirResource ? QStringLiteral("akonadi_icaldir_resource") : QStringLiteral("akonadi_ical_resource");
const QString newResource = createResource(resourceTypeName, filename, settings, true);
infoAboutNewResource(newResource);
listResource << newResource;
qCDebug(PIMDATAEXPORTERCORE_LOG) << " newResource" << newResource;
}
}
}
......
Supports Markdown
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