From a1882c1caac5e28d4197312f6ec44368fd6e06a1 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 18 May 2022 14:55:11 +0200 Subject: [PATCH] StudioWelcome: Add option to force download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [QML] Designer\ForceWelcomePageDownload=true Change-Id: Iad31e03367ed83336e9e1c461f4fa99abfe09158 Reviewed-by: Reviewed-by: Qt CI Bot Reviewed-by: Henning Gründl --- src/plugins/studiowelcome/studiowelcomeplugin.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index e6e0632a444..464640162e8 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -544,6 +544,12 @@ bool StudioWelcomePlugin::initialize(const QStringList &arguments, QString *erro return true; } +static bool forceDownLoad() +{ + const QString lastQDSVersionEntry = "QML/Designer/ForceWelcomePageDownload"; + return Core::ICore::settings()->value(lastQDSVersionEntry, false).toBool(); +} + static bool showSplashScreen() { const QString lastQDSVersionEntry = "QML/Designer/lastQDSVersion"; @@ -660,9 +666,6 @@ WelcomeMode::WelcomeMode() Utils::FilePath readme = Utils::FilePath::fromUserInput(m_dataModelDownloader->targetFolder().toString() + "/readme.txt"); - if (!readme.exists()) // Only downloads contain the readme - m_dataModelDownloader->setForceDownload(true); - m_dataModelDownloader->start(); connect(m_dataModelDownloader, &DataModelDownloader::finished, this, [this](){ @@ -694,6 +697,9 @@ WelcomeMode::WelcomeMode() m_modeWidget->engine()->setOutputWarningsToStandardError(false); + if (forceDownLoad() || !readme.exists()) // Only downloads contain the readme + m_dataModelDownloader->setForceDownload(true); + connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, this, [this](Utils::Id mode){ bool active = (mode == Core::Constants::MODE_WELCOME); m_modeWidget->rootObject()->setProperty("active", active);