summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/component.cpp
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@nokia.com>2012-04-13 14:21:50 +0200
committerTim Jenssen <tim.jenssen@nokia.com>2012-04-13 15:06:53 +0200
commitaeaf1b84553f337a19b14e1be1aa34c99b4a4e65 (patch)
treefab6c7191c167cc9f48c8340433b71f6ffd2dbdf /src/libs/installer/component.cpp
parente6b89ee2dd96b6085e66ef4874e43adaa79ade87 (diff)
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 <karsten.heimrich@nokia.com>
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;
}
/*!