Merge remote-tracking branch 'origin/4.14'

Conflicts:
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: I2136ba89d3aa3c4c2a0e7a4f9d8ba9cec32924ce
This commit is contained in:
Eike Ziller
2020-11-30 16:14:32 +01:00
92 changed files with 1268 additions and 655 deletions

View File

@@ -490,8 +490,7 @@ AndroidBuildApkStep::AndroidBuildApkStep(BuildStepList *parent, Utils::Id id)
sdkManager()->latestAndroidSdkPlatform()))
{
setImmutable(true);
setDisplayName("<b>" + tr("Build Android APK") + "</b>");
setSummaryText(displayName());
setDisplayName(tr("Build Android APK"));
}
bool AndroidBuildApkStep::init()
@@ -899,6 +898,9 @@ void AndroidBuildApkStep::stdError(const QString &output)
QString newOutput = output;
newOutput.remove(QRegularExpression("^(\\n)+"));
if (newOutput.isEmpty())
return;
if (newOutput.startsWith("warning", Qt::CaseInsensitive)
|| newOutput.startsWith("note", Qt::CaseInsensitive))
TaskHub::addTask(BuildSystemTask(Task::Warning, newOutput));

View File

@@ -556,6 +556,9 @@ void AndroidDeployQtStep::stdError(const QString &line)
QString newOutput = line;
newOutput.remove(QRegularExpression("^(\\n)+"));
if (newOutput.isEmpty())
return;
if (newOutput.startsWith("warning", Qt::CaseInsensitive)
|| newOutput.startsWith("note", Qt::CaseInsensitive))
TaskHub::addTask(DeploymentTask(Task::Warning, newOutput));

View File

@@ -255,6 +255,17 @@ static QImage scaleWithoutStretching(const QImage& original, const QSize& target
return ret;
}
static bool similarFilesExist(const QString &path)
{
QFileInfo fileInfo(path);
QDir imageDir(fileInfo.absolutePath());
QString baseName(fileInfo.completeBaseName());
baseName.append(QLatin1String(".*"));
imageDir.setNameFilters({baseName});
auto entries = imageDir.entryList();
return !entries.empty();
}
void AndroidManifestEditorIconWidget::copyIcon()
{
if (m_targetIconPath.isEmpty())
@@ -269,7 +280,8 @@ void AndroidManifestEditorIconWidget::copyIcon()
if (m_iconPath != targetPath)
removeIcon();
if (original.isNull()) {
m_iconPath.clear();
if (!similarFilesExist(m_iconPath))
m_iconPath.clear();
return;
}
if (m_iconPath == targetPath)

View File

@@ -25,6 +25,8 @@
#include "androidsdkdownloader.h"
#include <coreplugin/icore.h>
#include <QDir>
#include <QDirIterator>
#include <QLoggingCategory>
@@ -85,8 +87,9 @@ void AndroidSdkDownloader::downloadAndExtractSdk(const QString &jdkPath, const Q
connect(m_reply, &QNetworkReply::sslErrors, this, &AndroidSdkDownloader::sslErrors);
#endif
m_progressDialog = new QProgressDialog(tr("Downloading SDK Tools package..."), tr("Cancel"), 0, 100);
m_progressDialog->setWindowModality(Qt::WindowModal);
m_progressDialog = new QProgressDialog(tr("Downloading SDK Tools package..."), tr("Cancel"),
0, 100, Core::ICore::dialogParent());
m_progressDialog->setWindowModality(Qt::ApplicationModal);
m_progressDialog->setWindowTitle(dialogTitle());
m_progressDialog->setFixedSize(m_progressDialog->sizeHint());

View File

@@ -331,11 +331,6 @@ ToolChain::MacroInspectionRunner IarToolChain::createMacroInspectionRunner() con
};
}
Macros IarToolChain::predefinedMacros(const QStringList &cxxflags) const
{
return createMacroInspectionRunner()(cxxflags).macros;
}
Utils::LanguageExtensions IarToolChain::languageExtensions(const QStringList &) const
{
return LanguageExtension::None;
@@ -371,13 +366,6 @@ ToolChain::BuiltInHeaderPathsRunner IarToolChain::createBuiltInHeaderPathsRunner
};
}
HeaderPaths IarToolChain::builtInHeaderPaths(const QStringList &cxxFlags,
const FilePath &fileName,
const Environment &env) const
{
return createBuiltInHeaderPathsRunner(env)(cxxFlags, fileName.toString(), "");
}
void IarToolChain::addToEnvironment(Environment &env) const
{
if (!compilerCommand().isEmpty()) {

View File

@@ -56,15 +56,11 @@ public:
bool isValid() const final;
MacroInspectionRunner createMacroInspectionRunner() const final;
ProjectExplorer::Macros predefinedMacros(const QStringList &cxxflags) const final;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final;
Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const final;
ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags,
const Utils::FilePath &,
const Utils::Environment &env) const final;
void addToEnvironment(Utils::Environment &env) const final;
QList<Utils::OutputLineParser *> createOutputParsers() const final;

View File

@@ -462,11 +462,6 @@ ToolChain::MacroInspectionRunner KeilToolChain::createMacroInspectionRunner() co
};
}
Macros KeilToolChain::predefinedMacros(const QStringList &cxxflags) const
{
return createMacroInspectionRunner()(cxxflags).macros;
}
Utils::LanguageExtensions KeilToolChain::languageExtensions(const QStringList &) const
{
return LanguageExtension::None;
@@ -496,13 +491,6 @@ ToolChain::BuiltInHeaderPathsRunner KeilToolChain::createBuiltInHeaderPathsRunne
};
}
HeaderPaths KeilToolChain::builtInHeaderPaths(const QStringList &cxxFlags,
const FilePath &fileName,
const Environment &env) const
{
return createBuiltInHeaderPathsRunner(env)(cxxFlags, fileName.toString(), "");
}
void KeilToolChain::addToEnvironment(Environment &env) const
{
if (!compilerCommand().isEmpty()) {

View File

@@ -56,16 +56,12 @@ public:
bool isValid() const final;
MacroInspectionRunner createMacroInspectionRunner() const final;
ProjectExplorer::Macros predefinedMacros(const QStringList &cxxflags) const final;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final;
Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
const Utils::Environment &) const final;
ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags,
const Utils::FilePath &,
const Utils::Environment &env) const final;
void addToEnvironment(Utils::Environment &env) const final;
QList<Utils::OutputLineParser *> createOutputParsers() const final;

View File

@@ -248,11 +248,6 @@ ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() co
};
}
Macros SdccToolChain::predefinedMacros(const QStringList &cxxflags) const
{
return createMacroInspectionRunner()(cxxflags).macros;
}
Utils::LanguageExtensions SdccToolChain::languageExtensions(const QStringList &) const
{
return LanguageExtension::None;
@@ -278,13 +273,6 @@ ToolChain::BuiltInHeaderPathsRunner SdccToolChain::createBuiltInHeaderPathsRunne
};
}
HeaderPaths SdccToolChain::builtInHeaderPaths(const QStringList &cxxFlags,
const FilePath &fileName,
const Environment &env) const
{
return createBuiltInHeaderPathsRunner(env)(cxxFlags, fileName.toString(), "");
}
void SdccToolChain::addToEnvironment(Environment &env) const
{
if (!compilerCommand().isEmpty()) {

View File

@@ -55,16 +55,12 @@ public:
bool isValid() const final;
MacroInspectionRunner createMacroInspectionRunner() const final;
ProjectExplorer::Macros predefinedMacros(const QStringList &cxxflags) const final;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const final;
Utils::WarningFlags warningFlags(const QStringList &cxxflags) const final;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
const Utils::Environment &) const final;
ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags,
const Utils::FilePath &,
const Utils::Environment &env) const final;
void addToEnvironment(Utils::Environment &env) const final;
QList<Utils::OutputLineParser *> createOutputParsers() const final;

View File

@@ -64,7 +64,7 @@ using namespace Core;
namespace BinEditor {
namespace Internal {
const QChar MidpointChar = QLatin1Char(0xB7);
const QChar MidpointChar(u'\u00B7');
static QByteArray calculateHexPattern(const QByteArray &pattern)
{

View File

@@ -837,12 +837,16 @@ FilePath CMakeBuildSystem::workDirectory(const BuildDirParameters &parameters)
{
const Utils::FilePath bdir = parameters.buildDirectory;
const CMakeTool *cmake = parameters.cmakeTool();
// use the build directory if it already exists anyhow
if (bdir.exists()) {
m_buildDirToTempDir.erase(bdir);
return bdir;
}
if (cmake && cmake->autoCreateBuildDirectory()) {
// use the build directory if the cmake tool settings are set to automatically create them,
// or if the configuration was changed by the user
if ((cmake && cmake->autoCreateBuildDirectory()) || !parameters.extraCMakeArguments.isEmpty()) {
if (!cmakeBuildConfiguration()->createBuildDirectory())
handleParsingFailed(
tr("Failed to create build directory \"%1\".").arg(bdir.toUserOutput()));

View File

@@ -153,6 +153,9 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget
EditorManager::openEditorAt(fp.toString(), line, column);
});
connect(verticalScrollBar(), &QAbstractSlider::sliderMoved,
this, &OutputWindow::updateAutoScroll);
undoAction->setEnabled(false);
redoAction->setEnabled(false);
cutAction->setEnabled(false);
@@ -219,9 +222,8 @@ void OutputWindow::resizeEvent(QResizeEvent *e)
{
//Keep scrollbar at bottom of window while resizing, to ensure we keep scrolling
//This can happen if window is resized while building, or if the horizontal scrollbar appears
bool atBottom = isScrollbarAtBottom();
QPlainTextEdit::resizeEvent(e);
if (atBottom)
if (d->scrollToBottom)
scrollToBottom();
}
@@ -252,7 +254,6 @@ void OutputWindow::showEvent(QShowEvent *e)
QPlainTextEdit::showEvent(e);
if (d->scrollToBottom)
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
d->scrollToBottom = false;
}
void OutputWindow::wheelEvent(QWheelEvent *e)
@@ -272,6 +273,7 @@ void OutputWindow::wheelEvent(QWheelEvent *e)
}
}
QAbstractScrollArea::wheelEvent(e);
updateAutoScroll();
updateMicroFocus();
}
@@ -348,8 +350,6 @@ void OutputWindow::updateFilterProperties(
void OutputWindow::filterNewContent()
{
bool atBottom = isScrollbarAtBottom();
QTextBlock lastBlock = document()->findBlockByNumber(d->lastFilteredBlockNumber);
if (!lastBlock.isValid())
lastBlock = document()->begin();
@@ -381,7 +381,7 @@ void OutputWindow::filterNewContent()
// FIXME: Why on earth is this necessary? We should probably do something else instead...
setDocument(document());
if (atBottom)
if (d->scrollToBottom)
scrollToBottom();
}
@@ -432,11 +432,9 @@ void OutputWindow::handleOutputChunk(const QString &output, OutputFormat format)
}
}
const bool atBottom = isScrollbarAtBottom() || d->scrollTimer.isActive();
d->scrollToBottom = true;
d->formatter.appendMessage(out, format);
if (atBottom) {
if (d->scrollToBottom) {
if (d->lastMessage.elapsed() < 5) {
d->scrollTimer.start();
} else {
@@ -449,6 +447,11 @@ void OutputWindow::handleOutputChunk(const QString &output, OutputFormat format)
enableUndoRedo();
}
void OutputWindow::updateAutoScroll()
{
d->scrollToBottom = isScrollbarAtBottom();
}
void OutputWindow::setMaxCharCount(int count)
{
d->maxCharCount = count;
@@ -505,6 +508,7 @@ QMimeData *OutputWindow::createMimeDataFromSelection() const
void OutputWindow::clear()
{
d->formatter.clear();
d->scrollToBottom = true;
}
void OutputWindow::flush()

View File

@@ -109,6 +109,7 @@ private:
void filterNewContent();
void handleNextOutputChunk();
void handleOutputChunk(const QString &output, Utils::OutputFormat format);
void updateAutoScroll();
Internal::OutputWindowPrivate *d = nullptr;
};

View File

@@ -43,9 +43,9 @@ static QByteArray overwrittenToolchainDefines(const ProjectPart &projectPart)
// MSVC's predefined macros like __FUNCSIG__ expand to itself.
// We can't parse this, so redefine to the empty string literal.
if (projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) {
defines += "#define __FUNCSIG__ \"\"\n"
"#define __FUNCDNAME__ \"\"\n"
"#define __FUNCTION__ \"\"\n";
defines += "#define __FUNCSIG__ \"void __cdecl someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580(void)\"\n"
"#define __FUNCDNAME__ \"?someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580@@YAXXZ\"\n"
"#define __FUNCTION__ \"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\"\n";
}
return defines;

View File

@@ -356,7 +356,7 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
for (const HeaderPath &headerPath : filter.systemHeaderPaths)
addIncludeDirOptionForPath(headerPath);
if (m_useTweakedHeaderPaths == UseTweakedHeaderPaths::Yes) {
if (m_useTweakedHeaderPaths != UseTweakedHeaderPaths::No) {
QTC_CHECK(!m_clangVersion.isEmpty()
&& "Clang resource directory is required with UseTweakedHeaderPaths::Yes.");
@@ -657,9 +657,9 @@ void CompilerOptionsBuilder::undefineCppLanguageFeatureMacrosForMsvc2015()
void CompilerOptionsBuilder::addDefineFunctionMacrosMsvc()
{
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) {
addMacros({{"__FUNCSIG__", "\"\""},
{"__FUNCTION__", "\"\""},
{"__FUNCDNAME__", "\"\""}});
addMacros({{"__FUNCSIG__", "\"void __cdecl someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580(void)\""},
{"__FUNCTION__", "\"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\""},
{"__FUNCDNAME__", "\"?someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580@@YAXXZ\""}});
}
}

View File

@@ -108,9 +108,8 @@ bool FileIterationOrder::isValid() const
static int commonPrefixLength(const QString &filePath1, const QString &filePath2)
{
const auto mismatches = std::mismatch(filePath1.begin(),
filePath1.end(),
filePath2.begin());
const auto mismatches = std::mismatch(filePath1.begin(), filePath1.end(),
filePath2.begin(), filePath2.end());
return mismatches.first - filePath1.begin();
}

View File

@@ -4165,7 +4165,7 @@ void GdbEngine::setupInferior()
}
if (!symbolFile.isEmpty()) {
runCommand({"-file-symbol-file \"" + symbolFile + '"',
runCommand({"-file-exec-and-symbols \"" + symbolFile + '"',
CB(handleFileExecAndSymbols)});
}
@@ -4197,7 +4197,7 @@ void GdbEngine::setupInferior()
// Do that first, otherwise no symbols are loaded.
QFileInfo fi = executable.toFileInfo();
QString path = fi.absoluteFilePath();
runCommand({"-file-exec-and-symbols \"" + path + '"',
runCommand({"-file-symbol-file \"" + path + '"',
CB(handleFileExecAndSymbols)});
} else if (isTermEngine()) {

View File

@@ -66,11 +66,6 @@ ToolChain::MacroInspectionRunner NimToolChain::createMacroInspectionRunner() con
return ToolChain::MacroInspectionRunner();
}
Macros NimToolChain::predefinedMacros(const QStringList &) const
{
return Macros();
}
LanguageExtensions NimToolChain::languageExtensions(const QStringList &) const
{
return LanguageExtension::None;
@@ -87,12 +82,6 @@ ToolChain::BuiltInHeaderPathsRunner NimToolChain::createBuiltInHeaderPathsRunner
return ToolChain::BuiltInHeaderPathsRunner();
}
HeaderPaths NimToolChain::builtInHeaderPaths(const QStringList &, const FilePath &,
const Environment &) const
{
return {};
}
void NimToolChain::addToEnvironment(Environment &env) const
{
if (isValid())

View File

@@ -41,15 +41,11 @@ public:
bool isValid() const override;
MacroInspectionRunner createMacroInspectionRunner() const override;
ProjectExplorer::Macros predefinedMacros(const QStringList &flags) const final;
Utils::LanguageExtensions languageExtensions(const QStringList &flags) const final;
Utils::WarningFlags warningFlags(const QStringList &flags) const final;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
const Utils::Environment &) const override;
ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &flags,
const Utils::FilePath &sysRoot,
const Utils::Environment &) const final;
void addToEnvironment(Utils::Environment &env) const final;
Utils::FilePath makeCommand(const Utils::Environment &env) const final;
QString compilerVersion() const;

View File

@@ -109,11 +109,6 @@ ToolChain::MacroInspectionRunner CustomToolChain::createMacroInspectionRunner()
};
}
Macros CustomToolChain::predefinedMacros(const QStringList &cxxflags) const
{
return createMacroInspectionRunner()(cxxflags).macros;
}
Utils::LanguageExtensions CustomToolChain::languageExtensions(const QStringList &) const
{
return LanguageExtension::None;
@@ -156,13 +151,6 @@ ToolChain::BuiltInHeaderPathsRunner CustomToolChain::createBuiltInHeaderPathsRun
};
}
HeaderPaths CustomToolChain::builtInHeaderPaths(const QStringList &cxxFlags,
const FilePath &fileName,
const Environment &env) const
{
return createBuiltInHeaderPathsRunner(env)(cxxFlags, fileName.toString(), "");
}
void CustomToolChain::addToEnvironment(Environment &env) const
{
if (!m_compilerCommand.isEmpty()) {

View File

@@ -67,7 +67,6 @@ public:
bool isValid() const override;
MacroInspectionRunner createMacroInspectionRunner() const override;
Macros predefinedMacros(const QStringList &cxxflags) const override;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override;
Utils::WarningFlags warningFlags(const QStringList &cxxflags) const override;
const Macros &rawPredefinedMacros() const;
@@ -75,9 +74,6 @@ public:
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
const Utils::Environment &) const override;
HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags,
const Utils::FilePath &,
const Utils::Environment &env) const override;
void addToEnvironment(Utils::Environment &env) const override;
QStringList suggestedMkspecList() const override;
QList<Utils::OutputLineParser *> createOutputParsers() const override;

View File

@@ -427,7 +427,16 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con
MacrosCache macroCache = predefinedMacrosCache();
Utils::Id lang = language();
// This runner must be thread-safe!
/*
* Asks compiler for set of predefined macros
* flags are the compiler flags collected from project settings
* returns the list of defines, one per line, e.g. "#define __GXX_WEAK__ 1"
* Note: changing compiler flags sometimes changes macros set, e.g. -fopenmp
* adds _OPENMP macro, for full list of macro search by word "when" on this page:
* http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
*
* This runner must be thread-safe!
*/
return [env, compilerCommand = compilerCommand(),
platformCodeGenFlags, reinterpretOptions, macroCache, lang]
(const QStringList &flags) {
@@ -458,20 +467,6 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con
};
}
/**
* @brief Asks compiler for set of predefined macros
* @param cxxflags - compiler flags collected from project settings
* @return defines list, one per line, e.g. "#define __GXX_WEAK__ 1"
*
* @note changing compiler flags sometimes changes macros set, e.g. -fopenmp
* adds _OPENMP macro, for full list of macro search by word "when" on this page:
* http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
*/
ProjectExplorer::Macros GccToolChain::predefinedMacros(const QStringList &cxxflags) const
{
return createMacroInspectionRunner()(cxxflags).macros;
}
/**
* @brief Parses gcc flags -std=*, -fopenmp, -fms-extensions.
* @see http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html
@@ -645,16 +640,6 @@ ToolChain::BuiltInHeaderPathsRunner GccToolChain::createBuiltInHeaderPathsRunner
};
}
HeaderPaths GccToolChain::builtInHeaderPaths(const QStringList &flags,
const FilePath &sysRootPath,
const Environment &env) const
{
return createBuiltInHeaderPathsRunner(env)(flags,
sysRootPath.isEmpty() ? sysRoot()
: sysRootPath.toString(),
originalTargetTriple());
}
void GccToolChain::addCommandPathToEnvironment(const FilePath &command, Environment &env)
{
const Utils::FilePath compilerDir = command.parentDir();
@@ -845,7 +830,7 @@ GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const
{
Environment env = Environment::systemEnvironment();
addToEnvironment(env);
ProjectExplorer::Macros macros = predefinedMacros(QStringList());
ProjectExplorer::Macros macros = createMacroInspectionRunner()({}).macros;
return guessGccAbi(findLocalCompiler(compilerCommand(), env),
env.toStringList(),
macros,

View File

@@ -83,12 +83,7 @@ public:
const QString &directoryPath) const override;
MacroInspectionRunner createMacroInspectionRunner() const override;
Macros predefinedMacros(const QStringList &cxxflags) const override;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &env) const override;
HeaderPaths builtInHeaderPaths(const QStringList &flags,
const Utils::FilePath &sysRootPath,
const Utils::Environment &env) const override;
void addToEnvironment(Utils::Environment &env) const override;
Utils::FilePath makeCommand(const Utils::Environment &environment) const override;

View File

@@ -591,10 +591,10 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags,
QStringList toProcess;
for (const QString &arg : cxxflags) {
if (arg.startsWith(QLatin1String("/D"))) {
if (arg.startsWith("/D") || arg.startsWith("-D")) {
const QString define = arg.mid(2);
predefinedMacros.append(Macro::fromKeyValue(define));
} else if (arg.startsWith(QLatin1String("/U"))) {
} else if (arg.startsWith("/U") || arg.startsWith("-U")) {
predefinedMacros.append(
{arg.mid(2).toLocal8Bit(), ProjectExplorer::MacroType::Undefine});
} else {
@@ -991,11 +991,6 @@ ToolChain::MacroInspectionRunner MsvcToolChain::createMacroInspectionRunner() co
};
}
Macros MsvcToolChain::predefinedMacros(const QStringList &cxxflags) const
{
return createMacroInspectionRunner()(cxxflags).macros;
}
Utils::LanguageExtensions MsvcToolChain::languageExtensions(const QStringList &cxxflags) const
{
using Utils::LanguageExtension;
@@ -1081,13 +1076,6 @@ ToolChain::BuiltInHeaderPathsRunner MsvcToolChain::createBuiltInHeaderPathsRunne
};
}
HeaderPaths MsvcToolChain::builtInHeaderPaths(const QStringList &cxxflags,
const Utils::FilePath &sysRoot,
const Environment &env) const
{
return createBuiltInHeaderPathsRunner(env)(cxxflags, sysRoot.toString(), "");
}
void MsvcToolChain::addToEnvironment(Utils::Environment &env) const
{
// We cache the full environment (incoming + modifications by setup script).

View File

@@ -74,16 +74,12 @@ public:
std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override;
MacroInspectionRunner createMacroInspectionRunner() const override;
Macros predefinedMacros(const QStringList &cxxflags) const override;
Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override;
Utils::WarningFlags warningFlags(const QStringList &cflags) const override;
QStringList includedFiles(const QStringList &flags,
const QString &directoryPath) const override;
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(
const Utils::Environment &env) const override;
HeaderPaths builtInHeaderPaths(const QStringList &cxxflags,
const Utils::FilePath &sysRoot,
const Utils::Environment &env) const override;
void addToEnvironment(Utils::Environment &env) const override;
Utils::FilePath makeCommand(const Utils::Environment &environment) const override;

View File

@@ -123,15 +123,11 @@ public:
// A MacroInspectionRunner is created in the ui thread and runs in another thread.
using MacroInspectionRunner = std::function<MacroInspectionReport(const QStringList &cxxflags)>;
virtual MacroInspectionRunner createMacroInspectionRunner() const = 0;
virtual Macros predefinedMacros(const QStringList &cxxflags) const = 0;
// A BuiltInHeaderPathsRunner is created in the ui thread and runs in another thread.
using BuiltInHeaderPathsRunner = std::function<HeaderPaths(
const QStringList &cxxflags, const QString &sysRoot, const QString &originalTargetTriple)>;
virtual BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &env) const = 0;
virtual HeaderPaths builtInHeaderPaths(const QStringList &cxxflags,
const Utils::FilePath &sysRoot,
const Utils::Environment &env) const = 0;
virtual void addToEnvironment(Utils::Environment &env) const = 0;
virtual Utils::FilePath makeCommand(const Utils::Environment &env) const = 0;

View File

@@ -316,12 +316,9 @@ public:
bool isValid() const override { return m_valid; }
MacroInspectionRunner createMacroInspectionRunner() const override { return MacroInspectionRunner(); }
Macros predefinedMacros(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags) return Macros(); }
LanguageExtensions languageExtensions(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags) return LanguageExtension::None; }
WarningFlags warningFlags(const QStringList &cflags) const override { Q_UNUSED(cflags) return WarningFlags::NoWarnings; }
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner(const Utils::Environment &) const override { return BuiltInHeaderPathsRunner(); }
HeaderPaths builtInHeaderPaths(const QStringList &cxxflags, const FilePath &sysRoot, const Utils::Environment &) const override
{ Q_UNUSED(cxxflags) Q_UNUSED(sysRoot) return {}; }
void addToEnvironment(Environment &env) const override { Q_UNUSED(env) }
FilePath makeCommand(const Environment &) const override { return FilePath::fromString("make"); }
QList<OutputLineParser *> createOutputParsers() const override { return {}; }

View File

@@ -103,11 +103,12 @@ TreeScanner::Result TreeScanner::result() const
TreeScanner::Result TreeScanner::release()
{
if (isFinished()) {
if (isFinished() && m_scanFuture.resultCount() > 0) {
auto result = m_scanFuture.result();
m_scanFuture = Future();
return result;
}
m_scanFuture = Future();
return Result();
}

View File

@@ -39,6 +39,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <projectexplorer/taskhub.h>
#include <qtsupport/profilereader.h>
#include <texteditor/icodestylepreferences.h>
#include <texteditor/tabsettings.h>
@@ -774,7 +775,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile()
&contents,
&m_textFormat,
&errorMsg) != TextFileFormat::ReadSuccess) {
QmakeBuildSystem::proFileParseError(errorMsg);
QmakeBuildSystem::proFileParseError(errorMsg, filePath());
return qMakePair(includeFile, lines);
}
lines = contents.split('\n');
@@ -1655,7 +1656,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult)
}
foreach (const QString &error, evalResult->errors)
QmakeBuildSystem::proFileParseError(error);
QmakeBuildSystem::proFileParseError(error, filePath());
// we are changing what is executed in that case
if (result->state == QmakeEvalResult::EvalFail || m_buildSystem->wasEvaluateCanceled()) {
@@ -1666,8 +1667,10 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult)
if (result->state == QmakeEvalResult::EvalFail) {
QmakeBuildSystem::proFileParseError(
QCoreApplication::translate("QmakeProFile", "Error while parsing file %1. Giving up.")
.arg(filePath().toUserOutput()));
QCoreApplication::translate("QmakeProFile",
"Error while parsing file %1. Giving up.")
.arg(filePath().toUserOutput()),
filePath());
if (m_projectType == ProjectType::Invalid)
return;

View File

@@ -649,6 +649,7 @@ bool QmakeBuildSystem::wasEvaluateCanceled()
void QmakeBuildSystem::asyncUpdate()
{
TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
setParseDelay(UPDATE_INTERVAL);
TRACE("");
@@ -674,7 +675,7 @@ void QmakeBuildSystem::asyncUpdate()
"have a valid Qt.")
.arg(project()->displayName(), k->displayName())
: tr("Cannot parse project \"%1\": No kit selected.").arg(project()->displayName());
proFileParseError(errorMessage);
proFileParseError(errorMessage, project()->projectFilePath());
m_asyncUpdateFutureInterface.reportCanceled();
m_asyncUpdateFutureInterface.reportFinished();
return;
@@ -764,9 +765,9 @@ FilePath QmakeBuildSystem::buildDir(const FilePath &proFilePath) const
return FilePath::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir)));
}
void QmakeBuildSystem::proFileParseError(const QString &errorMessage)
void QmakeBuildSystem::proFileParseError(const QString &errorMessage, const FilePath &filePath)
{
Core::MessageManager::write(errorMessage);
TaskHub::addTask(BuildSystemTask(Task::Error, errorMessage, filePath));
}
QtSupport::ProFileReader *QmakeBuildSystem::createProFileReader(const QmakeProFile *qmakeProFile)

View File

@@ -158,7 +158,7 @@ public:
void watchFolders(const QStringList &l, QmakePriFile *file);
void unwatchFolders(const QStringList &l, QmakePriFile *file);
static void proFileParseError(const QString &errorMessage);
static void proFileParseError(const QString &errorMessage, const Utils::FilePath &filePath);
enum AsyncUpdateState { Base, AsyncFullUpdatePending, AsyncPartialUpdatePending, AsyncUpdateInProgress, ShuttingDown };
AsyncUpdateState asyncUpdateState() const;

View File

@@ -236,7 +236,8 @@ void FormEditorView::temporaryBlockView(int duration)
timer->start(duration);
connect(timer, &QTimer::timeout, this, [this]() {
m_formEditorWidget->graphicsView()->setUpdatesEnabled(true);
if (m_formEditorWidget && m_formEditorWidget->graphicsView())
m_formEditorWidget->graphicsView()->setUpdatesEnabled(true);
});
}

View File

@@ -458,8 +458,12 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
environment.set("QML_BAD_GUI_RENDER_LOOP", "true");
environment.set("QML_PUPPET_MODE", "true");
environment.set("QML_DISABLE_DISK_CACHE", "true");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (!environment.hasKey("QT_SCREEN_SCALE_FACTORS") && !environment.hasKey("QT_SCALE_FACTOR")
&& QApplication::testAttribute(Qt::AA_EnableHighDpiScaling))
#else
if (!environment.hasKey("QT_SCREEN_SCALE_FACTORS") && !environment.hasKey("QT_SCALE_FACTOR"))
#endif
environment.set("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
#ifndef QMLDESIGNER_TEST

View File

@@ -26,10 +26,12 @@
#include "profilereader.h"
#include <coreplugin/icore.h>
#include <projectexplorer/taskhub.h>
#include <QCoreApplication>
#include <QDebug>
using namespace ProjectExplorer;
using namespace QtSupport;
static QString format(const QString &fileName, int lineNo, const QString &msg)
@@ -53,7 +55,7 @@ ProMessageHandler::ProMessageHandler(bool verbose, bool exact)
ProMessageHandler::~ProMessageHandler()
{
if (!m_messages.isEmpty())
Core::MessageManager::writeMessages(m_messages);
Core::MessageManager::writeMessages(m_messages, Core::MessageManager::Flash);
}
@@ -61,14 +63,22 @@ ProMessageHandler::~ProMessageHandler()
void ProMessageHandler::message(int type, const QString &msg, const QString &fileName, int lineNo)
{
if ((type & CategoryMask) == ErrorMessage && ((type & SourceMask) == SourceParser || m_verbose)) {
appendMessage(format(fileName, lineNo, msg));
// parse error in qmake files
TaskHub::addTask(
BuildSystemTask(Task::Error, msg, Utils::FilePath::fromString(fileName), lineNo));
}
}
void ProMessageHandler::fileMessage(int type, const QString &msg)
{
Q_UNUSED(type)
if (m_verbose)
// message(), warning() or error() calls in qmake files
if (!m_verbose)
return;
if (type == QMakeHandler::ErrorMessage)
TaskHub::addTask(BuildSystemTask(Task::Error, msg));
else if (type == QMakeHandler::WarningMessage)
TaskHub::addTask(BuildSystemTask(Task::Warning, msg));
else
appendMessage(msg);
}