diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-10-10 15:55:08 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-10-10 16:08:47 +0200 |
commit | bc91a2204e7d88bdea431a36033651b5806a2214 (patch) | |
tree | 7ca0c059c32635bbd5a72c3cff3b649361778818 /tools | |
parent | 6857a0e87e43465db4804bf40e6f85c9195e2574 (diff) |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/devtool/binaryreplace.cpp | 4 | ||||
-rw-r--r-- | tools/devtool/main.cpp | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tools/devtool/binaryreplace.cpp b/tools/devtool/binaryreplace.cpp index 131bd5ea5..d248015a0 100644 --- a/tools/devtool/binaryreplace.cpp +++ b/tools/devtool/binaryreplace.cpp @@ -64,8 +64,8 @@ int BinaryReplace::replace(const QString &source, const QString &target) QFutureWatcher<QInstaller::FileTaskResult> taskWatcher; if (url.isRelative() || url.isLocalFile()) { taskWatcher.setFuture(QtConcurrent::run(&QInstaller::CopyFileTask::doTask, - new QInstaller::CopyFileTask(QInstaller::FileTaskItem(QFileInfo(source) - .absoluteFilePath())))); + new QInstaller::CopyFileTask(QInstaller::FileTaskItem(url.isRelative() + ? QFileInfo(source).absoluteFilePath() : url.toLocalFile())))); } else { taskWatcher.setFuture(QtConcurrent::run(&QInstaller::DownloadFileTask::doTask, new QInstaller::DownloadFileTask(QInstaller::FileTaskItem(url.toString())))); diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp index 2c4fad8cf..9ef611ce2 100644 --- a/tools/devtool/main.cpp +++ b/tools/devtool/main.cpp @@ -120,6 +120,7 @@ int main(int argc, char *argv[]) fi.setFile(bundlePath); path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat"); + tmp.close(); tmp.setFileName(path); QInstaller::openForRead(&tmp); |