Merge remote-tracking branch 'origin/4.11' into 4.12

Change-Id: I00ccdc2c79176799fe9d20ecfe42c260796d7d97
This commit is contained in:
Eike Ziller
2020-03-05 09:36:40 +01:00
2 changed files with 18 additions and 7 deletions

View File

@@ -25,8 +25,10 @@
#include "cmakekitinformation.h" #include "cmakekitinformation.h"
#include "cmakeprojectconstants.h" #include "cmakeprojectconstants.h"
#include "cmaketoolmanager.h" #include "cmakeprojectplugin.h"
#include "cmakespecificsettings.h"
#include "cmaketool.h" #include "cmaketool.h"
#include "cmaketoolmanager.h"
#include <app/app_version.h> #include <app/app_version.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -611,10 +613,19 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const
return g.matches("Ninja", extraGenerator); return g.matches("Ninja", extraGenerator);
}); });
if (it != known.constEnd()) { if (it != known.constEnd()) {
Utils::Environment env = Utils::Environment::systemEnvironment(); const bool hasNinja = [k]() {
k->addToEnvironment(env); Internal::CMakeSpecificSettings *settings
const Utils::FilePath ninjaExec = env.searchInPath(QLatin1String("ninja")); = Internal::CMakeProjectPlugin::projectTypeSpecificSettings();
if (!ninjaExec.isEmpty())
if (settings->ninjaPath().isEmpty()) {
Utils::Environment env = Utils::Environment::systemEnvironment();
k->addToEnvironment(env);
return !env.searchInPath("ninja").isEmpty();
}
return true;
}();
if (hasNinja)
return GeneratorInfo({QString("Ninja"), extraGenerator, QString(), QString()}).toVariant(); return GeneratorInfo({QString("Ninja"), extraGenerator, QString(), QString()}).toVariant();
} }

View File

@@ -139,8 +139,8 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
const int aboveValue = m_scrollBar->value(); const int aboveValue = m_scrollBar->value();
const int belowValue = m_scrollBar->maximum() - m_scrollBar->value(); const int belowValue = m_scrollBar->maximum() - m_scrollBar->value();
const int sizeDocAbove = aboveValue * int(m_highlightController->lineHeight()); const int sizeDocAbove = int(aboveValue * m_highlightController->lineHeight());
const int sizeDocBelow = belowValue * int(m_highlightController->lineHeight()); const int sizeDocBelow = int(belowValue * m_highlightController->lineHeight());
const int sizeDocVisible = int(m_highlightController->visibleRange()); const int sizeDocVisible = int(m_highlightController->visibleRange());
const int scrollBarBackgroundHeight = aboveHandleRect.height() + belowHandleRect.height(); const int scrollBarBackgroundHeight = aboveHandleRect.height() + belowHandleRect.height();