mirror of
https://github.com/QuasarApp/installer-framework.git
synced 2025-05-05 01:39:34 +00:00
Fix warning and handle file scheme like files better.
Calling setFileName() prints a warning if the path is reset without calling close() before. Convert the source path with file:/// scheme to local file. Change-Id: Ie21e7e8ad8f76dbe1afc1843ff5bf7fb4598123a Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
parent
6857a0e87e
commit
bc91a2204e
@ -64,8 +64,8 @@ int BinaryReplace::replace(const QString &source, const QString &target)
|
|||||||
QFutureWatcher<QInstaller::FileTaskResult> taskWatcher;
|
QFutureWatcher<QInstaller::FileTaskResult> taskWatcher;
|
||||||
if (url.isRelative() || url.isLocalFile()) {
|
if (url.isRelative() || url.isLocalFile()) {
|
||||||
taskWatcher.setFuture(QtConcurrent::run(&QInstaller::CopyFileTask::doTask,
|
taskWatcher.setFuture(QtConcurrent::run(&QInstaller::CopyFileTask::doTask,
|
||||||
new QInstaller::CopyFileTask(QInstaller::FileTaskItem(QFileInfo(source)
|
new QInstaller::CopyFileTask(QInstaller::FileTaskItem(url.isRelative()
|
||||||
.absoluteFilePath()))));
|
? QFileInfo(source).absoluteFilePath() : url.toLocalFile()))));
|
||||||
} else {
|
} else {
|
||||||
taskWatcher.setFuture(QtConcurrent::run(&QInstaller::DownloadFileTask::doTask,
|
taskWatcher.setFuture(QtConcurrent::run(&QInstaller::DownloadFileTask::doTask,
|
||||||
new QInstaller::DownloadFileTask(QInstaller::FileTaskItem(url.toString()))));
|
new QInstaller::DownloadFileTask(QInstaller::FileTaskItem(url.toString()))));
|
||||||
|
@ -120,6 +120,7 @@ int main(int argc, char *argv[])
|
|||||||
fi.setFile(bundlePath);
|
fi.setFile(bundlePath);
|
||||||
path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat");
|
path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat");
|
||||||
|
|
||||||
|
tmp.close();
|
||||||
tmp.setFileName(path);
|
tmp.setFileName(path);
|
||||||
QInstaller::openForRead(&tmp);
|
QInstaller::openForRead(&tmp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user