summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/component.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r--src/libs/installer/component.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 41ad2eeb0..8baa4635f 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<QPair<QString, bool> > 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;
}
/*!