summaryrefslogtreecommitdiffstats
path: root/src/libs/kdtools
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-11-24 06:20:07 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-11-24 06:20:07 +0200
commit79011733f7a00da988d482dde443418c9df38784 (patch)
treeaae5e8dbdd254cb2538e66e4649b1c86d39191ae /src/libs/kdtools
parentd863c8abcf29e971e0adb8dcb2fc12971a4e98f1 (diff)
parent13c9e1111d89d1a2a06954c00bb3d3c33d4ecfa3 (diff)
Merge remote-tracking branch 'origin/4.0' into master
Diffstat (limited to 'src/libs/kdtools')
-rw-r--r--src/libs/kdtools/filedownloader.cpp10
-rw-r--r--src/libs/kdtools/updateoperation.cpp4
2 files changed, 9 insertions, 5 deletions
diff --git a/src/libs/kdtools/filedownloader.cpp b/src/libs/kdtools/filedownloader.cpp
index 9532aef62..ea8fdd23b 100644
--- a/src/libs/kdtools/filedownloader.cpp
+++ b/src/libs/kdtools/filedownloader.cpp
@@ -813,9 +813,9 @@ void KDUpdater::LocalFileDownloader::doDownload()
QString localFile = this->url().toLocalFile();
d->source = new QFile(localFile, this);
if (!d->source->open(QFile::ReadOnly)) {
- onError();
setDownloadAborted(tr("Cannot open file \"%1\" for reading: %2").arg(QFileInfo(localFile)
- .fileName(), d->source ? d->source->errorString() : tr("File not found")));
+ .fileName(), d->source->errorString()));
+ onError();
return;
}
@@ -829,9 +829,9 @@ void KDUpdater::LocalFileDownloader::doDownload()
}
if (!d->destination->isOpen()) {
- onError();
setDownloadAborted(tr("Cannot open file \"%1\" for writing: %2")
.arg(QFileInfo(d->destination->fileName()).fileName(), d->destination->errorString()));
+ onError();
return;
}
@@ -902,10 +902,10 @@ void KDUpdater::LocalFileDownloader::timerEvent(QTimerEvent *event)
if (numWritten < 0) {
killTimer(d->timerId);
d->timerId = -1;
- onError();
setDownloadAborted(tr("Writing to file \"%1\" failed: %2").arg(
QDir::toNativeSeparators(d->destination->fileName()),
d->destination->errorString()));
+ onError();
return;
}
toWrite -= numWritten;
@@ -1090,11 +1090,11 @@ void KDUpdater::ResourceFileDownloader::timerEvent(QTimerEvent *event)
{
if (event->timerId() == d->timerId) {
if (!d->destFile.isOpen()) {
- onError();
killTimer(d->timerId);
emit downloadProgress(1);
setDownloadAborted(tr("Cannot read resource file \"%1\": %2").arg(downloadedFileName(),
d->destFile.errorString()));
+ onError();
return;
}
diff --git a/src/libs/kdtools/updateoperation.cpp b/src/libs/kdtools/updateoperation.cpp
index 73e904da5..b884fa9fa 100644
--- a/src/libs/kdtools/updateoperation.cpp
+++ b/src/libs/kdtools/updateoperation.cpp
@@ -505,6 +505,10 @@ bool UpdateOperation::fromXml(const QDomDocument &doc)
}
var = QVariant::fromValue(list);
}
+ } else if (t == QVariant::String) {
+ const QString str = QInstaller::replacePath(value,
+ QLatin1String(QInstaller::scRelocatable), target);
+ var = QVariant::fromValue(str);
}
m_values[name] = var;