aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/kitinformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/projectexplorer/kitinformation.cpp')
-rw-r--r--src/plugins/projectexplorer/kitinformation.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp
index fc8039b402..e5cfd9f5d7 100644
--- a/src/plugins/projectexplorer/kitinformation.cpp
+++ b/src/plugins/projectexplorer/kitinformation.cpp
@@ -239,6 +239,8 @@ private:
void refresh() override
{
+ IDeviceConstPtr device = BuildDeviceKitAspect::device(kit());
+
const GuardLocker locker(m_ignoreChanges);
const QList<Id> keys = m_languageComboboxMap.keys();
for (const Id l : keys) {
@@ -248,8 +250,21 @@ private:
cb->clear();
cb->addItem(Tr::tr("<No compiler>"), QByteArray());
- for (ToolChain *tc : ltcList)
- cb->addItem(tc->displayName(), tc->id());
+ const QList<ToolChain *> same = Utils::filtered(ltcList, [device](ToolChain *tc) {
+ return tc->compilerCommand().isSameDevice(device->rootPath());
+ });
+ const QList<ToolChain *> other = Utils::filtered(ltcList, [device](ToolChain *tc) {
+ return !tc->compilerCommand().isSameDevice(device->rootPath());
+ });
+
+ for (ToolChain *item : same)
+ cb->addItem(item->displayName(), item->id());
+
+ if (!same.isEmpty() && !other.isEmpty())
+ cb->insertSeparator(cb->count());
+
+ for (ToolChain *item : other)
+ cb->addItem(item->displayName(), item->id());
cb->setEnabled(cb->count() > 1 && !m_isReadOnly);
const int index = indexOf(cb, ToolChainKitAspect::toolChain(m_kit, l));
@@ -471,10 +486,9 @@ void ToolChainKitAspect::setup(Kit *k)
// ID is not found: Might be an ABI string...
lockToolchains = false;
const QString abi = QString::fromUtf8(id);
- const Toolchains possibleTcs = ToolChainManager::toolchains(
- [abi, l](const ToolChain *t) {
- return t->targetAbi().toString() == abi && t->language() == l;
- });
+ const Toolchains possibleTcs = ToolChainManager::toolchains([abi, l](const ToolChain *t) {
+ return t->targetAbi().toString() == abi && t->language() == l;
+ });
ToolChain *bestTc = nullptr;
for (ToolChain *tc : possibleTcs) {
if (!bestTc || tc->priority() > bestTc->priority())