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

Fix import resources

parent fb4de075
Pipeline #23903 canceled with stage
......@@ -618,3 +618,8 @@ void AbstractImportExportJob::convertRealPathToCollectionList(KConfigGroup &grou
}
}
}
void AbstractImportExportJob::setTempDirName(const QString &tempDirName)
{
mTempDirName = tempDirName;
}
......@@ -55,6 +55,9 @@ public:
ImportExportProgressIndicatorBase *importExportProgressIndicator() const;
//Only for test
void setTempDirName(const QString &tempDirName);
Q_SIGNALS:
void info(const QString &);
void error(const QString &);
......
......@@ -53,6 +53,7 @@ void ImportAlarmJobInterfaceTest::importAlarmConfig()
ImportAlarmJobInterfaceTestImpl *impl = new ImportAlarmJobInterfaceTestImpl(this, options, file->archiveStorage(), 1);
impl->setPathConfig(file->pathConfig());
impl->setExtractPath(file->extractPath());
impl->setTempDirName(file->extractPath());
file->setAbstractImportExportJob(impl);
file->setLoggingFilePath(impl->loggingFilePath());
file->start();
......
......@@ -65,6 +65,7 @@ void ImportMailJobInterfaceTest::importMail()
ImportMailJobInterfaceTestImpl *impl = new ImportMailJobInterfaceTestImpl(this, options, file->archiveStorage(), 1);
impl->setPathConfig(file->pathConfig());
impl->setExtractPath(file->extractPath());
impl->setTempDirName(file->extractPath());
file->setAbstractImportExportJob(impl);
file->setLoggingFilePath(impl->loggingFilePath());
file->start();
......
......@@ -37,7 +37,7 @@ ImportMailJobInterfaceTestImpl::ImportMailJobInterfaceTestImpl(QObject *parent,
ImportMailJobInterfaceTestImpl::~ImportMailJobInterfaceTestImpl()
{
#ifdef REMOVE_TEMPORARY_DIRECTORIES
//QVERIFY(QDir(extractPath()).removeRecursively());
QVERIFY(QDir(extractPath()).removeRecursively());
QVERIFY(QDir(QDir::tempPath() + QLatin1Char('/') + Utils::storeMails()).removeRecursively());
#endif
}
......
......@@ -219,6 +219,7 @@ void ImportMailJobInterface::restoreResources()
if (agentFileConfigEntry && agentFileConfigEntry->isFile()) {
const KArchiveFile *file = static_cast<const KArchiveFile *>(agentFileConfigEntry);
const QString destDirectory = mTempDirName + QLatin1Char('/') + Utils::resourcesPath();
qDebug() << " destDirectory " << destDirectory;
copyArchiveFileTo(file, destDirectory);
const QString filename(file->name());
const QString agentResourceFileName = destDirectory + QLatin1Char('/') + filename;
......
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