diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2019-05-14 08:14:30 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2019-05-15 07:19:23 +0000 |
commit | 79fcbb1756d5927170d9d961e7cfef0c27c8ca6b (patch) | |
tree | 2e663665d048768ea2d0f5647346b69fe3eefab6 /src/plugins/projectexplorer | |
parent | c19a6f26ccf42af00184f0d588adf8d06a553531 (diff) | |
download | qt-creator-79fcbb1756d5927170d9d961e7cfef0c27c8ca6b.tar.gz |
MsvcToolchain: Display native paths in vcvars path combo box
Use "normalized" paths internally but always show native paths to
users.
Change-Id: I04dbdc2e1e9384fc0b0fe73b6c63d8b4688a2674
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/msvctoolchain.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 9e9c115c91..24754041d3 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1362,8 +1362,10 @@ MsvcToolChainConfigWidget::MsvcToolChainConfigWidget(ToolChain *tc) QHBoxLayout *hLayout = new QHBoxLayout(); m_varsBatPathCombo->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); for (const MsvcToolChain *tmpTc : g_availableMsvcToolchains) { - if (!tmpTc->varsBat().isEmpty() && m_varsBatPathCombo->findText(tmpTc->varsBat()) == -1) { - m_varsBatPathCombo->addItem(tmpTc->varsBat()); + const QString nativeVcVars = QDir::toNativeSeparators(tmpTc->varsBat()); + if (!tmpTc->varsBat().isEmpty() + && m_varsBatPathCombo->findText(nativeVcVars) == -1) { + m_varsBatPathCombo->addItem(nativeVcVars); } } const bool isAmd64 @@ -1405,7 +1407,8 @@ void MsvcToolChainConfigWidget::applyImpl() auto *tc = static_cast<MsvcToolChain *>(toolChain()); QTC_ASSERT(tc, return ); tc->setTargetAbi(m_abiWidget->currentAbi()); - tc->changeVcVarsCall(m_varsBatPathCombo->currentText(), vcVarsArguments()); + const QString vcVars = QDir::fromNativeSeparators(m_varsBatPathCombo->currentText()); + tc->changeVcVarsCall(vcVars, vcVarsArguments()); setFromMsvcToolChain(); } @@ -1418,7 +1421,7 @@ bool MsvcToolChainConfigWidget::isDirtyImpl() const { auto msvcToolChain = static_cast<MsvcToolChain *>(toolChain()); - return msvcToolChain->varsBat() != m_varsBatPathCombo->currentText() + return msvcToolChain->varsBat() != QDir::fromNativeSeparators(m_varsBatPathCombo->currentText()) || msvcToolChain->varsBatArg() != vcVarsArguments() || msvcToolChain->targetAbi() != m_abiWidget->currentAbi(); } @@ -1446,13 +1449,14 @@ void MsvcToolChainConfigWidget::setFromMsvcToolChain() break; } } - m_varsBatPathCombo->setCurrentText(tc->varsBat()); + m_varsBatPathCombo->setCurrentText(QDir::toNativeSeparators(tc->varsBat())); m_varsBatArgumentsEdit->setText(args); m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi()); } void MsvcToolChainConfigWidget::handleVcVarsChange(const QString &vcVars) { + const QString normalizedVcVars = QDir::fromNativeSeparators(vcVars); const auto *currentTc = static_cast<const MsvcToolChain *>(toolChain()); QTC_ASSERT(currentTc, return ); const MsvcToolChain::Platform platform = m_varsBatArchCombo->currentData().value<MsvcToolChain::Platform>(); @@ -1460,7 +1464,7 @@ void MsvcToolChainConfigWidget::handleVcVarsChange(const QString &vcVars) const unsigned char wordWidth = wordWidthForPlatform(platform); for (const MsvcToolChain *tc : g_availableMsvcToolchains) { - if (tc->varsBat() == vcVars && tc->targetAbi().wordWidth() == wordWidth + if (tc->varsBat() == normalizedVcVars && tc->targetAbi().wordWidth() == wordWidth && tc->targetAbi().architecture() == arch) { m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi()); break; |