summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-06-10 14:52:15 +0200
committerkh1 <qt-info@nokia.com>2011-06-10 14:52:15 +0200
commitf7590603a2bb7fd842eb505b0f51762b370c5a46 (patch)
tree05c5eb7b87359fd735a04539566e2497834ae8d7 /installerbuilder
parent8cff7231bb566c83e20571cee722a4edfa9475a1 (diff)
Add one more constant.
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/common/installersettings.cpp2
-rw-r--r--installerbuilder/libinstaller/licenseoperation.cpp2
-rw-r--r--installerbuilder/libinstaller/qinstaller.cpp4
-rw-r--r--installerbuilder/libinstaller/qinstaller_p.cpp6
-rw-r--r--installerbuilder/libinstaller/qinstallerglobal.h2
-rw-r--r--installerbuilder/libinstaller/qinstallergui.cpp6
-rw-r--r--installerbuilder/libinstaller/qtpatchoperation.cpp2
-rw-r--r--installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp4
-rw-r--r--installerbuilder/libinstaller/registerqtv2operation.cpp4
-rw-r--r--installerbuilder/libinstaller/registertoolchainoperation.cpp4
-rw-r--r--installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp2
11 files changed, 20 insertions, 18 deletions
diff --git a/installerbuilder/common/installersettings.cpp b/installerbuilder/common/installersettings.cpp
index a1b394628..53dab02ba 100644
--- a/installerbuilder/common/installersettings.cpp
+++ b/installerbuilder/common/installersettings.cpp
@@ -185,7 +185,7 @@ InstallerSettings InstallerSettings::fromFileAndPrefix(const QString &path, cons
s.d->runProgram = readChild(root, QLatin1String("RunProgram"));
s.d->runProgramDescription = readChild(root, QLatin1String("RunProgramDescription"));
s.d->startMenuDir = readChild(root, QLatin1String("StartMenuDir"));
- s.d->targetDir = readChild(root, QLatin1String("TargetDir"));
+ s.d->targetDir = readChild(root, scTargetDir);
s.d->adminTargetDir = readChild(root, QLatin1String("AdminTargetDir"));
s.d->icon = readChild(root, QLatin1String("Icon"));
s.d->removeTargetDir = readChild(root, QLatin1String("RemoveTargetDir"), scTrue);
diff --git a/installerbuilder/libinstaller/licenseoperation.cpp b/installerbuilder/libinstaller/licenseoperation.cpp
index 968cc6b25..a65de500d 100644
--- a/installerbuilder/libinstaller/licenseoperation.cpp
+++ b/installerbuilder/libinstaller/licenseoperation.cpp
@@ -70,7 +70,7 @@ bool LicenseOperation::performOperation()
return false;
}
- QString targetDir = QString::fromLatin1("%1/%2").arg(installer->value(QLatin1String("TargetDir")),
+ QString targetDir = QString::fromLatin1("%1/%2").arg(installer->value(scTargetDir),
QLatin1String("Licenses"));
QDir dir;
diff --git a/installerbuilder/libinstaller/qinstaller.cpp b/installerbuilder/libinstaller/qinstaller.cpp
index 5ceb04f4d..0a123f8ce 100644
--- a/installerbuilder/libinstaller/qinstaller.cpp
+++ b/installerbuilder/libinstaller/qinstaller.cpp
@@ -595,7 +595,7 @@ Installer::Installer(qint64 magicmaker,
Installer::~Installer()
{
if (!isUninstaller() && !(isInstaller() && status() == Installer::Canceled)) {
- QDir targetDir(value(QLatin1String("TargetDir")));
+ QDir targetDir(value(scTargetDir));
QString logFileName = targetDir.absoluteFilePath(value(QLatin1String("LogFileName"),
QLatin1String("InstallationLog.txt")));
QInstaller::VerboseWriter::instance()->setOutputStream(logFileName);
@@ -1440,7 +1440,7 @@ QString Installer::value(const QString &key, const QString &defaultValue) const
return registry.value(regKey).toString();
}
#else
- if (key == QLatin1String("TargetDir")) {
+ if (key == scTargetDir) {
const QString dir = d->m_vars.value(key, defaultValue);
if (dir.startsWith(QLatin1String("~/")))
return QDir::home().absoluteFilePath(dir.mid(2));
diff --git a/installerbuilder/libinstaller/qinstaller_p.cpp b/installerbuilder/libinstaller/qinstaller_p.cpp
index 0aee430be..e2aafb487 100644
--- a/installerbuilder/libinstaller/qinstaller_p.cpp
+++ b/installerbuilder/libinstaller/qinstaller_p.cpp
@@ -253,7 +253,7 @@ bool InstallerPrivate::performOperationThreaded(KDUpdater::UpdateOperation *op,
QString InstallerPrivate::targetDir() const
{
- return q->value(QLatin1String("TargetDir"));
+ return q->value(scTargetDir);
}
QString InstallerPrivate::configurationFileName() const
@@ -355,10 +355,10 @@ void InstallerPrivate::initialize()
m_vars.insert(QLatin1String("RunProgramDescription"), desc);
#ifdef Q_WS_X11
if (m_launchedAsRoot)
- m_vars.insert(QLatin1String("TargetDir"), replaceVariables(m_installerSettings.adminTargetDir()));
+ m_vars.insert(scTargetDir, replaceVariables(m_installerSettings.adminTargetDir()));
else
#endif
- m_vars.insert(QLatin1String("TargetDir"), replaceVariables(m_installerSettings.targetDir()));
+ m_vars.insert(scTargetDir, replaceVariables(m_installerSettings.targetDir()));
m_vars.insert(QLatin1String("RemoveTargetDir"), replaceVariables(m_installerSettings.removeTargetDir()));
QSettingsWrapper creatorSettings(QSettingsWrapper::IniFormat, QSettingsWrapper::UserScope,
diff --git a/installerbuilder/libinstaller/qinstallerglobal.h b/installerbuilder/libinstaller/qinstallerglobal.h
index 1fb7cc081..918d29682 100644
--- a/installerbuilder/libinstaller/qinstallerglobal.h
+++ b/installerbuilder/libinstaller/qinstallerglobal.h
@@ -92,6 +92,8 @@ static const QLatin1String scInstalled("Installed");
static const QLatin1String scUninstalled("Uninstalled");
static const QLatin1String scCurrentState("CurrentState");
+static const QLatin1String scTargetDir("TargetDir");
+
}
#endif // QINSTALLER_GLOBAL_H
diff --git a/installerbuilder/libinstaller/qinstallergui.cpp b/installerbuilder/libinstaller/qinstallergui.cpp
index 86e857d41..ed98317c5 100644
--- a/installerbuilder/libinstaller/qinstallergui.cpp
+++ b/installerbuilder/libinstaller/qinstallergui.cpp
@@ -1118,7 +1118,7 @@ void TargetDirectoryPage::setTargetDir(const QString &dirName)
void TargetDirectoryPage::initializePage()
{
- QString targetDir = installer()->value(QLatin1String("TargetDir"));
+ QString targetDir = installer()->value(scTargetDir);
if (targetDir.isEmpty()) {
targetDir = QDir::homePath() + QDir::separator();
// prevent spaces in the default target directory
@@ -1174,7 +1174,7 @@ void TargetDirectoryPage::entering()
void TargetDirectoryPage::leaving()
{
- installer()->setValue(QLatin1String("TargetDir"), targetDir());
+ installer()->setValue(scTargetDir, targetDir());
}
void TargetDirectoryPage::targetDirSelected()
@@ -1318,7 +1318,7 @@ ReadyForInstallationPage::ReadyForInstallationPage(Installer* installer)
void ReadyForInstallationPage::entering()
{
setCommitPage(true);
- const QString target = installer()->value(QLatin1String("TargetDir"));
+ const QString target = installer()->value(scTargetDir);
if (installer()->isUninstaller()) {
setTitle(tr("Ready to Uninstall"));
diff --git a/installerbuilder/libinstaller/qtpatchoperation.cpp b/installerbuilder/libinstaller/qtpatchoperation.cpp
index e6da1ee18..d2909fe77 100644
--- a/installerbuilder/libinstaller/qtpatchoperation.cpp
+++ b/installerbuilder/libinstaller/qtpatchoperation.cpp
@@ -315,7 +315,7 @@ bool QtPatchOperation::performOperation()
return false;
}
Q_CHECK_PTR(installer);
- successMacRelocating = relocator.apply(newQtPathStr, installer->value(QLatin1String("TargetDir")));
+ successMacRelocating = relocator.apply(newQtPathStr, installer->value(scTargetDir));
if (!successMacRelocating)
{
setError(UserDefinedError);
diff --git a/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp b/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp
index 92f282788..3be2b6b3d 100644
--- a/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp
+++ b/installerbuilder/libinstaller/registerdefaultdebuggeroperation.cpp
@@ -86,7 +86,7 @@ bool RegisterDefaultDebuggerOperation::performOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
toolChainsXmlFilePath = rootInstallPath + QLatin1String(ToolChainSettingsSuffixPath);
int argCounter = 0;
@@ -126,7 +126,7 @@ bool RegisterDefaultDebuggerOperation::undoOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
toolChainsXmlFilePath = rootInstallPath + QLatin1String(ToolChainSettingsSuffixPath);
int argCounter = 0;
diff --git a/installerbuilder/libinstaller/registerqtv2operation.cpp b/installerbuilder/libinstaller/registerqtv2operation.cpp
index e541f2f5b..456745ffa 100644
--- a/installerbuilder/libinstaller/registerqtv2operation.cpp
+++ b/installerbuilder/libinstaller/registerqtv2operation.cpp
@@ -73,7 +73,7 @@ bool RegisterQtInCreatorV2Operation::performOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
if (rootInstallPath.isEmpty() || !QDir(rootInstallPath).exists()) {
setError(UserDefinedError);
setErrorString(tr("The given TargetDir %1 is not a valid/existing dir.").arg(rootInstallPath));
@@ -149,7 +149,7 @@ bool RegisterQtInCreatorV2Operation::undoOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
int argCounter = 0;
const QString &versionName = args.value(argCounter++);
diff --git a/installerbuilder/libinstaller/registertoolchainoperation.cpp b/installerbuilder/libinstaller/registertoolchainoperation.cpp
index 0dbd2b75c..324e9a01c 100644
--- a/installerbuilder/libinstaller/registertoolchainoperation.cpp
+++ b/installerbuilder/libinstaller/registertoolchainoperation.cpp
@@ -79,7 +79,7 @@ bool RegisterToolChainOperation::performOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
toolChainsXmlFilePath = rootInstallPath + QLatin1String(ToolChainSettingsSuffixPath);
QtCreatorToolChain toolChain;
@@ -134,7 +134,7 @@ bool RegisterToolChainOperation::undoOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
toolChainsXmlFilePath = rootInstallPath + QLatin1String(ToolChainSettingsSuffixPath);
QtCreatorToolChain toolChain;
diff --git a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp
index 89853a27c..1344cd5a2 100644
--- a/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp
+++ b/installerbuilder/libinstaller/updatecreatorsettingsfrom21to22operation.cpp
@@ -294,7 +294,7 @@ bool UpdateCreatorSettingsFrom21To22Operation::performOperation()
setErrorString(tr("Needed installer object in \"%1\" operation is empty.").arg(name()));
return false;
}
- const QString &rootInstallPath = installer->value(QLatin1String("TargetDir"));
+ const QString &rootInstallPath = installer->value(scTargetDir);
QString toolChainsXmlFilePath = rootInstallPath + QLatin1String(ToolChainSettingsSuffixPath);