StudioWelcome: Add option to force download

[QML]
Designer\ForceWelcomePageDownload=true

Change-Id: Iad31e03367ed83336e9e1c461f4fa99abfe09158
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2022-05-18 14:55:11 +02:00
parent ab9d0294da
commit a1882c1caa

View File

@@ -544,6 +544,12 @@ bool StudioWelcomePlugin::initialize(const QStringList &arguments, QString *erro
return true; return true;
} }
static bool forceDownLoad()
{
const QString lastQDSVersionEntry = "QML/Designer/ForceWelcomePageDownload";
return Core::ICore::settings()->value(lastQDSVersionEntry, false).toBool();
}
static bool showSplashScreen() static bool showSplashScreen()
{ {
const QString lastQDSVersionEntry = "QML/Designer/lastQDSVersion"; const QString lastQDSVersionEntry = "QML/Designer/lastQDSVersion";
@@ -660,9 +666,6 @@ WelcomeMode::WelcomeMode()
Utils::FilePath readme = Utils::FilePath::fromUserInput(m_dataModelDownloader->targetFolder().toString() Utils::FilePath readme = Utils::FilePath::fromUserInput(m_dataModelDownloader->targetFolder().toString()
+ "/readme.txt"); + "/readme.txt");
if (!readme.exists()) // Only downloads contain the readme
m_dataModelDownloader->setForceDownload(true);
m_dataModelDownloader->start(); m_dataModelDownloader->start();
connect(m_dataModelDownloader, &DataModelDownloader::finished, this, [this](){ connect(m_dataModelDownloader, &DataModelDownloader::finished, this, [this](){
@@ -694,6 +697,9 @@ WelcomeMode::WelcomeMode()
m_modeWidget->engine()->setOutputWarningsToStandardError(false); 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){ connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, this, [this](Utils::Id mode){
bool active = (mode == Core::Constants::MODE_WELCOME); bool active = (mode == Core::Constants::MODE_WELCOME);
m_modeWidget->rootObject()->setProperty("active", active); m_modeWidget->rootObject()->setProperty("active", active);