diff options
author | kh1 <karsten.heimrich@digia.com> | 2013-02-28 17:30:06 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2013-03-18 11:39:18 +0100 |
commit | 0249980607986b1b786886f61dc7d68dfb5b2420 (patch) | |
tree | 6701b011384e5dcfdaa14932836b90fda5d15489 /src/libs/installer/component.cpp | |
parent | 7796a25de086de6276d5128d50469ab260528eeb (diff) |
Use Q_GLOBAL_STATIC{_WITH_ARGS} following Qt coding conventions.
Move the regexp into its own compilation unit, so we get it only
once and use a accessor to fetch the value. I guess we should do
the same with the constants file, as all strings get compiled in
the file including it. At least Ossi wasn't satisfied currently.
Change-Id: Ic495a82f4b3cfe7810523b12cd3ef255eb15f149
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index fb554155f..7b457d71b 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -43,6 +43,7 @@ #include "errors.h" #include "fileutils.h" #include "fsengineclient.h" +#include "globals.h" #include "lib7z_facade.h" #include "packagemanagercore.h" #include "messageboxhandler.h" @@ -181,13 +182,13 @@ void Component::loadDataFromPackage(const Package &package) } setLocalTempPath(QInstaller::pathFromUrl(package.sourceInfo().url)); - const QStringList uis = package.data(QLatin1String("UserInterfaces")).toString().split(scCommaRegExp, - QString::SkipEmptyParts); + const QStringList uis = package.data(QLatin1String("UserInterfaces")).toString() + .split(QInstaller::commaRegExp(), QString::SkipEmptyParts); if (!uis.isEmpty()) loadUserInterfaces(QDir(QString::fromLatin1("%1/%2").arg(localTempPath(), name())), uis); - const QStringList qms = package.data(QLatin1String("Translations")).toString().split(scCommaRegExp, - QString::SkipEmptyParts); + const QStringList qms = package.data(QLatin1String("Translations")).toString() + .split(QInstaller::commaRegExp(), QString::SkipEmptyParts); if (!qms.isEmpty()) loadTranslations(QDir(QString::fromLatin1("%1/%2").arg(localTempPath(), name())), qms); @@ -994,13 +995,13 @@ void Component::addDependency(const QString &newDependency) */ QStringList Component::dependencies() const { - return d->m_vars.value(scDependencies).split(scCommaRegExp, QString::SkipEmptyParts); + return d->m_vars.value(scDependencies).split(QInstaller::commaRegExp(), QString::SkipEmptyParts); } QStringList Component::autoDependencies() const { QStringList autoDependencyStringList = - d->m_vars.value(scAutoDependOn).split(scCommaRegExp, QString::SkipEmptyParts); + d->m_vars.value(scAutoDependOn).split(QInstaller::commaRegExp(), QString::SkipEmptyParts); autoDependencyStringList.removeAll(QLatin1String("script")); return autoDependencyStringList; } |