From 2d7457573bffb41f2c9bc25441410a6844332476 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 4 Jul 2022 11:32:49 +0200 Subject: [PATCH] Squish: Aspectify settings Change-Id: I9861de1803adaf39fda9378a3169e99e37ad8695 Reviewed-by: hjk Reviewed-by: Leena Miettinen Reviewed-by: David Schulz --- src/plugins/squish/CMakeLists.txt | 1 - src/plugins/squish/squish.qbs | 3 - src/plugins/squish/squishplugin.cpp | 12 +- src/plugins/squish/squishplugin.h | 12 +- src/plugins/squish/squishsettings.cpp | 112 +++++++++++++------ src/plugins/squish/squishsettings.h | 31 ++++-- src/plugins/squish/squishsettingspage.cpp | 108 ------------------ src/plugins/squish/squishsettingspage.h | 72 ------------ src/plugins/squish/squishsettingspage.ui | 127 ---------------------- src/plugins/squish/squishtools.cpp | 78 ++++++------- 10 files changed, 145 insertions(+), 411 deletions(-) delete mode 100644 src/plugins/squish/squishsettingspage.cpp delete mode 100644 src/plugins/squish/squishsettingspage.h delete mode 100644 src/plugins/squish/squishsettingspage.ui diff --git a/src/plugins/squish/CMakeLists.txt b/src/plugins/squish/CMakeLists.txt index d5859e69ed0..fea21ad1d35 100644 --- a/src/plugins/squish/CMakeLists.txt +++ b/src/plugins/squish/CMakeLists.txt @@ -18,7 +18,6 @@ add_qtc_plugin(Squish squishplugin.cpp squishplugin.h squishresultmodel.cpp squishresultmodel.h squishsettings.cpp squishsettings.h - squishsettingspage.cpp squishsettingspage.h squishsettingspage.ui squishtesttreemodel.cpp squishtesttreemodel.h squishtesttreeview.cpp squishtesttreeview.h squishtools.cpp squishtools.h diff --git a/src/plugins/squish/squish.qbs b/src/plugins/squish/squish.qbs index fe9a8d5721d..8b3cb476286 100644 --- a/src/plugins/squish/squish.qbs +++ b/src/plugins/squish/squish.qbs @@ -16,9 +16,6 @@ QtcPlugin { "squishplugin.h", "squishsettings.cpp", "squishsettings.h", - "squishsettingspage.cpp", - "squishsettingspage.h", - "squishsettingspage.ui", "squishnavigationwidget.cpp", "squishnavigationwidget.h", "squishoutputpane.cpp", diff --git a/src/plugins/squish/squishplugin.cpp b/src/plugins/squish/squishplugin.cpp index 4d1ea84ee5b..4e1f61fa2fd 100644 --- a/src/plugins/squish/squishplugin.cpp +++ b/src/plugins/squish/squishplugin.cpp @@ -24,11 +24,11 @@ ****************************************************************************/ #include "squishplugin.h" + #include "objectsmapeditor.h" #include "squishnavigationwidget.h" #include "squishoutputpane.h" #include "squishsettings.h" -#include "squishsettingspage.h" #include "squishtesttreemodel.h" #include @@ -45,7 +45,6 @@ using namespace Core; static SquishPlugin *m_instance = nullptr; SquishPlugin::SquishPlugin() - : m_squishSettings(new SquishSettings) { m_instance = this; } @@ -54,7 +53,6 @@ SquishPlugin::~SquishPlugin() { delete m_objectsMapEditorFactory; delete m_navigationWidgetFactory; - delete m_settingsPage; delete m_outputPane; } @@ -63,9 +61,9 @@ SquishPlugin *SquishPlugin::instance() return m_instance; } -QSharedPointer SquishPlugin::squishSettings() const +SquishSettings *SquishPlugin::squishSettings() { - return m_squishSettings; + return &m_squishSettings; } void SquishPlugin::initializeMenuEntries() {} @@ -75,12 +73,12 @@ bool SquishPlugin::initialize(const QStringList &arguments, QString *errorString Q_UNUSED(arguments) Q_UNUSED(errorString) + m_squishSettings.readSettings(ICore::settings()); + initializeMenuEntries(); - m_squishSettings->fromSettings(ICore::settings()); m_treeModel = new SquishTestTreeModel(this); - m_settingsPage = new SquishSettingsPage(m_squishSettings); m_navigationWidgetFactory = new SquishNavigationWidgetFactory; m_outputPane = SquishOutputPane::instance(); m_objectsMapEditorFactory = new ObjectsMapEditorFactory; diff --git a/src/plugins/squish/squishplugin.h b/src/plugins/squish/squishplugin.h index e4b35dace97..d4e172204df 100644 --- a/src/plugins/squish/squishplugin.h +++ b/src/plugins/squish/squishplugin.h @@ -27,9 +27,9 @@ #include "squishplugin_global.h" -#include +#include "squishsettings.h" -#include +#include namespace Squish { namespace Internal { @@ -37,8 +37,6 @@ namespace Internal { class ObjectsMapEditorFactory; class SquishNavigationWidgetFactory; class SquishOutputPane; -struct SquishSettings; -class SquishSettingsPage; class SquishTestTreeModel; class SquishPlugin : public ExtensionSystem::IPlugin @@ -52,7 +50,7 @@ public: static SquishPlugin *instance(); - QSharedPointer squishSettings() const; + SquishSettings *squishSettings(); bool initialize(const QStringList &arguments, QString *errorString) override; void extensionsInitialized() override; @@ -62,9 +60,9 @@ private: void initializeMenuEntries(); SquishTestTreeModel *m_treeModel; - QSharedPointer m_squishSettings; + SquishSettings m_squishSettings; - SquishSettingsPage *m_settingsPage = nullptr; + SquishSettingsPage m_settingsPage{&m_squishSettings}; SquishNavigationWidgetFactory *m_navigationWidgetFactory = nullptr; SquishOutputPane *m_outputPane = nullptr; ObjectsMapEditorFactory *m_objectsMapEditorFactory = nullptr; diff --git a/src/plugins/squish/squishsettings.cpp b/src/plugins/squish/squishsettings.cpp index 30b4f619b09..683c268ed78 100644 --- a/src/plugins/squish/squishsettings.cpp +++ b/src/plugins/squish/squishsettings.cpp @@ -25,53 +25,93 @@ #include "squishsettings.h" +#include "squishconstants.h" + +#include +#include + #include +using namespace Utils; + namespace Squish { namespace Internal { -static const char group[] = "Squish"; -static const char squishPathKey[] = "SquishPath"; -static const char licensePathKey[] = "LicensePath"; -static const char localKey[] = "Local"; -static const char serverHostKey[] = "ServerHost"; -static const char serverPortKey[] = "ServerPort"; -static const char verboseKey[] = "Verbose"; - -void SquishSettings::toSettings(QSettings *s) const +SquishSettings::SquishSettings() { - s->beginGroup(group); - s->setValue(squishPathKey, squishPath.toString()); - s->setValue(licensePathKey, licensePath.toString()); - s->setValue(localKey, local); - s->setValue(serverHostKey, serverHost); - s->setValue(serverPortKey, serverPort); - s->setValue(verboseKey, verbose); - s->endGroup(); + setSettingsGroup("Squish"); + setAutoApply(false); + + registerAspect(&squishPath); + squishPath.setSettingsKey("SquishPath"); + squishPath.setLabelText(tr("Squish path:")); + squishPath.setDisplayStyle(StringAspect::PathChooserDisplay); + squishPath.setExpectedKind(PathChooser::ExistingDirectory); + squishPath.setPlaceHolderText(tr("Path to Squish installation")); + + registerAspect(&licensePath); + licensePath.setSettingsKey("LicensePath"); + licensePath.setLabelText(tr("License path:")); + licensePath.setDisplayStyle(StringAspect::PathChooserDisplay); + licensePath.setExpectedKind(PathChooser::ExistingDirectory); + + registerAspect(&local); + local.setSettingsKey("Local"); + local.setLabel(tr("Local Server")); + local.setDefaultValue(true); + + registerAspect(&serverHost); + serverHost.setSettingsKey("ServerHost"); + serverHost.setLabelText(tr("Server host:")); + serverHost.setDisplayStyle(StringAspect::LineEditDisplay); + serverHost.setDefaultValue("localhost"); + serverHost.setEnabled(false); + + registerAspect(&serverPort); + serverPort.setSettingsKey("ServerPort"); + serverPort.setLabel(tr("Server Port")); + serverPort.setRange(1, 65535); + serverPort.setValue(9999); + serverPort.setEnabled(false); + + + registerAspect(&verbose); + verbose.setSettingsKey("Verbose"); + verbose.setLabel(tr("Verbose log")); + verbose.setDefaultValue(false); + + connect(&local, &BoolAspect::volatileValueChanged, + this, [this] (bool checked) { + serverHost.setEnabled(!checked); + serverPort.setEnabled(!checked); + }); } -void SquishSettings::fromSettings(QSettings *s) +SquishSettingsPage::SquishSettingsPage(SquishSettings *settings) { - s->beginGroup(group); - squishPath = Utils::FilePath::fromVariant(s->value(squishPathKey)); - licensePath = Utils::FilePath::fromVariant(s->value(licensePathKey)); - local = s->value(localKey, true).toBool(); - serverHost = s->value(serverHostKey, "localhost").toString(); - serverPort = s->value(serverPortKey, 9999).toUInt(); - verbose = s->value(verboseKey, false).toBool(); - s->endGroup(); -} + setId("A.Squish.General"); + setDisplayName(tr("General")); + setCategory(Constants::SQUISH_SETTINGS_CATEGORY); + setDisplayCategory("Squish"); + setCategoryIcon(Icon({{":/squish/images/settingscategory_squish.png", + Theme::PanelTextColorDark}}, Icon::Tint)); -bool SquishSettings::operator==(const SquishSettings &other) const -{ - return local == other.local && verbose == other.verbose && serverPort == other.serverPort - && squishPath == other.squishPath && licensePath == other.licensePath - && serverHost == other.serverHost; -} + setSettings(settings); -bool SquishSettings::operator!=(const SquishSettings &other) const -{ - return !(*this == other); + setLayouter([settings](QWidget *widget) { + SquishSettings &s = *settings; + using namespace Layouting; + + const Break nl; + + Grid grid { + s.squishPath, nl, + s.licensePath, nl, + Span {2, Row { s.local, s.serverHost, s.serverPort } }, nl, + s.verbose, nl, + }; + Column { Row { grid }, Stretch() }.attachTo(widget); + }); } } // namespace Internal diff --git a/src/plugins/squish/squishsettings.h b/src/plugins/squish/squishsettings.h index cb9d15104e9..c20123e3cfe 100644 --- a/src/plugins/squish/squishsettings.h +++ b/src/plugins/squish/squishsettings.h @@ -25,10 +25,9 @@ #pragma once -#include +#include -#include -#include +#include QT_BEGIN_NAMESPACE class QSettings; @@ -37,20 +36,28 @@ QT_END_NAMESPACE namespace Squish { namespace Internal { -struct SquishSettings +class SquishSettings : public Utils::AspectContainer { + Q_DECLARE_TR_FUNCTIONS(Squish::Internal::SquishSettings) +public: + SquishSettings(); + void toSettings(QSettings *s) const; void fromSettings(QSettings *s); - bool operator==(const SquishSettings &other) const; - bool operator!=(const SquishSettings &other) const; + Utils::StringAspect squishPath; + Utils::StringAspect licensePath; + Utils::StringAspect serverHost; + Utils::IntegerAspect serverPort; + Utils::BoolAspect local; + Utils::BoolAspect verbose; +}; - Utils::FilePath squishPath; - Utils::FilePath licensePath; - QString serverHost; - quint16 serverPort; - bool local; - bool verbose; +class SquishSettingsPage final : public Core::IOptionsPage +{ + Q_DECLARE_TR_FUNCTIONS(Squish::Internal::SquishSettings) +public: + SquishSettingsPage(SquishSettings *settings); }; } // namespace Internal diff --git a/src/plugins/squish/squishsettingspage.cpp b/src/plugins/squish/squishsettingspage.cpp deleted file mode 100644 index 505e315aec6..00000000000 --- a/src/plugins/squish/squishsettingspage.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2022 The Qt Company Ltd -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator Squish plugin. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "squishsettingspage.h" -#include "squishconstants.h" -#include "squishsettings.h" - -#include - -#include - -namespace Squish { -namespace Internal { - -SquishSettingsWidget::SquishSettingsWidget(QWidget *parent) - : QWidget(parent) -{ - m_ui.setupUi(this); - - connect(m_ui.localCheckBox, &QCheckBox::toggled, this, &SquishSettingsWidget::onLocalToggled); -} - -void SquishSettingsWidget::setSettings(const SquishSettings &settings) -{ - m_ui.squishPathChooser->setFilePath(settings.squishPath); - m_ui.licensePathChooser->setFilePath(settings.licensePath); - m_ui.localCheckBox->setChecked(settings.local); - m_ui.serverHostLineEdit->setText(settings.serverHost); - m_ui.serverPortSpinBox->setValue(settings.serverPort); - m_ui.verboseCheckBox->setChecked(settings.verbose); -} - -SquishSettings SquishSettingsWidget::settings() const -{ - SquishSettings result; - result.squishPath = m_ui.squishPathChooser->filePath(); - result.licensePath = m_ui.licensePathChooser->filePath(); - result.local = m_ui.localCheckBox->checkState() == Qt::Checked; - result.serverHost = m_ui.serverHostLineEdit->text(); - result.serverPort = m_ui.serverPortSpinBox->value(); - result.verbose = m_ui.verboseCheckBox->checkState() == Qt::Checked; - return result; -} - -void SquishSettingsWidget::onLocalToggled(bool checked) -{ - m_ui.serverHostLineEdit->setEnabled(!checked); - m_ui.serverPortSpinBox->setEnabled(!checked); -} - -SquishSettingsPage::SquishSettingsPage(const QSharedPointer &settings) - : m_settings(settings) - , m_widget(nullptr) -{ - setId("A.Squish.General"); - setDisplayName(tr("General")); - setCategory(Constants::SQUISH_SETTINGS_CATEGORY); - setDisplayCategory(tr("Squish")); - setCategoryIcon(Utils::Icon({{":/squish/images/settingscategory_squish.png", - Utils::Theme::PanelTextColorDark}}, - Utils::Icon::Tint)); -} - -QWidget *SquishSettingsPage::widget() -{ - if (!m_widget) { - m_widget = new SquishSettingsWidget; - m_widget->setSettings(*m_settings); - } - return m_widget; -} - -void SquishSettingsPage::apply() -{ - if (!m_widget) // page was not shown at all - return; - - const SquishSettings newSettings = m_widget->settings(); - if (newSettings != *m_settings) { - *m_settings = newSettings; - m_settings->toSettings(Core::ICore::settings()); - } -} - -} // namespace Internal -} // namespace Squish diff --git a/src/plugins/squish/squishsettingspage.h b/src/plugins/squish/squishsettingspage.h deleted file mode 100644 index 9e480776820..00000000000 --- a/src/plugins/squish/squishsettingspage.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2022 The Qt Company Ltd -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator Squish plugin. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include "ui_squishsettingspage.h" - -#include - -#include -#include -#include - -namespace Squish { -namespace Internal { - -struct SquishSettings; - -class SquishSettingsWidget : public QWidget -{ - Q_OBJECT -public: - explicit SquishSettingsWidget(QWidget *parent = nullptr); - - void setSettings(const SquishSettings &settings); - SquishSettings settings() const; - -private: - void onLocalToggled(bool checked); - - Ui::SquishSettingsPage m_ui; -}; - -class SquishSettingsPage : public Core::IOptionsPage -{ - Q_OBJECT -public: - explicit SquishSettingsPage(const QSharedPointer &settings); - - QWidget *widget() override; - void apply() override; - void finish() override {} - -private: - QSharedPointer m_settings; - QPointer m_widget; -}; - -} // namespace Internal -} // namespace Squish diff --git a/src/plugins/squish/squishsettingspage.ui b/src/plugins/squish/squishsettingspage.ui deleted file mode 100644 index fa12dcf9d72..00000000000 --- a/src/plugins/squish/squishsettingspage.ui +++ /dev/null @@ -1,127 +0,0 @@ - - - Squish::Internal::SquishSettingsPage - - - - 0 - 0 - 463 - 338 - - - - Form - - - - - - Squish path: - - - - - - - Path to Squish installation directory. - - - - - - - License path: - - - - - - - Path to directory containing Squish license file. You will only need this in special configurations like if you did not run the Squish setup tool. - - - - - - - - 0 - 0 - - - - Local server - - - - - - - Server host: - - - - - - - - 0 - 0 - - - - - - - - Port: - - - - - - - - 0 - 0 - - - - 65535 - - - - - - - Verbose log - - - - - - - Qt::Vertical - - - - 20 - 289 - - - - - - - - - Utils::PathChooser - QLineEdit -
utils/pathchooser.h
- 1 -
-
- - -
diff --git a/src/plugins/squish/squishtools.cpp b/src/plugins/squish/squishtools.cpp index b4f4d097b8e..29fe69a4b35 100644 --- a/src/plugins/squish/squishtools.cpp +++ b/src/plugins/squish/squishtools.cpp @@ -47,6 +47,8 @@ #include #include +using namespace Utils; + namespace Squish { namespace Internal { @@ -99,34 +101,34 @@ struct SquishToolsSettings { SquishToolsSettings() {} - QString squishPath; - QString serverPath = "squishserver"; - QString runnerPath = "squishrunner"; + FilePath squishPath; + FilePath serverPath; + FilePath runnerPath; bool isLocalServer = true; bool verboseLog = false; QString serverHost = "localhost"; int serverPort = 9999; - QString licenseKeyPath; + FilePath licenseKeyPath; // populate members using current settings void setup() { - QSharedPointer squishSettings = SquishPlugin::instance()->squishSettings(); - squishPath = squishSettings->squishPath.toString(); - serverPath = Utils::HostOsInfo::withExecutableSuffix("squishserver"); - runnerPath = Utils::HostOsInfo::withExecutableSuffix("squishrunner"); + const SquishSettings *squishSettings = SquishPlugin::instance()->squishSettings(); + squishPath = squishSettings->squishPath.filePath(); if (!squishPath.isEmpty()) { - const QDir squishBin(squishPath + QDir::separator() + "bin"); - serverPath = QFileInfo(squishBin, serverPath).absoluteFilePath(); - runnerPath = QFileInfo(squishBin, runnerPath).absoluteFilePath(); + const FilePath squishBin(squishPath.pathAppended("bin")); + serverPath = squishBin.pathAppended( + HostOsInfo::withExecutableSuffix("squishserver")).absoluteFilePath(); + runnerPath = squishBin.pathAppended( + HostOsInfo::withExecutableSuffix("squishrunner")).absoluteFilePath(); } - isLocalServer = squishSettings->local; - serverHost = squishSettings->serverHost; - serverPort = squishSettings->serverPort; - verboseLog = squishSettings->verbose; - licenseKeyPath = squishSettings->licensePath.toString(); + isLocalServer = squishSettings->local.value(); + serverHost = squishSettings->serverHost.value(); + serverPort = squishSettings->serverPort.value(); + verboseLog = squishSettings->verbose.value(); + licenseKeyPath = squishSettings->licensePath.filePath(); } }; @@ -304,25 +306,25 @@ void SquishTools::startSquishServer(Request request) toolsSettings.setup(); m_serverPort = -1; - const Utils::FilePath squishServer = Utils::Environment::systemEnvironment().searchInPath( - toolsSettings.serverPath); + const FilePath squishServer = Environment::systemEnvironment().searchInPath( + toolsSettings.serverPath.toString()); if (squishServer.isEmpty()) { QMessageBox::critical(Core::ICore::dialogParent(), tr("Squish Server Error"), tr("\"%1\" could not be found or is not executable.\n" "Check the settings.") - .arg(QDir::toNativeSeparators(toolsSettings.serverPath))); + .arg(toolsSettings.serverPath.toUserOutput())); setState(Idle); return; } - toolsSettings.serverPath = squishServer.toString(); + toolsSettings.serverPath = squishServer; if (true) // TODO squish setting of minimize QC on squish run/record minimizeQtCreatorWindows(); else m_lastTopLevelWindows.clear(); - m_serverProcess = new Utils::QtcProcess; + m_serverProcess = new QtcProcess; QStringList arguments; // TODO if isLocalServer is false we should start a squishserver on remote device if (toolsSettings.isLocalServer) @@ -332,14 +334,14 @@ void SquishTools::startSquishServer(Request request) if (toolsSettings.verboseLog) arguments << "--verbose"; - m_serverProcess->setCommand({Utils::FilePath::fromString(toolsSettings.serverPath), arguments}); + m_serverProcess->setCommand({toolsSettings.serverPath, arguments}); m_serverProcess->setEnvironment(squishEnvironment()); - connect(m_serverProcess, &Utils::QtcProcess::readyReadStandardOutput, + connect(m_serverProcess, &QtcProcess::readyReadStandardOutput, this, &SquishTools::onServerOutput); - connect(m_serverProcess, &Utils::QtcProcess::readyReadStandardError, + connect(m_serverProcess, &QtcProcess::readyReadStandardError, this, &SquishTools::onServerErrorOutput); - connect(m_serverProcess, &Utils::QtcProcess::done, + connect(m_serverProcess, &QtcProcess::done, this, &SquishTools::onServerFinished); setState(ServerStarting); @@ -353,7 +355,7 @@ void SquishTools::startSquishServer(Request request) void SquishTools::stopSquishServer() { if (m_serverProcess && m_serverPort > 0) { - Utils::QtcProcess serverKiller; + QtcProcess serverKiller; QStringList args; args << "--stop" << "--port" << QString::number(m_serverPort); serverKiller.setCommand({m_serverProcess->commandLine().executable(), args}); @@ -411,20 +413,20 @@ void SquishTools::startSquishRunner() return; } - const Utils::FilePath squishRunner = Utils::Environment::systemEnvironment().searchInPath( - toolsSettings.runnerPath); + const FilePath squishRunner = Environment::systemEnvironment().searchInPath( + toolsSettings.runnerPath.toString()); if (squishRunner.isEmpty()) { QMessageBox::critical(Core::ICore::dialogParent(), tr("Squish Runner Error"), tr("\"%1\" could not be found or is not executable.\n" "Check the settings.") - .arg(QDir::toNativeSeparators(toolsSettings.runnerPath))); + .arg(toolsSettings.runnerPath.toUserOutput())); setState(RunnerStopped); return; } - toolsSettings.runnerPath = squishRunner.toString(); + toolsSettings.runnerPath = squishRunner; - m_runnerProcess = new Utils::QtcProcess; + m_runnerProcess = new QtcProcess; QStringList args; args << m_additionalServerArguments; @@ -449,12 +451,12 @@ void SquishTools::startSquishRunner() args << "--reportgen" << QString::fromLatin1("xml2.2,%1").arg(caseReportFilePath); - m_runnerProcess->setCommand({Utils::FilePath::fromString(toolsSettings.runnerPath), args}); + m_runnerProcess->setCommand({toolsSettings.runnerPath, args}); m_runnerProcess->setEnvironment(squishEnvironment()); - connect(m_runnerProcess, &Utils::QtcProcess::readyReadStandardError, + connect(m_runnerProcess, &QtcProcess::readyReadStandardError, this, &SquishTools::onRunnerErrorOutput); - connect(m_runnerProcess, &Utils::QtcProcess::done, + connect(m_runnerProcess, &QtcProcess::done, this, &SquishTools::onRunnerFinished); setState(RunnerStarting); @@ -487,12 +489,12 @@ void SquishTools::startSquishRunner() m_currentResultsXML = new QFile(caseReportFilePath); } -Utils::Environment SquishTools::squishEnvironment() +Environment SquishTools::squishEnvironment() { - Utils::Environment environment = Utils::Environment::systemEnvironment(); + Environment environment = Environment::systemEnvironment(); if (!toolsSettings.licenseKeyPath.isEmpty()) - environment.prependOrSet("SQUISH_LICENSEKEY_DIR", toolsSettings.licenseKeyPath); - environment.prependOrSet("SQUISH_PREFIX", toolsSettings.squishPath); + environment.prependOrSet("SQUISH_LICENSEKEY_DIR", toolsSettings.licenseKeyPath.nativePath()); + environment.prependOrSet("SQUISH_PREFIX", toolsSettings.squishPath.nativePath()); return environment; }