summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@nokia.com>2012-04-27 14:12:41 +0200
committerTim Jenssen <tim.jenssen@nokia.com>2012-04-27 16:23:36 +0200
commitc862c2820e08435fa2c50611394e2c7e3be9052c (patch)
treec7faa4de9a5e998ca64ef216a6036903738a915f /src/libs/installer
parent29cf8564aa4c2ca9c839b47658e532015444ce58 (diff)
use scCommaRegExp where ever we can
Change-Id: I484e20fd53c2710595c5d4eb28878932eebafe35 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/component.cpp2
-rw-r--r--src/libs/installer/packagemanagercore.cpp7
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp3
-rw-r--r--src/libs/installer/qinstallerglobal.h2
4 files changed, 6 insertions, 8 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index af71f2278..75a41ea31 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -63,8 +63,6 @@ static const QLatin1String scUninstalled("Uninstalled");
static const QLatin1String scCurrentState("CurrentState");
static const QLatin1String scForcedInstallation("ForcedInstallation");
-static QRegExp scCommaRegExp(QLatin1String("\\b(,|, )\\b"));
-
/*!
\class QInstaller::Component
Component describes a component within the installer.
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 8d4c92d31..bb1549fe7 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -1602,7 +1602,7 @@ bool PackageManagerCore::updateComponentData(struct Data &data, Component *compo
// add downloadable archive from xml
const QStringList downloadableArchives = data.package->data(scDownloadableArchives).toString()
- .split(QRegExp(QLatin1String("\\b(,|, )\\b")), QString::SkipEmptyParts);
+ .split(scCommaRegExp, QString::SkipEmptyParts);
if (component->isFromOnlineRepository()) {
foreach (const QString downloadableArchive, downloadableArchives)
@@ -1610,7 +1610,7 @@ bool PackageManagerCore::updateComponentData(struct Data &data, Component *compo
}
const QStringList componentsToReplace = data.package->data(scReplaces).toString()
- .split(QRegExp(QLatin1String("\\b(,|, )\\b")), QString::SkipEmptyParts);
+ .split(scCommaRegExp, QString::SkipEmptyParts);
if (!componentsToReplace.isEmpty()) {
// Store the component (this is a component that replaces others) and all components that
@@ -1760,8 +1760,7 @@ bool PackageManagerCore::fetchUpdaterPackages(const PackagesList &remotes, const
bool isValidUpdate = locals.contains(name);
if (!isValidUpdate && !replaces.isEmpty()) {
- const QStringList possibleNames = replaces.split(QRegExp(QLatin1String("\\b(,|, )\\b")),
- QString::SkipEmptyParts);
+ const QStringList possibleNames = replaces.split(scCommaRegExp, QString::SkipEmptyParts);
foreach (const QString &possibleName, possibleNames) {
if (locals.contains(possibleName)) {
isValidUpdate = true;
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 313ad3ba5..d983ba4a5 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -2290,8 +2290,7 @@ bool PackageManagerCorePrivate::appendComponentsToUninstall(const QList<Componen
foreach (Component *c, installedComponents) {
const QString replaces = c->value(scReplaces);
- QStringList possibleNames = replaces.split(QRegExp(QLatin1String("\\b(,|, )\\b")),
- QString::SkipEmptyParts);
+ QStringList possibleNames = replaces.split(scCommaRegExp, QString::SkipEmptyParts);
possibleNames.append(c->name());
foreach (const QString &possibleName, possibleNames)
autoDependencies.removeAll(possibleName);
diff --git a/src/libs/installer/qinstallerglobal.h b/src/libs/installer/qinstallerglobal.h
index 57e4a0bb9..2c9b8e401 100644
--- a/src/libs/installer/qinstallerglobal.h
+++ b/src/libs/installer/qinstallerglobal.h
@@ -53,6 +53,8 @@ namespace QInstaller {
#define IFW_VERSION_CHECK(major, minor, patch) \
((major << 16)|(minor << 8)|(patch))
+static QRegExp scCommaRegExp(QLatin1String("\\b(,|, )\\b"));
+
enum INSTALLER_EXPORT RunMode
{
AllMode,