summaryrefslogtreecommitdiffstats
path: root/tools/common/repositorygen.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-03-25 13:36:54 +0100
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-03-25 15:14:30 +0100
commit53bc7f0e161e823ef8fc1b551dfc2e23bc87b654 (patch)
treee7f27b802a4efaa492b719a41a983371bc0d97e7 /tools/common/repositorygen.cpp
parent4eab0cc244066d884eef7b411d46a978efe13a38 (diff)
Reuse existing make absolute.
Change-Id: I9ad7287db0539e3fb6819220a3648244c10f1869 Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'tools/common/repositorygen.cpp')
-rw-r--r--tools/common/repositorygen.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/common/repositorygen.cpp b/tools/common/repositorygen.cpp
index e25af0dd6..b119c392a 100644
--- a/tools/common/repositorygen.cpp
+++ b/tools/common/repositorygen.cpp
@@ -73,6 +73,13 @@ void QInstallerTools::printRepositoryGenOptions()
std::cout << " --ignore-invalid-packages Ignore all invalid packages instead of aborting." << std::endl;
}
+QString QInstallerTools::makePathAbsolute(const QString &path)
+{
+ if (QFileInfo(path).isRelative())
+ return QDir::current().absoluteFilePath(path);
+ return path;
+}
+
void QInstallerTools::copyWithException(const QString &source, const QString &target, const QString &kind)
{
qDebug() << QString::fromLatin1("Copying associated %1 file '%2'").arg(kind, source);
@@ -104,10 +111,7 @@ void QInstallerTools::generateMetaDataDirectory(const QString &outDir, const QSt
const PackageInfoVector &packages, const QString &appName, const QString &appVersion,
const QString &redirectUpdateUrl)
{
- QString metapath = outDir;
- if (QFileInfo(metapath).isRelative())
- metapath = QDir::cleanPath(QDir::current().absoluteFilePath(metapath));
-
+ const QString metapath = makePathAbsolute(outDir);
if (!QFile::exists(metapath))
QInstaller::mkpath(metapath);