2323#include < Distributions/defaultdistro.h>
2424#include < Distributions/qif.h>
2525#include < Distributions/ziparhive.h>
26+ #include < qaplatformutils.h>
2627
2728
2829/* *
@@ -740,7 +741,7 @@ bool ConfigParser::parseDeployMode(bool checkBin) {
740741
741742 if (!initQmake ()) {
742743
743- if (DeployCore ::isSnap ()) {
744+ if (QuasarAppUtils::PlatformUtils ::isSnap ()) {
744745 QuasarAppUtils::Params::log (" If you are using qmake from the system repository,"
745746 " then you must use the classic version of CQtDeployer instead of the snap version."
746747 " This is due to the fact that the snap version"
@@ -1024,9 +1025,11 @@ void ConfigParser::initIgnoreList()
10241025 envUnix.addEnv (Envirement::recursiveInvairement (" /lib" , 3 ));
10251026 envUnix.addEnv (Envirement::recursiveInvairement (" /usr/lib" , 3 ));
10261027
1027- if (DeployCore::isSnap ()) {
1028- envUnix.addEnv (Envirement::recursiveInvairement (DeployCore::transportPathToSnapRoot (" /lib" ), 3 ));
1029- envUnix.addEnv (Envirement::recursiveInvairement (DeployCore::transportPathToSnapRoot (" /usr/lib" ), 3 ));
1028+ if (QuasarAppUtils::PlatformUtils::isSnap ()) {
1029+ envUnix.addEnv (Envirement::recursiveInvairement (
1030+ QuasarAppUtils::PlatformUtils::transportPathToSnapRoot (" /lib" ), 3 ));
1031+ envUnix.addEnv (Envirement::recursiveInvairement (
1032+ QuasarAppUtils::PlatformUtils::transportPathToSnapRoot (" /usr/lib" ), 3 ));
10301033 }
10311034
10321035 ruleUnix.prority = SystemLib;
@@ -1113,7 +1116,7 @@ void ConfigParser::initIgnoreEnvList() {
11131116 }
11141117
11151118 // forbid pathes of the snap container
1116- if (DeployCore ::isSnap ()) {
1119+ if (QuasarAppUtils::PlatformUtils ::isSnap ()) {
11171120 ignoreEnvList.push_back (" /lib" );
11181121 ignoreEnvList.push_back (" /usr/lib" );
11191122 }
@@ -1134,7 +1137,7 @@ QString ConfigParser::getPathFrmoQmakeLine(const QString &in) const {
11341137 auto list = in.split (' :' );
11351138 if (list.size () > 1 ) {
11361139 list.removeAt (0 );
1137- return DeployCore ::transportPathToSnapRoot (
1140+ return QuasarAppUtils::PlatformUtils ::transportPathToSnapRoot (
11381141 QFileInfo (list.join (' :' )).absoluteFilePath ().remove (' \r ' ));
11391142 }
11401143
@@ -1151,7 +1154,7 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
11511154
11521155 // Invoke qmake executable only when qmake paths exclude snapRootFS path.
11531156 // Because files in snapRootFS is not executable ...
1154- if (!qmake.contains (DeployCore ::snapRootFS ()) && setQmake (qmake)) {
1157+ if (!qmake.contains (QuasarAppUtils::PlatformUtils ::snapRootFS ()) && setQmake (qmake)) {
11551158 return true ;
11561159 }
11571160
@@ -1167,8 +1170,8 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
11671170 QString debianQtRoot = QString (" /usr/lib/%0/qt%1" ).
11681171 arg (neededPlatform).arg (qtVersion);
11691172
1170- if (DeployCore ::isSnap ()) {
1171- debianQtRoot = DeployCore ::snapRootFS () + debianQtRoot;
1173+ if (QuasarAppUtils::PlatformUtils ::isSnap ()) {
1174+ debianQtRoot = QuasarAppUtils::PlatformUtils ::snapRootFS () + debianQtRoot;
11721175 }
11731176
11741177 if (!setQtDir (debianQtRoot)) {
@@ -1189,7 +1192,7 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
11891192 }
11901193
11911194 // For snap package of cqtdeplyer it is normal behavior
1192- if (!DeployCore ::isSnap ()) {
1195+ if (!QuasarAppUtils::PlatformUtils ::isSnap ()) {
11931196 QuasarAppUtils::Params::log (" Failed to execute the qmake process!"
11941197 " Trying to initialize Qt directories from path: " + dir.absolutePath (),
11951198 QuasarAppUtils::Warning);
@@ -1214,7 +1217,8 @@ bool ConfigParser::initQmake() {
12141217 return true ;
12151218 }
12161219
1217- auto qmake = DeployCore::transportPathToSnapRoot (QuasarAppUtils::Params::getArg (" qmake" ));
1220+ auto qmake = QuasarAppUtils::PlatformUtils::transportPathToSnapRoot (
1221+ QuasarAppUtils::Params::getArg (" qmake" ));
12181222
12191223 QFileInfo info (qmake);
12201224
@@ -1409,7 +1413,7 @@ bool ConfigParser::initExtraPath() {
14091413 QDir dir;
14101414
14111415 for (const auto &i : listLibDir) {
1412- QFileInfo info (DeployCore ::transportPathToSnapRoot (i));
1416+ QFileInfo info (QuasarAppUtils::PlatformUtils ::transportPathToSnapRoot (i));
14131417 if (info.isDir ()) {
14141418 if (_config.targets ().contains (info.absoluteFilePath ())) {
14151419 QuasarAppUtils::Params::log (" Skip the extra library path because it is target!" ,
@@ -1563,7 +1567,7 @@ void ConfigParser::initEnvirement() {
15631567 QProcessEnvironment env = QProcessEnvironment::systemEnvironment ();
15641568 auto path = env.value (" PATH" );
15651569
1566- if (!DeployCore ::isSnap ()) {
1570+ if (!QuasarAppUtils::PlatformUtils ::isSnap ()) {
15671571
15681572 _config.envirement .addEnv (env.value (" LD_LIBRARY_PATH" ));
15691573 _config.envirement .addEnv (path);
@@ -1572,8 +1576,8 @@ void ConfigParser::initEnvirement() {
15721576 QStringList dirs;
15731577#ifdef Q_OS_LINUX
15741578
1575- dirs.append (getDirsRecursive (DeployCore ::transportPathToSnapRoot (" /lib" ), 5 ));
1576- dirs.append (getDirsRecursive (DeployCore ::transportPathToSnapRoot (" /usr/lib" ), 5 ));
1579+ dirs.append (getDirsRecursive (QuasarAppUtils::PlatformUtils ::transportPathToSnapRoot (" /lib" ), 5 ));
1580+ dirs.append (getDirsRecursive (QuasarAppUtils::PlatformUtils ::transportPathToSnapRoot (" /usr/lib" ), 5 ));
15771581
15781582#else
15791583 auto winPath = findWindowsPath (path);
@@ -1592,14 +1596,14 @@ void ConfigParser::initEnvirement() {
15921596
15931597bool ConfigParser::checkSnapPermisions () {
15941598
1595- if (!DeployCore ::isSnap ())
1599+ if (!QuasarAppUtils::PlatformUtils ::isSnap ())
15961600 return true ;
15971601
15981602
15991603 bool system = QuasarAppUtils::Params::isEndable (" deploySystem" ) ||
16001604 QuasarAppUtils::Params::isEndable (" extraLibs" );
16011605
1602- if (system && !DeployCore ::checkSystemBakupSnapInterface ()) {
1606+ if (system && !QuasarAppUtils::PlatformUtils ::checkSystemBakupSnapInterface ()) {
16031607
16041608 QuasarAppUtils::Params::log (" You use a deploySystem or extraLibs options,"
16051609 " but not added permision system-backup for cqtdeployer."
0 commit comments