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

Add debug info when we can't create file

parent cd63ef90
Pipeline #95006 passed with stage
in 10 minutes and 47 seconds
......@@ -283,7 +283,7 @@ void AbstractImportExportJob::copyToFile(const KArchiveFile *archivefile, const
}
if (!archivefile->copyTo(copyToDirName)) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "file " << filename << " can not copy to " << dest;
qCWarning(PIMDATAEXPORTERCORE_LOG) << "copyToFile file " << filename << " can not copy to " << dest;
}
QFile file;
file.setFileName(copyToDirName + QLatin1Char('/') + filename);
......@@ -338,7 +338,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
static_cast<const KArchiveFile *>(fileResouceEntry);
if (!file->copyTo(copyToDirName)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "file " << value.akonadiConfigFile
<< "AbstractImportExportJob file " << value.akonadiConfigFile
<< " can not copy to " << copyToDirName;
}
QString resourceName(file->name());
......@@ -357,7 +357,7 @@ QStringList AbstractImportExportJob::restoreResourceFile(const QString &resource
static_cast<const KArchiveFile *>(dataResouceEntry);
if (!file->copyTo(newUrl)) {
qCWarning(PIMDATAEXPORTERCORE_LOG)
<< "file " << dataFile << " can not copy to "
<< "AbstractImportExportJob: file " << dataFile << " can not copy to "
<< newUrl;
}
}
......@@ -403,7 +403,7 @@ bool AbstractImportExportJob::copyArchiveFileTo(const KArchiveFile *file, const
{
const bool result = file->copyTo(destination);
if (!result) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "file " << file->name() << " can not copy to " << destination;
qCWarning(PIMDATAEXPORTERCORE_LOG) << "copyArchiveFileTo file " << file->name() << " can not copy to " << destination;
}
return result;
}
......@@ -411,7 +411,7 @@ bool AbstractImportExportJob::copyArchiveFileTo(const KArchiveFile *file, const
void AbstractImportExportJob::extractZipFile(const KArchiveFile *file, const QString &source, const QString &destination, bool isStoredAsZippedArchive)
{
if (!file->copyTo(source)) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "file " << file->name() << " can not copy to " << source;
qCWarning(PIMDATAEXPORTERCORE_LOG) << "extractZipFile file " << file->name() << " can not copy to " << source;
}
QDir dest(destination);
if (!dest.exists()) {
......
......@@ -32,7 +32,9 @@ QString ResourceConverterBase::adaptResourcePath(const KSharedConfigPtr &resourc
QString currentPath = installDefaultDirectory() + QLatin1Char('/') + storedData;
newUrl = (currentPath + QLatin1Char('/') + fileInfo.fileName());
if (!QDir(currentPath).exists()) {
QDir().mkdir(currentPath);
if (!QDir().mkdir(currentPath)) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "Impossible to create subpath " << currentPath;
}
}
}
if (QFileInfo::exists(newUrl)) {
......@@ -42,7 +44,9 @@ QString ResourceConverterBase::adaptResourcePath(const KSharedConfigPtr &resourc
const QString currentPath = fileInfo.path() + QLatin1Char('/') + QString::number(i) + QLatin1Char('/');
newFileName = currentPath + fileInfo.fileName();
if (!QFileInfo::exists(newFileName)) {
QDir().mkdir(currentPath);
if (!QDir().mkdir(currentPath)) {
qCWarning(PIMDATAEXPORTERCORE_LOG) << "Impossible to create subpath " << currentPath;
}
break;
}
}
......
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