diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2021-10-08 16:42:39 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2021-10-13 06:39:43 +0000 |
commit | 9f1b09d15a84d185e607057fa9c4a1d4657e21d3 (patch) | |
tree | 150bf69f5550e4daed4049cabbd83320cd36c3f5 | |
parent | 899de36a0dabdda432809b480dbac0b42afe5723 (diff) |
Replace occurrences of "TargetDir" string with 'scTargetDir' constant
This makes it easier to grep usage of variable and we shouldn't really
use the magic string as there is already a constant.
Change-Id: I96a6b3901f79127b7cf71494643e2cd038df6670
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r-- | src/libs/installer/extractarchiveoperation.cpp | 4 | ||||
-rw-r--r-- | src/sdk/commandlineinterface.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/installer/extractarchiveoperation.cpp b/src/libs/installer/extractarchiveoperation.cpp index b2bda24a2..7660dadb0 100644 --- a/src/libs/installer/extractarchiveoperation.cpp +++ b/src/libs/installer/extractarchiveoperation.cpp @@ -128,7 +128,7 @@ bool ExtractArchiveOperation::performOperation() // TargetDir for saving filenames, otherwise those would be saved to // extracted folder. if (packageManager()) - installDir = packageManager()->value(QLatin1String("TargetDir")); + installDir = packageManager()->value(scTargetDir); const QString resourcesPath = installDir + QLatin1Char('/') + QLatin1String("installerResources"); QString fileDirectory = resourcesPath + QLatin1Char('/') + archivePath.section(QLatin1Char('/'), 1, 1, QString::SectionSkipEmpty) + QLatin1Char('/'); @@ -184,7 +184,7 @@ bool ExtractArchiveOperation::undoOperation() bool useStringListType(value(QLatin1String("files")).type() == QVariant::StringList); QString targetDir = arguments().at(1); if (packageManager()) - targetDir = packageManager()->value(QLatin1String("TargetDir")); + targetDir = packageManager()->value(scTargetDir); QStringList files; if (useStringListType) { files = value(QLatin1String("files")).toStringList(); diff --git a/src/sdk/commandlineinterface.cpp b/src/sdk/commandlineinterface.cpp index 59e9afe90..a63b2a5bf 100644 --- a/src/sdk/commandlineinterface.cpp +++ b/src/sdk/commandlineinterface.cpp @@ -264,7 +264,7 @@ bool CommandLineInterface::setTargetDir() if (m_parser.isSet(CommandLineOptions::scRootLong)) { targetDir = m_parser.value(CommandLineOptions::scRootLong); } else { - targetDir = m_core->value(QLatin1String("TargetDir")); + targetDir = m_core->value(QInstaller::scTargetDir); qCDebug(QInstaller::lcInstallerInstallLog) << "No target directory specified, using default value:" << targetDir; } if (m_core->checkTargetDir(targetDir)) { @@ -272,7 +272,7 @@ bool CommandLineInterface::setTargetDir() if (!targetDirWarning.isEmpty()) { qCWarning(QInstaller::lcInstallerInstallLog) << m_core->targetDirWarning(targetDir); } else { - m_core->setValue(QLatin1String("TargetDir"), targetDir); + m_core->setValue(QInstaller::scTargetDir, targetDir); return true; } } |