From aeaf1b84553f337a19b14e1be1aa34c99b4a4e65 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 13 Apr 2012 14:21:50 +0200 Subject: [PATCH] createOperationsForArchive should use the correct path - only with this you are able to overload the createOperationsForArchive without the knowledge where the archive comes from Change-Id: Ica65c2bbd14cf554ab4702f5886d74423bbc86f5 Reviewed-by: Karsten Heimrich --- src/libs/installer/component.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 41ad2eeb..8baa4635 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -593,14 +593,13 @@ void Component::createOperationsForArchive(const QString &archive) if (callScriptMethod(QLatin1String("createOperationsForArchive"), QScriptValueList() << archive).isValid()) return; - const QFileInfo fi(QString::fromLatin1("installer://%1/%2").arg(name(), archive)); - const bool isZip = Lib7z::isSupportedArchive(fi.filePath()); + const bool isZip = Lib7z::isSupportedArchive(archive); if (isZip) { // archives get completely extracted per default (if the script isn't doing other stuff) - addOperation(QLatin1String("Extract"), fi.filePath(), QLatin1String("@TargetDir@")); + addOperation(QLatin1String("Extract"), archive, QLatin1String("@TargetDir@")); } else { - createOperationsForPath(fi.filePath()); + createOperationsForPath(archive); } } @@ -612,7 +611,6 @@ void Component::beginInstallation() } } - /*! Creates all operations needed to install this component. You can override this method by providing a method with the same name in the component script. @@ -655,12 +653,16 @@ QList > Component::pathesForUninstallation() const } /*! - Contains the names of all archives known to this component. This does not contain archives added - with #addDownloadableArchive. + Contains the names of all archives known to this component. Even downloaded archives are mapped + to the installer:// url throw the used QFileEngineHandler during the download process. */ QStringList Component::archives() const { - return QDir(QString::fromLatin1("installer://%1/").arg(name())).entryList(); + QString pathString = QString::fromLatin1("installer://%1/").arg(name()); + QStringList archivesNameList = QDir(pathString).entryList(); + //RegExp "^" means line beginning + archivesNameList.replaceInStrings(QRegExp(QLatin1String("^")), pathString); + return archivesNameList; } /*!