diff options
author | kh1 <karsten.heimrich@digia.com> | 2014-03-05 11:48:57 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2014-03-25 14:12:41 +0100 |
commit | d2815ad5a6d836bd67f1002b1a6fe2733e9b1b79 (patch) | |
tree | b51561fa5057e742e81f393bf6badb10e9d0627b /src/sdk/installerbase_p.cpp | |
parent | dc70e9b9bbe086dee04640c4196eabf9c91b05be (diff) |
Unify access to the supported schemes.
Fixes an issue that https downloaded files where not properly
named and put in the right temporary download directory.
Change-Id: I8a973e8b63cfae2f575d84591a8ebbef53d45a3a
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/sdk/installerbase_p.cpp')
-rw-r--r-- | src/sdk/installerbase_p.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/sdk/installerbase_p.cpp b/src/sdk/installerbase_p.cpp index 2c79e0dde..57de0dc5d 100644 --- a/src/sdk/installerbase_p.cpp +++ b/src/sdk/installerbase_p.cpp @@ -79,13 +79,6 @@ InstallerBase::~InstallerBase() { } -static bool supportedScheme(const QString &scheme) -{ - if (scheme == QLatin1String("http") || scheme == QLatin1String("ftp") || scheme == QLatin1String("file")) - return true; - return false; -} - int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) { QInstaller::setVerbose(arguments.contains(QLatin1String("--verbose")) @@ -96,7 +89,7 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) arguments.removeAll(QLatin1String("--update-installerbase")); QUrl url = arguments.value(1); - if (!supportedScheme(url.scheme()) && QFileInfo(url.toString()).exists()) + if (!FileDownloaderFactory::isSupportedScheme(url.scheme()) && QFileInfo(url.toString()).exists()) url = QLatin1String("file:///") + url.toString(); m_downloader.reset(FileDownloaderFactory::instance().create(url.scheme(), 0)); if (m_downloader.isNull()) { @@ -107,7 +100,7 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) m_downloader->setAutoRemoveDownloadedFile(true); QString target = QDir::tempPath() + QLatin1String("/") + QFileInfo(arguments.at(1)).fileName(); - if (supportedScheme(url.scheme())) + if (FileDownloaderFactory::isSupportedScheme(url.scheme())) m_downloader->setDownloadedFileName(target); connect(m_downloader.data(), SIGNAL(downloadStarted()), this, SLOT(downloadStarted())); |