ref #422 added a new level of the distribution-safe libraries

This commit is contained in:
Andrei Yankovich 2020-10-14 20:32:38 +03:00
parent de0cbf06ed
commit f7ff5fe8f4
4 changed files with 36 additions and 1 deletions

View File

@ -1116,7 +1116,7 @@ void ConfigParser::initExtraNames() {
const auto deployExtraNames = [this](const QStringList& listNamesMasks){
for (const auto &i : listNamesMasks) {
if (i.size() > 1) {
_config.extraPaths.addtExtraNamesMasks({i});
_config.allowedPaths.addtExtraNamesMasks({i});
QuasarAppUtils::Params::log(i + " added like a file name mask",
QuasarAppUtils::Info);

View File

@ -41,6 +41,11 @@ public:
*/
Extra extraPaths;
/**
* @brief allowedPaths - it is list with filters for allowed pathes, files or libraries
*/
Extra allowedPaths;
/**
* @brief envirement - envirement for find libraries
*/

View File

@ -135,6 +135,10 @@ LibPriority DeployCore::getLibPriority(const QString &lib) {
return AlienLib;
}
if (isAllowedLib(lib)) {
return AllowedLib;
}
return SystemLib;
}
@ -542,6 +546,11 @@ bool DeployCore::isAlienLib(const QString &lib) {
lib.contains("/PROGRAM FILES", ONLY_WIN_CASE_INSENSIATIVE);
}
bool DeployCore::isAllowedLib(const QString &lib) {
QFileInfo info(lib);
return _config->allowedPaths.contains(info.absoluteFilePath());
}
QStringList DeployCore::Qt3rdpartyLibs(Platform platform) {
QStringList result;

View File

@ -56,11 +56,25 @@ enum Platform {
GeneralFile = 0x0100
};
/**
* @brief The LibPriority enum This is library priority.
* The lower the priority of the topics, the library is the most suitable for distribution.
*/
enum LibPriority : int {
// ================= General Libraryes
/// This is qt libraryes.
QtLib = 0x0,
/// This is user libraryes.
ExtraLib,
/// This is qt 3dParty and user libraryes. (distribution-safe libraries)
AllowedLib,
// ================= System Libraryes
/// This is rest of all libraryes (frm system and another).
SystemLib,
/// This is libraryes from another proggram distributions.
AlienLib,
/// This is General Files.
NotFile = 0xF,
};
@ -166,6 +180,13 @@ public:
static QChar getSeparator(int lvl);
static bool isAlienLib(const QString &lib);
/**
* @brief isAllowedLib This method checks the library if the library is allowed or not, allowet libraryes is added with extraLibs method.
* @param lib This is library fuul path
* @return true if lirary is allowed
*/
static bool isAllowedLib(const QString &lib);
/**
* @brief QtThreethepartyLibs This method return list of 3rdparty libraryes of qt for selected platform.
* @param platform This is OS name.