Commit 10b7de9a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Exclude some file

parent c786358e
......@@ -50,6 +50,9 @@ void CompareImportFile::compareFile()
if (file == QLatin1String("information/exportdatatype.xml") || file == QLatin1String("information/VERSION_2")) {
continue;
}
if (file.startsWith(mExcludePath)) {
continue;
}
CompareFileHelper::compareFile(mListFilePath + QStringLiteral("/references/") + file, mInstallPath + QLatin1Char('/') + file);
}
}
......@@ -83,3 +86,13 @@ void CompareImportFile::setInstallPath(const QString &installPath)
{
mInstallPath = installPath;
}
QString CompareImportFile::excludePath() const
{
return mExcludePath;
}
void CompareImportFile::setExcludePath(const QString &excludePath)
{
mExcludePath = excludePath;
}
......@@ -39,10 +39,14 @@ public:
Q_REQUIRED_RESULT QString installPath() const;
void setInstallPath(const QString &installPath);
Q_REQUIRED_RESULT QString excludePath() const;
void setExcludePath(const QString &excludePath);
private:
QString mArchiveFilePath;
QString mListFilePath;
QString mInstallPath;
QString mExcludePath;
};
#endif // COMPAREIMPORTFILE_H
......@@ -83,6 +83,7 @@ void ImportNotesJobInterfaceTest::importNoteConfig()
TestImportFile *file = new TestImportFile(zipFilePath + testPath, this);
file->setPathConfig(zipFilePath + testPath);
file->setExtractPath(QDir::tempPath() + testPath);
file->setExcludePath(QStringLiteral("note/"));
ImportNotesJobInterfaceTestImpl *impl = new ImportNotesJobInterfaceTestImpl(this, {Utils::StoredType::Config}, file->archiveStorage(), 1);
file->setAbstractImportExportJob(impl);
file->start();
......
......@@ -73,6 +73,7 @@ void TestImportFile::start()
compareExportFile.setArchiveFilePath(mArchivePath);
compareExportFile.setListFilePath(mPathConfig);
compareExportFile.setInstallPath(mExtractPath);
compareExportFile.setExcludePath(mExcludePath);
compareExportFile.compareFile();
#ifdef REMOVE_TEMPORARY_DIR
......@@ -114,3 +115,13 @@ void TestImportFile::setExtractPath(const QString &extractPath)
{
mExtractPath = extractPath;
}
QString TestImportFile::excludePath() const
{
return mExcludePath;
}
void TestImportFile::setExcludePath(const QString &excludePath)
{
mExcludePath = excludePath;
}
......@@ -41,12 +41,17 @@ public:
void setPathConfig(const QString &pathConfig);
void setExtractPath(const QString &extractPath);
Q_REQUIRED_RESULT QString excludePath() const;
void setExcludePath(const QString &excludePath);
private:
AbstractImportExportJob *mAbstractImportExportJob = nullptr;
ArchiveStorage *mArchiveStorage = nullptr;
QString mArchivePath;
QString mPathConfig;
QString mExtractPath;
QString mExcludePath;
};
#endif // TESTIMPORTFILE_H
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