forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.5'
Change-Id: Iceaa4ca40b5318744bde8a76c6d3ccca08df71bb
This commit is contained in:
@@ -14,6 +14,11 @@ function readOutput(executable, args)
|
||||
return output;
|
||||
}
|
||||
|
||||
function readListOutput(executable, args)
|
||||
{
|
||||
return readOutput(executable, args).split(/\s+/);
|
||||
}
|
||||
|
||||
function isSuitableLLVMConfig(llvmConfigCandidate, qtcFunctions)
|
||||
{
|
||||
if (File.exists(llvmConfigCandidate)) {
|
||||
@@ -75,3 +80,66 @@ function libraries(targetOS)
|
||||
{
|
||||
return targetOS.contains("windows") ? ["libclang.lib", "advapi32.lib", "shell32.lib"] : ["clang"]
|
||||
}
|
||||
|
||||
function toolingLibs(llvmConfig, targetOS)
|
||||
{
|
||||
var fixedList = [
|
||||
"clangTooling",
|
||||
"clangFrontend",
|
||||
"clangIndex",
|
||||
"clangParse",
|
||||
"clangSerialization",
|
||||
"clangSema",
|
||||
"clangEdit",
|
||||
"clangAnalysis",
|
||||
"clangDriver",
|
||||
"clangDynamicASTMatchers",
|
||||
"clangASTMatchers",
|
||||
"clangToolingCore",
|
||||
"clangAST",
|
||||
"clangLex",
|
||||
"clangBasic",
|
||||
];
|
||||
if (targetOS.contains("windows"))
|
||||
fixedList.push("version");
|
||||
var dynamicList = readListOutput(llvmConfig, ["--libs"])
|
||||
.concat(readListOutput(llvmConfig, ["--system-libs"]));
|
||||
return fixedList.concat(dynamicList.map(function(s) {
|
||||
return s.startsWith("-l") ? s.slice(2) : s;
|
||||
}));
|
||||
}
|
||||
|
||||
function toolingParameters(llvmConfig)
|
||||
{
|
||||
var params = {
|
||||
defines: [],
|
||||
includes: [],
|
||||
cxxFlags: [],
|
||||
};
|
||||
var allCxxFlags = readListOutput(llvmConfig, ["--cxxflags"]);
|
||||
for (var i = 0; i < allCxxFlags.length; ++i) {
|
||||
var flag = allCxxFlags[i];
|
||||
if (flag.startsWith("-D") || flag.startsWith("/D")) {
|
||||
params.defines.push(flag.slice(2));
|
||||
continue;
|
||||
}
|
||||
if (flag.startsWith("-I") || flag.startsWith("/I")) {
|
||||
params.includes.push(flag.slice(2));
|
||||
continue;
|
||||
}
|
||||
if (!flag.startsWith("-std") && !flag.startsWith("-O") && !flag.startsWith("/O")
|
||||
&& !flag.startsWith("-march")
|
||||
&& !flag.startsWith("/EH") && flag !== "-fno-exceptions"
|
||||
&& flag !== "/W4" && flag !== "-Werror=date-time"
|
||||
&& flag !== "-Wcovered-switch-default" && flag !== "-fPIC" && flag !== "-pedantic"
|
||||
&& flag !== "-Wstring-conversion" && flag !== "-gsplit-dwarf") {
|
||||
params.cxxFlags.push(flag);
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
function buildMode(llvmConfig)
|
||||
{
|
||||
return readOutput(llvmConfig, ["--build-mode"]);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import qbs
|
||||
import qbs.Environment
|
||||
import qbs.File
|
||||
import qbs.Utilities
|
||||
import QtcFunctions
|
||||
import "functions.js" as ClangFunctions
|
||||
|
||||
@@ -12,6 +14,11 @@ Module {
|
||||
property string llvmIncludeDir
|
||||
property string llvmLibDir
|
||||
property stringList llvmLibs
|
||||
property stringList llvmToolingLibs
|
||||
property stringList llvmToolingDefines
|
||||
property stringList llvmToolingIncludes
|
||||
property stringList llvmToolingCxxFlags
|
||||
property string llvmBuildMode
|
||||
|
||||
configure: {
|
||||
llvmConfig = ClangFunctions.llvmConfig(qbs, QtcFunctions);
|
||||
@@ -19,6 +26,12 @@ Module {
|
||||
llvmIncludeDir = ClangFunctions.includeDir(llvmConfig);
|
||||
llvmLibDir = ClangFunctions.libDir(llvmConfig);
|
||||
llvmLibs = ClangFunctions.libraries(qbs.targetOS);
|
||||
llvmToolingLibs = ClangFunctions.toolingLibs(llvmConfig, qbs.targetOS);
|
||||
llvmBuildMode = ClangFunctions.buildMode(llvmConfig);
|
||||
var toolingParams = ClangFunctions.toolingParameters(llvmConfig);
|
||||
llvmToolingDefines = toolingParams.defines;
|
||||
llvmToolingIncludes = toolingParams.includes;
|
||||
llvmToolingCxxFlags = toolingParams.cxxFlags;
|
||||
found = llvmConfig && File.exists(llvmIncludeDir.concat("/clang-c/Index.h"));
|
||||
}
|
||||
}
|
||||
@@ -28,6 +41,17 @@ Module {
|
||||
property string llvmIncludeDir: clangProbe.llvmIncludeDir
|
||||
property string llvmLibDir: clangProbe.llvmLibDir
|
||||
property stringList llvmLibs: clangProbe.llvmLibs
|
||||
property stringList llvmToolingLibs: clangProbe.llvmToolingLibs
|
||||
property string llvmBuildMode: clangProbe.llvmBuildMode
|
||||
property bool llvmBuildModeMatches: qbs.buildVariant === llvmBuildMode.toLowerCase()
|
||||
property stringList llvmToolingDefines: clangProbe.llvmToolingDefines
|
||||
property stringList llvmToolingIncludes: clangProbe.llvmToolingIncludes.filter(function(incl) {
|
||||
return incl != llvmIncludeDir;
|
||||
})
|
||||
property stringList llvmToolingCxxFlags: clangProbe.llvmToolingCxxFlags
|
||||
property bool toolingEnabled: !Environment.getEnv("QTC_NO_CLANG_LIBTOOLING")
|
||||
&& Utilities.versionCompare(llvmVersion, "3.9") > 0
|
||||
&& Utilities.versionCompare(llvmVersion, "4") < 0
|
||||
|
||||
validate: {
|
||||
if (!clangProbe.found) {
|
||||
|
||||
@@ -157,6 +157,8 @@ osx {
|
||||
INSTALL_APP_PATH = $$QTC_PREFIX/bin
|
||||
}
|
||||
|
||||
gcc:!clang: QMAKE_CXXFLAGS += -Wno-noexcept-type
|
||||
|
||||
RELATIVE_PLUGIN_PATH = $$relative_path($$IDE_PLUGIN_PATH, $$IDE_BIN_PATH)
|
||||
RELATIVE_LIBEXEC_PATH = $$relative_path($$IDE_LIBEXEC_PATH, $$IDE_BIN_PATH)
|
||||
RELATIVE_DATA_PATH = $$relative_path($$IDE_DATA_PATH, $$IDE_BIN_PATH)
|
||||
|
||||
Executable
+61
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Copyright (C) 2017 The Qt Company Ltd.
|
||||
# Contact: https://www.qt.io/licensing/
|
||||
#
|
||||
# This file is part of Qt Creator.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
=head1 NAME
|
||||
|
||||
clazyweb2tasks.pl - Convert Clazy logs as displayed by the Web frontend into
|
||||
Qt Creator task files.
|
||||
|
||||
Expected format:
|
||||
|
||||
Explanation for clazy-strict-iterators
|
||||
./qtbase/src/tools/moc/preprocessor.cpp
|
||||
line 995: for (Symbols::const_iterator j = mergeSymbol + 1; j != i; ++j)
|
||||
=> Mixing iterators with const_iterators
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
clazyweb2tasks.pl < logfile > taskfile
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
|
||||
my $message = '';
|
||||
my $fileName = '';
|
||||
|
||||
while (my $line = <STDIN> ) {
|
||||
chomp($line);
|
||||
if ($line =~ /\s*Explanation for (.*)$/) {
|
||||
$message = $1;
|
||||
} elsif (index($line, './') == 0) {
|
||||
$fileName = substr($line, 2);
|
||||
} elsif ($line =~ /\s*line (\d+):/) {
|
||||
my $lineNumber = $1;
|
||||
print $fileName, "\t", $lineNumber, "\tclazy\t", $message,"\n";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -307,7 +307,7 @@ def main():
|
||||
QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML']
|
||||
QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS']
|
||||
|
||||
plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'sqldrivers', 'xcbglintegrations']
|
||||
plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'sqldrivers', 'styles', 'xcbglintegrations']
|
||||
imports = ['Qt', 'QtWebKit']
|
||||
|
||||
if common.is_windows_platform():
|
||||
|
||||
@@ -702,7 +702,7 @@ class Dumper(DumperBase):
|
||||
self.typesToReport = {}
|
||||
|
||||
if self.forceQtNamespace:
|
||||
self.qtNamepaceToReport = self.qtNamespace()
|
||||
self.qtNamespaceToReport = self.qtNamespace()
|
||||
|
||||
if self.qtNamespaceToReport:
|
||||
self.output += ',qtnamespace="%s"' % self.qtNamespaceToReport
|
||||
@@ -996,8 +996,13 @@ class Dumper(DumperBase):
|
||||
name = objfile.filename
|
||||
if self.isWindowsTarget():
|
||||
isQtCoreObjFile = name.find('Qt5Cored.dll') >= 0 or name.find('Qt5Core.dll') >= 0
|
||||
if not isQtCoreObjFile:
|
||||
isQtCoreObjFile = name.find('QtCored.dll') >= 0 or name.find('QtCore.dll') >= 0
|
||||
else:
|
||||
isQtCoreObjFile = name.find('/libQt5Core') >= 0
|
||||
if not isQtCoreObjFile:
|
||||
isQtCoreObjFile = name.find('/libQtCore') >= 0
|
||||
|
||||
if isQtCoreObjFile:
|
||||
self.handleQtCoreLoaded(objfile)
|
||||
|
||||
@@ -1019,6 +1024,13 @@ class Dumper(DumperBase):
|
||||
if len(ns):
|
||||
ns += '::'
|
||||
break
|
||||
if line.find('currentThreadData ') >= 0:
|
||||
# [ 0] b 0x7ffff67d3000 _ZN2UUL17currentThreadDataE
|
||||
# section .tbss UU::currentThreadData qthread_unix.cpp\\n
|
||||
ns = re.split('_ZN?(\d*)(\w*)L17currentThreadDataE? ', line)[2]
|
||||
if len(ns):
|
||||
ns += '::'
|
||||
break
|
||||
os.remove(tmppath)
|
||||
|
||||
lenns = len(ns)
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
},
|
||||
{
|
||||
"name": "UseVirtualKeyboard",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard.",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard",
|
||||
"type": "CheckBox",
|
||||
"data":
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
},
|
||||
{
|
||||
"name": "UseVirtualKeyboard",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard.",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard",
|
||||
"type": "CheckBox",
|
||||
"data":
|
||||
{
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
},
|
||||
{
|
||||
"name": "UseVirtualKeyboard",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard.",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard",
|
||||
"type": "CheckBox",
|
||||
"data":
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
},
|
||||
{
|
||||
"name": "UseVirtualKeyboard",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard.",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard",
|
||||
"type": "CheckBox",
|
||||
"data":
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
},
|
||||
{
|
||||
"name": "UseVirtualKeyboard",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard.",
|
||||
"trDisplayName": "Use Qt Virtual Keyboard",
|
||||
"type": "CheckBox",
|
||||
"data":
|
||||
{
|
||||
|
||||
@@ -274,10 +274,11 @@ enum { debugLeaks = 0 };
|
||||
|
||||
|
||||
using namespace Utils;
|
||||
using namespace ExtensionSystem::Internal;
|
||||
|
||||
namespace ExtensionSystem {
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
static Internal::PluginManagerPrivate *d = 0;
|
||||
static PluginManager *m_instance = 0;
|
||||
|
||||
@@ -442,7 +443,7 @@ QString PluginManager::systemInformation() const
|
||||
if (response.result == SynchronousProcessResponse::Finished)
|
||||
result += response.allOutput() + "\n";
|
||||
result += "Plugin information:\n\n";
|
||||
auto longestSpec = std::max_element(plugins().cbegin(), plugins().cend(),
|
||||
auto longestSpec = std::max_element(d->pluginSpecs.cbegin(), d->pluginSpecs.cend(),
|
||||
[](const PluginSpec *left, const PluginSpec *right) {
|
||||
return left->name().size() < right->name().size();
|
||||
});
|
||||
|
||||
@@ -421,8 +421,9 @@ void PluginView::updatePlugins()
|
||||
|
||||
|
||||
QList<CollectionItem *> collections;
|
||||
auto end = PluginManager::pluginCollections().cend();
|
||||
for (auto it = PluginManager::pluginCollections().cbegin(); it != end; ++it) {
|
||||
const QHash<QString, QList<PluginSpec *>> pluginCollections = PluginManager::pluginCollections();
|
||||
const auto end = pluginCollections.cend();
|
||||
for (auto it = pluginCollections.cbegin(); it != end; ++it) {
|
||||
const QString name = it.key().isEmpty() ? tr("Utilities") : it.key();
|
||||
collections.append(new CollectionItem(name, it.value(), this));
|
||||
}
|
||||
|
||||
@@ -136,10 +136,10 @@ QStringList NameController::buildElementsPath(const QString &filePath, bool igno
|
||||
QList<QString> relativeElements;
|
||||
|
||||
QStringList split = filePath.split("/");
|
||||
QStringList::const_iterator splitEnd = split.end();
|
||||
QStringList::const_iterator splitEnd = split.constEnd();
|
||||
if (ignoreLastFilePathPart || split.last().isEmpty())
|
||||
splitEnd = --splitEnd;
|
||||
for (auto it = split.cbegin(); it != splitEnd; ++it) {
|
||||
for (auto it = split.constBegin(); it != splitEnd; ++it) {
|
||||
QString packageName = qmt::NameController::convertFileNameToElementName(*it);
|
||||
relativeElements.append(packageName);
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ int SavingRefMap::countDanglingReferences()
|
||||
|
||||
bool SavingRefMap::hasRef(const void *address, const char *typeName)
|
||||
{
|
||||
return m_references.find(KeyType(address, typeName)) != m_references.end();
|
||||
return m_references.constFind(KeyType(address, typeName)) != m_references.constEnd();
|
||||
}
|
||||
|
||||
bool SavingRefMap::hasDefinedRef(const void *address, const char *typeName)
|
||||
{
|
||||
MapType::const_iterator it = m_references.find(KeyType(address, typeName));
|
||||
if (it == m_references.end())
|
||||
const MapType::const_iterator it = m_references.constFind(KeyType(address, typeName));
|
||||
if (it == m_references.constEnd())
|
||||
return false;
|
||||
return it.value().second;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,8 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
|
||||
// check if absolute path is found in sysroot
|
||||
if (!m_sysroot.isEmpty()) {
|
||||
const QString sysrootPath = m_sysroot + originalPath;
|
||||
if (QFileInfo(sysrootPath).exists() && QFileInfo(sysrootPath).isFile()) {
|
||||
QFileInfo sysrootInfo(sysrootPath);
|
||||
if (sysrootInfo.exists() && sysrootInfo.isFile()) {
|
||||
if (success)
|
||||
*success = true;
|
||||
m_cache.insert(originalPath, sysrootPath);
|
||||
|
||||
@@ -258,13 +258,14 @@ void JsonSchema::enterNestedTypeSchema()
|
||||
|
||||
QStringList JsonSchema::properties(JsonObjectValue *v) const
|
||||
{
|
||||
typedef QHash<QString, JsonValue *>::ConstIterator MemberConstIterator;
|
||||
using Members = QHash<QString, JsonValue *>;
|
||||
|
||||
QStringList all;
|
||||
|
||||
if (JsonObjectValue *ov = getObjectValue(kProperties(), v)) {
|
||||
const MemberConstIterator cend = ov->members().constEnd();
|
||||
for (MemberConstIterator it = ov->members().constBegin(); it != cend; ++it)
|
||||
const Members members = ov->members();
|
||||
const Members::ConstIterator cend = members.constEnd();
|
||||
for (Members::ConstIterator it = members.constBegin(); it != cend; ++it)
|
||||
if (hasPropertySchema(it.key()))
|
||||
all.append(it.key());
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT SaveFile : public QTemporaryFile
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SaveFile(const QString &filename);
|
||||
virtual ~SaveFile();
|
||||
|
||||
@@ -67,7 +67,10 @@ const char BuildTargetSdkKey[] = "BuildTargetSdk";
|
||||
const char VerboseOutputKey[] = "VerboseOutput";
|
||||
const char UseMinistroKey[] = "UseMinistro";
|
||||
|
||||
class PasswordInputDialog : public QDialog {
|
||||
class PasswordInputDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Context{
|
||||
KeystorePassword = 1,
|
||||
@@ -433,3 +436,5 @@ QString PasswordInputDialog::getPassword(Context context, std::function<bool (co
|
||||
}
|
||||
|
||||
} // namespace Android
|
||||
|
||||
#include "androidbuildapkstep.moc"
|
||||
|
||||
@@ -107,6 +107,7 @@ IDevice::Ptr AndroidDevice::clone() const
|
||||
QUrl AndroidDevice::toolControlChannel(const ControlChannelHint &) const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(urlTcpScheme());
|
||||
url.setHost("localhost");
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -180,8 +180,8 @@ static void sdkManagerCommand(const AndroidConfig &config, const QStringList &ar
|
||||
output.success = false;
|
||||
output.stdOutput = response.stdOut();
|
||||
output.stdError = QCoreApplication::translate("Android::Internal::AndroidSdkManager",
|
||||
"Operation requires user interaction."
|
||||
"Please use \"sdkmanager\" commandline tool");
|
||||
"The operation requires user interaction. "
|
||||
"Use the \"sdkmanager\" command-line tool.");
|
||||
} else {
|
||||
output.success = response.result == SynchronousProcessResponse::Finished;
|
||||
}
|
||||
|
||||
@@ -52,21 +52,6 @@ namespace Internal {
|
||||
|
||||
using namespace std::placeholders;
|
||||
|
||||
class OptionsDialog : public QDialog
|
||||
{
|
||||
public:
|
||||
OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &args,
|
||||
QWidget *parent = nullptr);
|
||||
~OptionsDialog();
|
||||
|
||||
QStringList sdkManagerArguments() const;
|
||||
|
||||
private:
|
||||
QPlainTextEdit *argumentDetailsEdit;
|
||||
QLineEdit *argumentsEdit;
|
||||
QFuture<QString> m_optionsFuture;
|
||||
};
|
||||
|
||||
class PackageFilterModel : public QSortFilterProxyModel
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -27,8 +27,14 @@
|
||||
#include "androidconfigurations.h"
|
||||
#include "androidsdkmanager.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
#include <QFutureWatcher>
|
||||
#include <QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
class QPlainTextEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class OutputFormatter; }
|
||||
|
||||
@@ -42,6 +48,23 @@ namespace Ui {
|
||||
|
||||
class AndroidSdkModel;
|
||||
|
||||
class OptionsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OptionsDialog(AndroidSdkManager *sdkManager, const QStringList &args,
|
||||
QWidget *parent = nullptr);
|
||||
~OptionsDialog();
|
||||
|
||||
QStringList sdkManagerArguments() const;
|
||||
|
||||
private:
|
||||
QPlainTextEdit *argumentDetailsEdit;
|
||||
QLineEdit *argumentsEdit;
|
||||
QFuture<QString> m_optionsFuture;
|
||||
};
|
||||
|
||||
class AndroidSdkManagerWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="useXMLOutputCB">
|
||||
<property name="toolTip">
|
||||
<string>XML output recommended as it avoids parsing issues, while plain text is more human readable.
|
||||
<string>XML output is recommended, because it avoids parsing issues, while plain text is more human readable.
|
||||
|
||||
Warning: Plain text output is missing some information (e.g. duration)</string>
|
||||
Warning: Plain text misses some information, such as duration.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use XML output</string>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <QAbstractItemView>
|
||||
#include <QPainter>
|
||||
#include <QTextLayout>
|
||||
#include <QWindow>
|
||||
|
||||
namespace Autotest {
|
||||
namespace Internal {
|
||||
@@ -57,20 +58,20 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
painter->save();
|
||||
|
||||
QFontMetrics fm(opt.font);
|
||||
QBrush background;
|
||||
QColor foreground;
|
||||
|
||||
const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(opt.widget);
|
||||
const bool selected = opt.state & QStyle::State_Selected;
|
||||
|
||||
if (selected) {
|
||||
painter->setBrush(opt.palette.highlight().color());
|
||||
background = opt.palette.highlight().color();
|
||||
foreground = opt.palette.highlightedText().color();
|
||||
} else {
|
||||
painter->setBrush(opt.palette.window().color());
|
||||
background = opt.palette.window().color();
|
||||
foreground = opt.palette.text().color();
|
||||
}
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->drawRect(opt.rect);
|
||||
painter->fillRect(opt.rect, background);
|
||||
painter->setPen(foreground);
|
||||
|
||||
TestResultFilterModel *resultFilterModel = static_cast<TestResultFilterModel *>(view->model());
|
||||
@@ -78,10 +79,13 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
const TestResult *testResult = resultFilterModel->testResult(index);
|
||||
QTC_ASSERT(testResult, painter->restore();return);
|
||||
|
||||
const QWidget *widget = dynamic_cast<const QWidget*>(painter->device());
|
||||
QWindow *window = widget ? widget->window()->windowHandle() : nullptr;
|
||||
|
||||
QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
|
||||
if (!icon.isNull())
|
||||
painter->drawPixmap(positions.left(), positions.top(),
|
||||
icon.pixmap(positions.iconSize(), positions.iconSize()));
|
||||
icon.pixmap(window, QSize(positions.iconSize(), positions.iconSize())));
|
||||
|
||||
QString typeStr = TestResult::resultToString(testResult->result());
|
||||
if (selected) {
|
||||
@@ -130,9 +134,10 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
painter->drawText(positions.lineAreaLeft(), positions.top() + fm.ascent(), line);
|
||||
}
|
||||
|
||||
painter->setClipRect(opt.rect);
|
||||
painter->setClipping(false);
|
||||
painter->setPen(opt.palette.mid().color());
|
||||
painter->drawLine(0, opt.rect.bottom(), opt.rect.right(), opt.rect.bottom());
|
||||
const QRectF adjustedRect(QRectF(opt.rect).adjusted(0.5, 0.5, -0.5, -0.5));
|
||||
painter->drawLine(adjustedRect.bottomLeft(), adjustedRect.bottomRight());
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
|
||||
@@ -278,8 +278,12 @@ void TestTreeModel::handleParseResult(const TestParseResult *result, TestTreeIte
|
||||
|
||||
void TestTreeModel::removeAllTestItems()
|
||||
{
|
||||
for (Utils::TreeItem *item : *rootItem())
|
||||
for (Utils::TreeItem *item : *rootItem()) {
|
||||
item->removeChildren();
|
||||
TestTreeItem *testTreeItem = static_cast<TestTreeItem *>(item);
|
||||
if (testTreeItem->checked() == Qt::PartiallyChecked)
|
||||
testTreeItem->setChecked(Qt::Checked);
|
||||
}
|
||||
emit testTreeModelChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import qbs
|
||||
import qbs.FileInfo
|
||||
|
||||
QtcPlugin {
|
||||
name: "ClangPchManager"
|
||||
|
||||
Depends { name: "libclang"; required: false }
|
||||
condition: libclang.present && libclang.toolingEnabled
|
||||
|
||||
Depends { name: "ClangSupport" }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
|
||||
cpp.defines: {
|
||||
var defines = base;
|
||||
defines.push("CLANGPCHMANAGER_LIB");
|
||||
|
||||
// The following defines are used to determine the clang include path for intrinsics.
|
||||
defines.push('CLANG_VERSION="' + libclang.llvmVersion + '"');
|
||||
var resourceDir = FileInfo.joinPaths(libclang.llvmLibDir, "clang", libclang.llvmVersion,
|
||||
"include");
|
||||
defines.push('CLANG_RESOURCE_DIR="' + resourceDir + '"');
|
||||
return defines;
|
||||
}
|
||||
|
||||
cpp.includePaths: ["."]
|
||||
|
||||
files: [
|
||||
"clangpchmanagerplugin.cpp",
|
||||
"clangpchmanagerplugin.h",
|
||||
"clangpchmanager_global.h",
|
||||
"pchmanagerclient.cpp",
|
||||
"pchmanagerclient.h",
|
||||
"pchmanagernotifierinterface.cpp",
|
||||
"pchmanagernotifierinterface.h",
|
||||
"pchmanagerconnectionclient.cpp",
|
||||
"pchmanagerconnectionclient.h",
|
||||
"pchmanagerprojectupdater.cpp",
|
||||
"pchmanagerprojectupdater.h",
|
||||
"projectupdater.cpp",
|
||||
"projectupdater.h",
|
||||
"qtcreatorprojectupdater.cpp",
|
||||
"qtcreatorprojectupdater.h",
|
||||
]
|
||||
}
|
||||
@@ -50,6 +50,8 @@ class SearchInterface;
|
||||
|
||||
class ClangQueryProjectsFindFilter : public Core::IFindFilter
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ClangQueryProjectsFindFilter(ClangBackEnd::RefactoringServerInterface &server,
|
||||
SearchInterface &searchInterface,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import qbs
|
||||
import qbs.FileInfo
|
||||
|
||||
QtcPlugin {
|
||||
name: "ClangRefactoring"
|
||||
|
||||
Depends { name: "libclang"; required: false }
|
||||
condition: libclang.present && libclang.toolingEnabled
|
||||
|
||||
Depends { name: "ClangSupport" }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "ClangPchManager" }
|
||||
Depends { name: "Core" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "TextEditor" }
|
||||
|
||||
cpp.defines: {
|
||||
var defines = base;
|
||||
defines.push("CLANGPCHMANAGER_LIB");
|
||||
|
||||
// The following defines are used to determine the clang include path for intrinsics.
|
||||
defines.push('CLANG_VERSION="' + libclang.llvmVersion + '"');
|
||||
var resourceDir = FileInfo.joinPaths(libclang.llvmLibDir, "clang", libclang.llvmVersion,
|
||||
"include");
|
||||
defines.push('CLANG_RESOURCE_DIR="' + resourceDir + '"');
|
||||
return defines;
|
||||
}
|
||||
|
||||
cpp.includePaths: ["."]
|
||||
|
||||
files: [
|
||||
"baseclangquerytexteditorwidget.cpp",
|
||||
"baseclangquerytexteditorwidget.h",
|
||||
"clangqueryexamplehighlighter.cpp",
|
||||
"clangqueryexamplehighlighter.h",
|
||||
"clangqueryexamplehighlightmarker.h",
|
||||
"clangqueryexampletexteditorwidget.cpp",
|
||||
"clangqueryexampletexteditorwidget.h",
|
||||
"clangqueryhighlighter.cpp",
|
||||
"clangqueryhighlighter.h",
|
||||
"clangqueryhighlightmarker.h",
|
||||
"clangqueryhoverhandler.cpp",
|
||||
"clangqueryhoverhandler.h",
|
||||
"clangqueryprojectsfindfilter.cpp",
|
||||
"clangqueryprojectsfindfilter.h",
|
||||
"clangqueryprojectsfindfilter.ui",
|
||||
"clangqueryprojectsfindfilterwidget.cpp",
|
||||
"clangqueryprojectsfindfilterwidget.h",
|
||||
"clangquerytexteditorwidget.cpp",
|
||||
"clangquerytexteditorwidget.h",
|
||||
"clangrefactoringplugin.cpp",
|
||||
"clangrefactoringplugin.h",
|
||||
"projectpartutilities.cpp",
|
||||
"projectpartutilities.h",
|
||||
"qtcreatorclangqueryfindfilter.cpp",
|
||||
"qtcreatorclangqueryfindfilter.h",
|
||||
"qtcreatorsearch.cpp",
|
||||
"qtcreatorsearch.h",
|
||||
"qtcreatorsearchhandle.cpp",
|
||||
"qtcreatorsearchhandle.h",
|
||||
"querysqlitestatementfactory.h",
|
||||
"refactoringclient.cpp",
|
||||
"refactoringclient.h",
|
||||
"refactoringconnectionclient.cpp",
|
||||
"refactoringconnectionclient.h",
|
||||
"refactoringengine.cpp",
|
||||
"refactoringengine.h",
|
||||
"refactoringprojectupdater.cpp",
|
||||
"refactoringprojectupdater.h",
|
||||
"searchhandle.cpp",
|
||||
"searchhandle.h",
|
||||
"searchinterface.cpp",
|
||||
"searchinterface.h",
|
||||
"sourcelocations.h",
|
||||
"symbolquery.cpp",
|
||||
"symbolquery.h",
|
||||
]
|
||||
}
|
||||
@@ -222,7 +222,7 @@ void ClangStaticAnalyzerTool::updateRunActions()
|
||||
bool canRun = target && project->projectLanguages().contains(cxx)
|
||||
&& ToolChainKitInformation::toolChain(target->kit(), cxx);
|
||||
if (!canRun)
|
||||
toolTip = tr("This is not C++ project");
|
||||
toolTip = tr("This is not a C++ project.");
|
||||
|
||||
m_startAction->setToolTip(toolTip);
|
||||
m_startAction->setEnabled(canRun);
|
||||
|
||||
@@ -457,13 +457,13 @@ void Manager::gotoLocations(const QList<QVariant> &list)
|
||||
int column;
|
||||
textEditor->convertPosition(textEditor->position(), &line, &column);
|
||||
SymbolLocation current(fileName, line, column);
|
||||
QSet<SymbolLocation>::const_iterator it = locations.find(current);
|
||||
QSet<SymbolLocation>::const_iterator it = locations.constFind(current);
|
||||
QSet<SymbolLocation>::const_iterator end = locations.constEnd();
|
||||
if (it != end) {
|
||||
// we already are at the symbol, cycle to next location
|
||||
++it;
|
||||
if (it == end)
|
||||
it = locations.begin();
|
||||
it = locations.constBegin();
|
||||
loc = *it;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ Utils::FileName BuildDirManager::workDirectory(const BuildDirParameters ¶met
|
||||
const Utils::FileName bdir = parameters.buildDirectory;
|
||||
const CMakeTool *cmake = parameters.cmakeTool;
|
||||
if (bdir.exists()) {
|
||||
m_buildDirToTempDir.erase(bdir);
|
||||
return bdir;
|
||||
} else {
|
||||
if (cmake && cmake->autoCreateBuildDirectory()) {
|
||||
@@ -74,14 +75,19 @@ Utils::FileName BuildDirManager::workDirectory(const BuildDirParameters ¶met
|
||||
return bdir;
|
||||
}
|
||||
}
|
||||
if (!m_tempDir) {
|
||||
m_tempDir.reset(new Utils::TemporaryDirectory("qtc-cmake-XXXXXXXX"));
|
||||
if (!m_tempDir->isValid()) {
|
||||
auto tmpDirIt = m_buildDirToTempDir.find(bdir);
|
||||
if (tmpDirIt == m_buildDirToTempDir.end()) {
|
||||
auto ret = m_buildDirToTempDir.emplace(std::make_pair(bdir, std::make_unique<Utils::TemporaryDirectory>("qtc-cmake-XXXXXXXX")));
|
||||
QTC_ASSERT(ret.second, return bdir);
|
||||
tmpDirIt = ret.first;
|
||||
|
||||
if (!tmpDirIt->second->isValid()) {
|
||||
emitErrorOccured(tr("Failed to create temporary directory \"%1\".")
|
||||
.arg(QDir::toNativeSeparators(m_tempDir->path())));
|
||||
.arg(QDir::toNativeSeparators(tmpDirIt->second->path())));
|
||||
return bdir;
|
||||
}
|
||||
}
|
||||
return Utils::FileName::fromString(m_tempDir->path());
|
||||
return Utils::FileName::fromString(tmpDirIt->second->path());
|
||||
}
|
||||
|
||||
void BuildDirManager::emitDataAvailable()
|
||||
@@ -198,14 +204,20 @@ void BuildDirManager::setParametersAndRequestParse(const BuildDirParameters &par
|
||||
BuildDirReader *old = m_reader.get();
|
||||
|
||||
m_parameters = parameters;
|
||||
m_parameters.buildDirectory = workDirectory(parameters);
|
||||
m_parameters.workDirectory = workDirectory(parameters);
|
||||
|
||||
updateReaderType(m_parameters,
|
||||
[this, old, newReaderReparseOptions, existingReaderReparseOptions]() {
|
||||
if (old != m_reader.get())
|
||||
emit requestReparse(newReaderReparseOptions);
|
||||
int options = REPARSE_DEFAULT;
|
||||
if (old != m_reader.get()) {
|
||||
options = newReaderReparseOptions;
|
||||
} else {
|
||||
if (!QFileInfo::exists(m_parameters.workDirectory.toString() + "/CMakeCache.txt"))
|
||||
options = newReaderReparseOptions;
|
||||
else
|
||||
emit requestReparse(existingReaderReparseOptions);
|
||||
options = existingReaderReparseOptions;
|
||||
}
|
||||
emit requestReparse(options);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -239,16 +251,17 @@ bool BuildDirManager::persistCMakeState()
|
||||
{
|
||||
QTC_ASSERT(m_parameters.isValid(), return false);
|
||||
|
||||
if (!m_tempDir)
|
||||
if (m_parameters.workDirectory == m_parameters.buildDirectory)
|
||||
return false;
|
||||
|
||||
const Utils::FileName buildDir = m_parameters.buildDirectory;
|
||||
QDir dir(buildDir.toString());
|
||||
dir.mkpath(buildDir.toString());
|
||||
|
||||
m_tempDir.reset(nullptr);
|
||||
|
||||
emit requestReparse(REPARSE_URGENT | REPARSE_FORCE_CONFIGURATION | REPARSE_CHECK_CONFIGURATION);
|
||||
BuildDirParameters newParameters = m_parameters;
|
||||
newParameters.workDirectory.clear();
|
||||
setParametersAndRequestParse(newParameters, REPARSE_URGENT | REPARSE_FORCE_CONFIGURATION | REPARSE_CHECK_CONFIGURATION,
|
||||
REPARSE_FAIL);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -291,8 +304,8 @@ void BuildDirManager::clearCache()
|
||||
QTC_ASSERT(m_parameters.isValid(), return);
|
||||
QTC_ASSERT(!m_isHandlingError, return);
|
||||
|
||||
auto cmakeCache = workDirectory(m_parameters).appendPath("CMakeCache.txt");
|
||||
auto cmakeFiles = workDirectory(m_parameters).appendPath("CMakeFiles");
|
||||
auto cmakeCache = m_parameters.workDirectory.appendPath("CMakeCache.txt");
|
||||
auto cmakeFiles = m_parameters.workDirectory.appendPath("CMakeFiles");
|
||||
|
||||
const bool mustCleanUp = cmakeCache.exists() || cmakeFiles.exists();
|
||||
if (!mustCleanUp)
|
||||
@@ -367,7 +380,7 @@ bool BuildDirManager::checkConfiguration()
|
||||
{
|
||||
QTC_ASSERT(m_parameters.isValid(), return false);
|
||||
|
||||
if (m_tempDir) // always throw away changes in the tmpdir!
|
||||
if (m_parameters.workDirectory != m_parameters.buildDirectory) // always throw away changes in the tmpdir!
|
||||
return false;
|
||||
|
||||
const CMakeConfig cache = m_parameters.buildConfiguration->configurationFromCMake();
|
||||
@@ -375,41 +388,40 @@ bool BuildDirManager::checkConfiguration()
|
||||
return false; // No cache file yet.
|
||||
|
||||
CMakeConfig newConfig;
|
||||
QSet<QString> changedKeys;
|
||||
QSet<QString> removedKeys;
|
||||
foreach (const CMakeConfigItem &iBc, m_parameters.configuration) {
|
||||
const CMakeConfigItem &iCache
|
||||
= Utils::findOrDefault(cache, [&iBc](const CMakeConfigItem &i) { return i.key == iBc.key; });
|
||||
if (iCache.isNull()) {
|
||||
removedKeys << QString::fromUtf8(iBc.key);
|
||||
} else if (QString::fromUtf8(iCache.value) != iBc.expandedValue(m_parameters.expander)) {
|
||||
changedKeys << QString::fromUtf8(iBc.key);
|
||||
newConfig.append(iCache);
|
||||
QHash<QString, QPair<QString, QString>> changedKeys;
|
||||
foreach (const CMakeConfigItem &projectItem, m_parameters.configuration) {
|
||||
const QString projectKey = QString::fromUtf8(projectItem.key);
|
||||
const QString projectValue = projectItem.expandedValue(m_parameters.expander);
|
||||
const CMakeConfigItem &cmakeItem
|
||||
= Utils::findOrDefault(cache, [&projectItem](const CMakeConfigItem &i) { return i.key == projectItem.key; });
|
||||
const QString iCacheValue = QString::fromUtf8(cmakeItem.value);
|
||||
if (cmakeItem.isNull()) {
|
||||
changedKeys.insert(projectKey, qMakePair(tr("<removed>"), projectValue));
|
||||
} else if (iCacheValue != projectValue) {
|
||||
changedKeys.insert(projectKey, qMakePair(iCacheValue, projectValue));
|
||||
newConfig.append(cmakeItem);
|
||||
} else {
|
||||
newConfig.append(iBc);
|
||||
newConfig.append(projectItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (!changedKeys.isEmpty() || !removedKeys.isEmpty()) {
|
||||
QSet<QString> total = removedKeys + changedKeys;
|
||||
QStringList keyList = total.toList();
|
||||
if (!changedKeys.isEmpty()) {
|
||||
QStringList keyList = changedKeys.keys();
|
||||
Utils::sort(keyList);
|
||||
QString table = QLatin1String("<table>");
|
||||
QString table = QString::fromLatin1("<table><tr><th>%1</th><th>%2</th><th>%3</th></tr>")
|
||||
.arg(tr("Key")).arg(tr("CMake")).arg(tr("Project"));
|
||||
foreach (const QString &k, keyList) {
|
||||
QString change;
|
||||
if (removedKeys.contains(k))
|
||||
change = tr("<removed>");
|
||||
else
|
||||
change = QString::fromUtf8(CMakeConfigItem::valueOf(k.toUtf8(), cache)).trimmed();
|
||||
if (change.isEmpty())
|
||||
change = tr("<empty>");
|
||||
table += QString::fromLatin1("\n<tr><td>%1</td><td>%2</td></tr>").arg(k).arg(change.toHtmlEscaped());
|
||||
const QPair<QString, QString> data = changedKeys.value(k);
|
||||
table += QString::fromLatin1("\n<tr><td>%1</td><td>%2</td><td>%3</td></tr>")
|
||||
.arg(k)
|
||||
.arg(data.first.toHtmlEscaped())
|
||||
.arg(data.second.toHtmlEscaped());
|
||||
}
|
||||
table += QLatin1String("\n</table>");
|
||||
|
||||
QPointer<QMessageBox> box = new QMessageBox(Core::ICore::mainWindow());
|
||||
box->setText(tr("CMake configuration has changed on disk."));
|
||||
box->setInformativeText(tr("The CMakeCache.txt file has changed: %1").arg(table));
|
||||
box->setInformativeText(table);
|
||||
auto *defaultButton = box->addButton(tr("Overwrite Changes in CMake"), QMessageBox::RejectRole);
|
||||
auto *applyButton = box->addButton(tr("Apply Changes to Project"), QMessageBox::ApplyRole);
|
||||
box->setDefaultButton(defaultButton);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ProjectExplorer { class FileNode; }
|
||||
|
||||
@@ -112,7 +113,7 @@ private:
|
||||
void becameDirty();
|
||||
|
||||
BuildDirParameters m_parameters;
|
||||
mutable std::unique_ptr<Utils::TemporaryDirectory> m_tempDir = nullptr;
|
||||
mutable std::unordered_map<Utils::FileName, std::unique_ptr<Utils::TemporaryDirectory>> m_buildDirToTempDir;
|
||||
mutable std::unique_ptr<BuildDirReader> m_reader;
|
||||
mutable bool m_isHandlingError = false;
|
||||
};
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
|
||||
Utils::FileName sourceDirectory;
|
||||
Utils::FileName buildDirectory;
|
||||
Utils::FileName workDirectory; // either buildDirectory or a QTemporaryDirectory!
|
||||
Utils::Environment environment;
|
||||
CMakeTool *cmakeTool = nullptr;
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
|
||||
bool isParsing() const;
|
||||
|
||||
enum ForceEnabledChanged : quint8 { False, True };
|
||||
enum ForceEnabledChanged { False, True };
|
||||
void clearError(ForceEnabledChanged fec = ForceEnabledChanged::False);
|
||||
|
||||
void setBuildTargets(const QList<CMakeBuildTarget> &targets);
|
||||
|
||||
@@ -177,7 +177,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
m_configView->setUniformRowHeights(true);
|
||||
m_configView->setSortingEnabled(true);
|
||||
m_configView->sortByColumn(0, Qt::AscendingOrder);
|
||||
auto stretcher = new Utils::HeaderViewStretcher(m_configView->header(), 1);
|
||||
auto stretcher = new Utils::HeaderViewStretcher(m_configView->header(), 0);
|
||||
m_configView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
m_configView->setSelectionBehavior(QAbstractItemView::SelectItems);
|
||||
m_configView->setFrameShape(QFrame::NoFrame);
|
||||
@@ -286,7 +286,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
|
||||
connect(m_resetButton, &QPushButton::clicked, m_configModel, &ConfigModel::resetAllChanges);
|
||||
connect(m_reconfigureButton, &QPushButton::clicked, this, [this]() {
|
||||
m_buildConfiguration->setConfigurationForCMake(m_configModel->configurationChanges());
|
||||
m_buildConfiguration->setConfigurationForCMake(m_configModel->configurationForCMake());
|
||||
});
|
||||
connect(m_unsetButton, &QPushButton::clicked, this, [this]() {
|
||||
m_configModel->toggleUnsetFlag(mapToSource(m_configView, m_configView->currentIndex()));
|
||||
@@ -320,7 +320,12 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
connect(m_buildConfiguration->target(), &ProjectExplorer::Target::kitChanged,
|
||||
this, &CMakeBuildSettingsWidget::updateFromKit);
|
||||
connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged,
|
||||
this, [this]() { setError(m_buildConfiguration->disabledReason()); });
|
||||
this, [this]() {
|
||||
setError(m_buildConfiguration->disabledReason());
|
||||
setConfigurationForCMake();
|
||||
});
|
||||
connect(m_buildConfiguration, &CMakeBuildConfiguration::configurationForCMakeChanged,
|
||||
this, [this]() { setConfigurationForCMake(); });
|
||||
|
||||
updateSelection(QModelIndex(), QModelIndex());
|
||||
}
|
||||
@@ -381,7 +386,19 @@ void CMakeBuildSettingsWidget::updateFromKit()
|
||||
for (const CMakeConfigItem &i : config)
|
||||
configHash.insert(QString::fromUtf8(i.key), i.expandedValue(k));
|
||||
|
||||
m_configModel->setKitConfiguration(configHash);
|
||||
m_configModel->setConfigurationFromKit(configHash);
|
||||
}
|
||||
|
||||
void CMakeBuildSettingsWidget::setConfigurationForCMake()
|
||||
{
|
||||
QHash<QString, QString> config;
|
||||
const CMakeConfig configList = m_buildConfiguration->configurationForCMake();
|
||||
for (const CMakeConfigItem &i : configList) {
|
||||
config.insert(QString::fromUtf8(i.key),
|
||||
CMakeConfigItem::expandedValueOf(m_buildConfiguration->target()->kit(),
|
||||
i.key, configList));
|
||||
}
|
||||
m_configModel->setConfigurationForCMake(config);
|
||||
}
|
||||
|
||||
void CMakeBuildSettingsWidget::updateSelection(const QModelIndex ¤t, const QModelIndex &previous)
|
||||
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
void updateAdvancedCheckBox();
|
||||
void updateFromKit();
|
||||
|
||||
void setConfigurationForCMake();
|
||||
void updateSelection(const QModelIndex ¤t, const QModelIndex &previous);
|
||||
QAction *createForceAction(int type, const QModelIndex &idx);
|
||||
|
||||
|
||||
@@ -160,11 +160,11 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
|
||||
return;
|
||||
|
||||
// Build configuration has switched:
|
||||
// * Error out if the reader updates, can not happen since all BCs share a target/kit.
|
||||
// * Check configuration if reader changes due to it not existing yet:-)
|
||||
// * run cmake without configuration arguments if the reader stays
|
||||
m_buildDirManager.setParametersAndRequestParse(
|
||||
BuildDirParameters(bc),
|
||||
BuildDirManager::REPARSE_FAIL,
|
||||
BuildDirManager::REPARSE_CHECK_CONFIGURATION,
|
||||
BuildDirManager::REPARSE_CHECK_CONFIGURATION);
|
||||
});
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "cmake_global.h"
|
||||
|
||||
#include "builddirmanager.h"
|
||||
#include "cmakebuildtarget.h"
|
||||
#include "cmakeprojectimporter.h"
|
||||
#include "treescanner.h"
|
||||
#include "builddirmanager.h"
|
||||
|
||||
#include <projectexplorer/extracompiler.h>
|
||||
#include <projectexplorer/projectmacro.h>
|
||||
|
||||
@@ -49,7 +49,7 @@ QByteArray CMakeInputsNode::generateId(const Utils::FileName &inputFile)
|
||||
|
||||
bool CMakeInputsNode::showInSimpleTree() const
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) :
|
||||
|
||||
@@ -94,14 +94,31 @@ void ConfigModel::setConfiguration(const QList<DataItem> &config)
|
||||
setConfiguration(Utils::transform(config, [](const DataItem &di) { return InternalDataItem(di); }));
|
||||
}
|
||||
|
||||
void ConfigModel::setKitConfiguration(const QHash<QString, QString> &kitConfig)
|
||||
void ConfigModel::setConfigurationFromKit(const QHash<QString, QString> &kitConfig)
|
||||
{
|
||||
m_kitConfiguration = kitConfig;
|
||||
|
||||
for (InternalDataItem &i : m_configuration) {
|
||||
if (m_kitConfiguration.contains(i.key)) {
|
||||
if (m_kitConfiguration.contains(i.key))
|
||||
i.kitValue = m_kitConfiguration.value(i.key);
|
||||
}
|
||||
setConfiguration(m_configuration);
|
||||
}
|
||||
|
||||
void ConfigModel::setConfigurationForCMake(const QHash<QString, QString> &config)
|
||||
{
|
||||
for (InternalDataItem &i : m_configuration) {
|
||||
if (!config.contains(i.key))
|
||||
continue;
|
||||
|
||||
const QString v = config.value(i.key);
|
||||
if (i.value == v) {
|
||||
i.newValue.clear();
|
||||
i.isUserChanged = false;
|
||||
} else {
|
||||
i.newValue = v;
|
||||
i.isUserChanged = true;
|
||||
}
|
||||
}
|
||||
setConfiguration(m_configuration);
|
||||
}
|
||||
@@ -202,7 +219,7 @@ ConfigModel::DataItem ConfigModel::dataItemFromIndex(const QModelIndex &idx)
|
||||
return DataItem();
|
||||
}
|
||||
|
||||
QList<ConfigModel::DataItem> ConfigModel::configurationChanges() const
|
||||
QList<ConfigModel::DataItem> ConfigModel::configurationForCMake() const
|
||||
{
|
||||
const QList<InternalDataItem> tmp
|
||||
= Utils::filtered(m_configuration, [](const InternalDataItem &i) {
|
||||
@@ -362,7 +379,7 @@ QString ConfigModel::InternalDataItem::toolTip() const
|
||||
tooltip << QCoreApplication::translate("CMakeProjectManager", "Not in CMakeCache.txt").arg(value);
|
||||
}
|
||||
if (!kitValue.isEmpty())
|
||||
tooltip << QCoreApplication::translate("CMakeProjectManager::ConfigModel", "Current Kit: %1").arg(kitValue);
|
||||
tooltip << QCoreApplication::translate("CMakeProjectManager::ConfigModel", "Current kit: %1").arg(kitValue);
|
||||
return tooltip.join("<br>");
|
||||
}
|
||||
|
||||
@@ -511,7 +528,7 @@ QString ConfigModelTreeItem::toolTip() const
|
||||
QTC_ASSERT(dataItem, return QString());
|
||||
QStringList tooltip(dataItem->description);
|
||||
if (!dataItem->kitValue.isEmpty())
|
||||
tooltip << QCoreApplication::translate("CMakeProjectManager", "Value requested by Kit: %1").arg(dataItem->kitValue);
|
||||
tooltip << QCoreApplication::translate("CMakeProjectManager", "Value requested by kit: %1").arg(dataItem->kitValue);
|
||||
if (dataItem->inCMakeCache) {
|
||||
if (dataItem->value != dataItem->newValue)
|
||||
tooltip << QCoreApplication::translate("CMakeProjectManager", "Current CMake: %1").arg(dataItem->value);
|
||||
|
||||
@@ -70,7 +70,8 @@ public:
|
||||
const QStringList &values = QStringList());
|
||||
void setConfiguration(const CMakeConfig &config);
|
||||
void setConfiguration(const QList<DataItem> &config);
|
||||
void setKitConfiguration(const QHash<QString, QString> &kitConfig);
|
||||
void setConfigurationFromKit(const QHash<QString, QString> &kitConfig);
|
||||
void setConfigurationForCMake(const QHash<QString, QString> &config);
|
||||
void flush();
|
||||
void resetAllChanges();
|
||||
|
||||
@@ -84,7 +85,7 @@ public:
|
||||
|
||||
static DataItem dataItemFromIndex(const QModelIndex &idx);
|
||||
|
||||
QList<DataItem> configurationChanges() const;
|
||||
QList<DataItem> configurationForCMake() const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -104,7 +104,7 @@ void ServerModeReader::setParameters(const BuildDirParameters &p)
|
||||
BuildDirReader::setParameters(p);
|
||||
if (!m_cmakeServer) {
|
||||
m_cmakeServer.reset(new ServerMode(p.environment,
|
||||
p.sourceDirectory, p.buildDirectory,
|
||||
p.sourceDirectory, p.workDirectory,
|
||||
p.cmakeTool->cmakeExecutable(),
|
||||
p.generator, p.extraGenerator, p.platform, p.toolset,
|
||||
true, 1));
|
||||
@@ -155,7 +155,7 @@ bool ServerModeReader::isCompatible(const BuildDirParameters &p)
|
||||
&& p.platform == m_parameters.platform
|
||||
&& p.toolset == m_parameters.toolset
|
||||
&& p.sourceDirectory == m_parameters.sourceDirectory
|
||||
&& p.buildDirectory == m_parameters.buildDirectory;
|
||||
&& p.workDirectory == m_parameters.workDirectory;
|
||||
}
|
||||
|
||||
void ServerModeReader::resetData()
|
||||
|
||||
@@ -184,7 +184,7 @@ QModelIndex ExternalToolModel::index(int row, int column, const QModelIndex &par
|
||||
if (row < items.count())
|
||||
return createIndex(row, 0, items.at(row));
|
||||
}
|
||||
} else if (column == 0 && row < m_tools.keys().count()) {
|
||||
} else if (column == 0 && row < m_tools.size()) {
|
||||
return createIndex(row, 0);
|
||||
}
|
||||
return QModelIndex();
|
||||
@@ -208,7 +208,7 @@ QModelIndex ExternalToolModel::parent(const QModelIndex &child) const
|
||||
int ExternalToolModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (!parent.isValid())
|
||||
return m_tools.keys().count();
|
||||
return m_tools.size();
|
||||
if (toolForIndex(parent))
|
||||
return 0;
|
||||
bool found;
|
||||
|
||||
@@ -534,7 +534,9 @@ QList<IDocument *> DocumentManager::modifiedDocuments()
|
||||
{
|
||||
QList<IDocument *> modified;
|
||||
|
||||
foreach (IDocument *document, d->m_documentsWithWatch.keys()) {
|
||||
const auto docEnd = d->m_documentsWithWatch.keyEnd();
|
||||
for (auto docIt = d->m_documentsWithWatch.keyBegin(); docIt != docEnd; ++docIt) {
|
||||
IDocument *document = *docIt;
|
||||
if (document->isModified())
|
||||
modified << document;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ static bool validateRegExp(Utils::FancyLineEdit *edit, QString *errorMessage)
|
||||
{
|
||||
if (edit->text().isEmpty()) {
|
||||
if (errorMessage)
|
||||
*errorMessage = FindToolWindow::tr("Empty search term");
|
||||
*errorMessage = FindToolWindow::tr("Empty search term.");
|
||||
return false;
|
||||
}
|
||||
if (Find::hasFindFlag(FindRegularExpression)) {
|
||||
|
||||
@@ -293,10 +293,11 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setRenderHint(QPainter::Antialiasing, false);
|
||||
foreach (Utils::Theme::Color themeColor, highlights.keys()) {
|
||||
const QColor &color = creatorTheme()->color(themeColor);
|
||||
for (int i = 0, total = highlights[themeColor].size(); i < total; ++i) {
|
||||
const QRect rect = highlights[themeColor][i];
|
||||
const auto highlightEnd = highlights.cend();
|
||||
for (auto highlightIt = highlights.cbegin(); highlightIt != highlightEnd; ++highlightIt) {
|
||||
const QColor &color = creatorTheme()->color(highlightIt.key());
|
||||
for (int i = 0, total = highlightIt.value().size(); i < total; ++i) {
|
||||
const QRect rect = highlightIt.value().at(i);
|
||||
painter.fillRect(rect, color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
|
||||
const QString entry = QDir::fromNativeSeparators(origEntry);
|
||||
const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry);
|
||||
|
||||
const QRegularExpression regexp = createRegExp(entry);
|
||||
const QRegularExpression regexp = createRegExp(fp.filePath);
|
||||
if (!regexp.isValid()) {
|
||||
d->m_current.clear(); // free memory
|
||||
return betterEntries;
|
||||
|
||||
@@ -61,7 +61,7 @@ QList<LocatorFilterEntry> OpenDocumentsFilter::matchesFor(QFutureInterface<Locat
|
||||
QList<LocatorFilterEntry> betterEntries;
|
||||
const EditorManager::FilePathInfo fp = EditorManager::splitLineAndColumnNumber(entry);
|
||||
|
||||
const QRegularExpression regexp = createRegExp(entry);
|
||||
const QRegularExpression regexp = createRegExp(fp.filePath);
|
||||
if (!regexp.isValid())
|
||||
return goodEntries;
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace CodePaster {
|
||||
|
||||
class AuthenticationDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AuthenticationDialog(const QString &details, QWidget *parent = nullptr);
|
||||
|
||||
|
||||
@@ -880,7 +880,10 @@ void CdbEngine::doInterruptInferior(SpecialStopMode sm)
|
||||
showMessage(QString("Interrupting process %1...").arg(inferiorPid()), LogMisc);
|
||||
|
||||
QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return;);
|
||||
m_signalOperation = runTool()->device()->signalOperation();
|
||||
if (DebuggerRunTool *rt = runTool()) {
|
||||
if (IDevice::ConstPtr device = rt->device())
|
||||
m_signalOperation = device->signalOperation();
|
||||
}
|
||||
m_specialStopMode = sm;
|
||||
QTC_ASSERT(m_signalOperation, notifyInferiorStopFailed(); return;);
|
||||
connect(m_signalOperation.data(), &DeviceProcessSignalOperation::finished,
|
||||
|
||||
@@ -220,13 +220,10 @@ public:
|
||||
m_stackHandler(engine),
|
||||
m_threadsHandler(engine),
|
||||
m_watchHandler(engine),
|
||||
m_disassemblerAgent(engine),
|
||||
m_isStateDebugging(false)
|
||||
m_disassemblerAgent(engine)
|
||||
{
|
||||
connect(&m_locationTimer, &QTimer::timeout,
|
||||
this, &DebuggerEnginePrivate::resetLocation);
|
||||
connect(action(IntelFlavor), &Utils::SavedAction::valueChanged,
|
||||
this, &DebuggerEnginePrivate::reloadDisassembly);
|
||||
}
|
||||
|
||||
void doSetupEngine();
|
||||
@@ -234,11 +231,6 @@ public:
|
||||
void doShutdownEngine();
|
||||
void doShutdownInferior();
|
||||
|
||||
void reloadDisassembly()
|
||||
{
|
||||
m_disassemblerAgent.reload();
|
||||
}
|
||||
|
||||
void doFinishDebugger()
|
||||
{
|
||||
QTC_ASSERT(state() == EngineShutdownOk
|
||||
@@ -246,10 +238,18 @@ public:
|
||||
m_engine->setState(DebuggerFinished);
|
||||
resetLocation();
|
||||
if (isMasterEngine()) {
|
||||
m_engine->showMessage("NOTE: FINISH DEBUGGER");
|
||||
QTC_ASSERT(state() == DebuggerFinished, qDebug() << m_engine << state());
|
||||
if (isMasterEngine() && m_runTool)
|
||||
m_runTool->debuggingFinished();
|
||||
if (m_runTool) {
|
||||
m_progress.setProgressValue(1000);
|
||||
m_progress.reportFinished();
|
||||
m_modulesHandler.removeAll();
|
||||
m_stackHandler.removeAll();
|
||||
m_threadsHandler.removeAll();
|
||||
m_watchHandler.cleanup();
|
||||
Internal::runControlFinished(m_runTool);
|
||||
m_runTool->reportStopped();
|
||||
m_runTool->appendMessage(tr("Debugging has finished"), NormalMessageFormat);
|
||||
m_runTool.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,8 +302,6 @@ public:
|
||||
QScopedPointer<LocationMark> m_locationMark;
|
||||
QTimer m_locationTimer;
|
||||
|
||||
bool m_isStateDebugging = false;
|
||||
|
||||
Utils::FileInProjectFinder m_fileFinder;
|
||||
QString m_qtNamespace;
|
||||
|
||||
@@ -556,29 +554,6 @@ void DebuggerEngine::gotoLocation(const Location &loc)
|
||||
d->m_locationMark.reset(new LocationMark(this, file, line));
|
||||
}
|
||||
|
||||
// Called from RunControl.
|
||||
void DebuggerEngine::handleStartFailed()
|
||||
{
|
||||
showMessage("HANDLE RUNCONTROL START FAILED");
|
||||
d->m_runTool.clear();
|
||||
d->m_progress.setProgressValue(900);
|
||||
d->m_progress.reportCanceled();
|
||||
d->m_progress.reportFinished();
|
||||
}
|
||||
|
||||
// Called from RunControl.
|
||||
void DebuggerEngine::handleFinished()
|
||||
{
|
||||
showMessage("HANDLE RUNCONTROL FINISHED");
|
||||
d->m_runTool.clear();
|
||||
d->m_progress.setProgressValue(1000);
|
||||
d->m_progress.reportFinished();
|
||||
modulesHandler()->removeAll();
|
||||
stackHandler()->removeAll();
|
||||
threadsHandler()->removeAll();
|
||||
watchHandler()->cleanup();
|
||||
}
|
||||
|
||||
const DebuggerRunParameters &DebuggerEngine::runParameters() const
|
||||
{
|
||||
return runTool()->runParameters();
|
||||
@@ -679,8 +654,14 @@ void DebuggerEngine::notifyEngineSetupFailed()
|
||||
showMessage("NOTE: ENGINE SETUP FAILED");
|
||||
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << this << state());
|
||||
setState(EngineSetupFailed);
|
||||
if (isMasterEngine() && runTool())
|
||||
runTool()->startFailed();
|
||||
if (isMasterEngine() && runTool()) {
|
||||
showMessage(tr("Debugging has failed"), NormalMessageFormat);
|
||||
d->m_runTool.clear();
|
||||
d->m_progress.setProgressValue(900);
|
||||
d->m_progress.reportCanceled();
|
||||
d->m_progress.reportFinished();
|
||||
}
|
||||
|
||||
setState(DebuggerFinished);
|
||||
}
|
||||
|
||||
@@ -1052,8 +1033,6 @@ static inline QString msgStateChanged(DebuggerState oldState, DebuggerState newS
|
||||
void DebuggerEngine::setState(DebuggerState state, bool forced)
|
||||
{
|
||||
const QString msg = msgStateChanged(d->m_state, state, forced, isMasterEngine());
|
||||
if (isStateDebugging())
|
||||
qDebug("%s", qPrintable(msg));
|
||||
|
||||
DebuggerState oldState = d->m_state;
|
||||
d->m_state = state;
|
||||
@@ -1651,16 +1630,6 @@ void DebuggerEngine::openDisassemblerView(const Location &location)
|
||||
agent->setLocation(location);
|
||||
}
|
||||
|
||||
bool DebuggerEngine::isStateDebugging() const
|
||||
{
|
||||
return d->m_isStateDebugging;
|
||||
}
|
||||
|
||||
void DebuggerEngine::setStateDebugging(bool on)
|
||||
{
|
||||
d->m_isStateDebugging = on;
|
||||
}
|
||||
|
||||
void DebuggerRunParameters::validateExecutable()
|
||||
{
|
||||
const bool warnOnRelease = boolSetting(WarnOnReleaseBuilds);
|
||||
|
||||
@@ -337,8 +337,6 @@ public:
|
||||
virtual QAbstractItemModel *sourceFilesModel() const;
|
||||
|
||||
void progressPing();
|
||||
void handleFinished();
|
||||
void handleStartFailed();
|
||||
bool debuggerActionsEnabled() const;
|
||||
static bool debuggerActionsEnabled(DebuggerState state);
|
||||
|
||||
@@ -467,9 +465,6 @@ protected:
|
||||
bool showStoppedBySignalMessageBox(const QString meaning, QString name);
|
||||
void showStoppedByExceptionMessageBox(const QString &description);
|
||||
|
||||
bool isStateDebugging() const;
|
||||
void setStateDebugging(bool on);
|
||||
|
||||
virtual void setupSlaveEngine();
|
||||
virtual void runSlaveEngine();
|
||||
virtual void shutdownSlaveEngine();
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
QPersistentModelIndex m_currentIndex;
|
||||
};
|
||||
|
||||
template <class Predicate>
|
||||
template <typename Predicate>
|
||||
void forAllDebuggers(const Predicate &pred)
|
||||
{
|
||||
d->m_model->forItemsAtLevel<2>([pred](DebuggerTreeItem *titem) {
|
||||
@@ -211,7 +211,7 @@ void forAllDebuggers(const Predicate &pred)
|
||||
});
|
||||
}
|
||||
|
||||
template <class Predicate>
|
||||
template <typename Predicate>
|
||||
const DebuggerItem *findDebugger(const Predicate &pred)
|
||||
{
|
||||
DebuggerTreeItem *titem = d->m_model->findItemAtLevel<2>([pred](DebuggerTreeItem *titem) {
|
||||
@@ -625,31 +625,6 @@ void DebuggerOptionsPage::finish()
|
||||
d->m_model->cancel();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// DebuggerItemManager
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
DebuggerItemManager::DebuggerItemManager()
|
||||
{
|
||||
new DebuggerItemManagerPrivate;
|
||||
connect(ICore::instance(), &ICore::saveSettingsRequested,
|
||||
this, [] { d->saveDebuggers(); });
|
||||
}
|
||||
|
||||
DebuggerItemManager::~DebuggerItemManager()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
QList<DebuggerItem> DebuggerItemManager::debuggers()
|
||||
{
|
||||
QList<DebuggerItem> result;
|
||||
forAllDebuggers([&result](const DebuggerItem &item) { result.append(item); });
|
||||
return result;
|
||||
}
|
||||
|
||||
void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
||||
{
|
||||
FileNameList cdbs;
|
||||
@@ -827,42 +802,6 @@ void DebuggerItemManagerPrivate::readLegacyDebuggers(const FileName &file)
|
||||
}
|
||||
}
|
||||
|
||||
const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command)
|
||||
{
|
||||
return findDebugger([command](const DebuggerItem &item) {
|
||||
return item.command() == command;
|
||||
});
|
||||
}
|
||||
|
||||
const DebuggerItem *DebuggerItemManager::findById(const QVariant &id)
|
||||
{
|
||||
return findDebugger([id](const DebuggerItem &item) {
|
||||
return item.id() == id;
|
||||
});
|
||||
}
|
||||
|
||||
const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType)
|
||||
{
|
||||
return findDebugger([engineType](const DebuggerItem &item) {
|
||||
return item.engineType() == engineType;
|
||||
});
|
||||
}
|
||||
|
||||
QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item)
|
||||
{
|
||||
return d->registerDebugger(item);
|
||||
}
|
||||
|
||||
void DebuggerItemManager::deregisterDebugger(const QVariant &id)
|
||||
{
|
||||
d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) {
|
||||
if (titem->m_item.id() == id)
|
||||
d->m_model->destroyItem(titem);
|
||||
});
|
||||
}
|
||||
|
||||
namespace Internal {
|
||||
|
||||
static FileName userSettingsFileName()
|
||||
{
|
||||
QFileInfo settingsLocation(ICore::settings()->fileName());
|
||||
@@ -1001,4 +940,62 @@ void DebuggerItemManagerPrivate::saveDebuggers()
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// DebuggerItemManager
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
DebuggerItemManager::DebuggerItemManager()
|
||||
{
|
||||
new DebuggerItemManagerPrivate;
|
||||
connect(ICore::instance(), &ICore::saveSettingsRequested,
|
||||
this, [] { d->saveDebuggers(); });
|
||||
}
|
||||
|
||||
DebuggerItemManager::~DebuggerItemManager()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
QList<DebuggerItem> DebuggerItemManager::debuggers()
|
||||
{
|
||||
QList<DebuggerItem> result;
|
||||
forAllDebuggers([&result](const DebuggerItem &item) { result.append(item); });
|
||||
return result;
|
||||
}
|
||||
|
||||
const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command)
|
||||
{
|
||||
return findDebugger([command](const DebuggerItem &item) {
|
||||
return item.command() == command;
|
||||
});
|
||||
}
|
||||
|
||||
const DebuggerItem *DebuggerItemManager::findById(const QVariant &id)
|
||||
{
|
||||
return findDebugger([id](const DebuggerItem &item) {
|
||||
return item.id() == id;
|
||||
});
|
||||
}
|
||||
|
||||
const DebuggerItem *DebuggerItemManager::findByEngineType(DebuggerEngineType engineType)
|
||||
{
|
||||
return findDebugger([engineType](const DebuggerItem &item) {
|
||||
return item.engineType() == engineType;
|
||||
});
|
||||
}
|
||||
|
||||
QVariant DebuggerItemManager::registerDebugger(const DebuggerItem &item)
|
||||
{
|
||||
return d->registerDebugger(item);
|
||||
}
|
||||
|
||||
void DebuggerItemManager::deregisterDebugger(const QVariant &id)
|
||||
{
|
||||
d->m_model->forItemsAtLevel<2>([id](DebuggerTreeItem *titem) {
|
||||
if (titem->m_item.id() == id)
|
||||
d->m_model->destroyItem(titem);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Debugger
|
||||
|
||||
@@ -1987,15 +1987,11 @@ public:
|
||||
{
|
||||
IDevice::ConstPtr device = DeviceKitInformation::device(kit);
|
||||
setDisplayName("AttachToRunningProcess");
|
||||
setUsePortsGatherer(true, false);
|
||||
portsGatherer()->setDevice(device);
|
||||
|
||||
portsGatherer = new GdbServerPortsGatherer(runControl);
|
||||
portsGatherer->setUseGdbServer(true);
|
||||
portsGatherer->setUseQmlServer(false);
|
||||
portsGatherer->setDevice(device);
|
||||
|
||||
auto gdbServer = new GdbServerRunner(runControl, portsGatherer);
|
||||
auto gdbServer = new GdbServerRunner(runControl, portsGatherer());
|
||||
gdbServer->setUseMulti(false);
|
||||
gdbServer->addStartDependency(portsGatherer);
|
||||
gdbServer->setDevice(device);
|
||||
gdbServer->setAttachPid(ProcessHandle(pid));
|
||||
|
||||
@@ -2008,14 +2004,6 @@ public:
|
||||
setUseContinueInsteadOfRun(true);
|
||||
setContinueAfterAttach(false);
|
||||
}
|
||||
|
||||
void start() final
|
||||
{
|
||||
setRemoteChannel(portsGatherer->gdbServerChannel());
|
||||
DebuggerRunTool::start();
|
||||
}
|
||||
|
||||
GdbServerPortsGatherer *portsGatherer;
|
||||
};
|
||||
|
||||
void DebuggerPluginPrivate::attachToRunningApplication()
|
||||
@@ -2945,8 +2933,6 @@ void DebuggerPluginPrivate::runControlStarted(DebuggerRunTool *runTool)
|
||||
|
||||
void DebuggerPluginPrivate::runControlFinished(DebuggerRunTool *runTool)
|
||||
{
|
||||
if (runTool && runTool->engine())
|
||||
runTool->engine()->handleFinished();
|
||||
showStatusMessage(tr("Debugger finished."));
|
||||
m_snapshotHandler->removeSnapshot(runTool);
|
||||
if (m_snapshotHandler->size() == 0) {
|
||||
|
||||
@@ -88,6 +88,8 @@ DebuggerEngine *createLldbEngine();
|
||||
|
||||
class LocalProcessRunner : public RunWorker
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner)
|
||||
|
||||
public:
|
||||
LocalProcessRunner(RunControl *runControl, const StandardRunnable &runnable)
|
||||
: RunWorker(runControl), m_runnable(runnable)
|
||||
@@ -244,6 +246,8 @@ class DebuggerRunToolPrivate
|
||||
public:
|
||||
QPointer<TerminalRunner> terminalRunner;
|
||||
QPointer<CoreUnpacker> coreUnpacker;
|
||||
QPointer<GdbServerPortsGatherer> portsGatherer;
|
||||
bool addQmlServerInferiorCommandLineArgumentIfNeeded = false;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -470,14 +474,7 @@ void DebuggerRunTool::prependInferiorCommandLineArgument(const QString &arg)
|
||||
|
||||
void DebuggerRunTool::addQmlServerInferiorCommandLineArgumentIfNeeded()
|
||||
{
|
||||
if (isQmlDebugging() && isCppDebugging()) {
|
||||
using namespace QmlDebug;
|
||||
int qmlServerPort = m_runParameters.qmlServer.port();
|
||||
QTC_ASSERT(qmlServerPort > 0, reportFailure(); return);
|
||||
QString mode = QString("port:%1").arg(qmlServerPort);
|
||||
QString qmlServerArg = qmlDebugCommandLineArguments(QmlDebuggerServices, mode, true);
|
||||
prependInferiorCommandLineArgument(qmlServerArg);
|
||||
}
|
||||
d->addQmlServerInferiorCommandLineArgumentIfNeeded = true;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setCrashParameter(const QString &event)
|
||||
@@ -502,6 +499,21 @@ void DebuggerRunTool::start()
|
||||
TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO);
|
||||
TaskHub::clearTasks(Debugger::Constants::TASK_CATEGORY_DEBUGGER_RUNTIME);
|
||||
|
||||
if (d->portsGatherer) {
|
||||
setRemoteChannel(d->portsGatherer->gdbServerChannel());
|
||||
setQmlServer(d->portsGatherer->qmlServer());
|
||||
if (d->addQmlServerInferiorCommandLineArgumentIfNeeded
|
||||
&& m_runParameters.isQmlDebugging
|
||||
&& m_runParameters.isCppDebugging) {
|
||||
using namespace QmlDebug;
|
||||
int qmlServerPort = m_runParameters.qmlServer.port();
|
||||
QTC_ASSERT(qmlServerPort > 0, reportFailure(); return);
|
||||
QString mode = QString("port:%1").arg(qmlServerPort);
|
||||
QString qmlServerArg = qmlDebugCommandLineArguments(QmlDebuggerServices, mode, true);
|
||||
prependInferiorCommandLineArgument(qmlServerArg);
|
||||
}
|
||||
}
|
||||
|
||||
// User canceled input dialog asking for executable when working on library project.
|
||||
if (m_runParameters.startMode == StartInternal
|
||||
&& m_runParameters.inferior.executable.isEmpty()
|
||||
@@ -568,7 +580,7 @@ void DebuggerRunTool::start()
|
||||
}
|
||||
|
||||
if (!m_engine) {
|
||||
reportFailure(DebuggerPlugin::tr("Unable to create a debugging engine"));
|
||||
reportFailure(DebuggerPlugin::tr("Unable to create a debugging engine."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -604,12 +616,6 @@ void DebuggerRunTool::start()
|
||||
m_engine->start();
|
||||
}
|
||||
|
||||
void DebuggerRunTool::startFailed()
|
||||
{
|
||||
appendMessage(tr("Debugging has failed"), NormalMessageFormat);
|
||||
m_engine->handleStartFailed();
|
||||
}
|
||||
|
||||
void DebuggerRunTool::stop()
|
||||
{
|
||||
m_isDying = true;
|
||||
@@ -617,13 +623,6 @@ void DebuggerRunTool::stop()
|
||||
m_engine->quitDebugger();
|
||||
}
|
||||
|
||||
void DebuggerRunTool::debuggingFinished()
|
||||
{
|
||||
appendMessage(tr("Debugging has finished"), NormalMessageFormat);
|
||||
Internal::runControlFinished(this);
|
||||
reportStopped();
|
||||
}
|
||||
|
||||
const DebuggerRunParameters &DebuggerRunTool::runParameters() const
|
||||
{
|
||||
return m_runParameters;
|
||||
@@ -644,6 +643,20 @@ int DebuggerRunTool::portsUsedByDebugger() const
|
||||
return isCppDebugging() + isQmlDebugging();
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setUsePortsGatherer(bool useCpp, bool useQml)
|
||||
{
|
||||
QTC_ASSERT(!d->portsGatherer, reportFailure(); return);
|
||||
d->portsGatherer = new GdbServerPortsGatherer(runControl());
|
||||
d->portsGatherer->setUseGdbServer(useCpp);
|
||||
d->portsGatherer->setUseQmlServer(useQml);
|
||||
addStartDependency(d->portsGatherer);
|
||||
}
|
||||
|
||||
GdbServerPortsGatherer *DebuggerRunTool::portsGatherer() const
|
||||
{
|
||||
return d->portsGatherer;
|
||||
}
|
||||
|
||||
void DebuggerRunTool::setSolibSearchPath(const QStringList &list)
|
||||
{
|
||||
m_runParameters.solibSearchPath = list;
|
||||
@@ -999,6 +1012,7 @@ GdbServerRunner::GdbServerRunner(RunControl *runControl, GdbServerPortsGatherer
|
||||
setDisplayName("GdbServerRunner");
|
||||
if (runControl->runnable().is<StandardRunnable>())
|
||||
m_runnable = runControl->runnable().as<StandardRunnable>();
|
||||
addStartDependency(m_portsGatherer);
|
||||
}
|
||||
|
||||
GdbServerRunner::~GdbServerRunner()
|
||||
|
||||
@@ -39,6 +39,8 @@ class TerminalRunner;
|
||||
class DebuggerRunToolPrivate;
|
||||
} // Internal
|
||||
|
||||
class GdbServerPortsGatherer;
|
||||
|
||||
class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -58,13 +60,10 @@ public:
|
||||
void start() override;
|
||||
void stop() override;
|
||||
|
||||
void startFailed();
|
||||
|
||||
void notifyInferiorIll();
|
||||
Q_SLOT void notifyInferiorExited(); // Called from Android.
|
||||
void quitDebugger();
|
||||
void abortDebugger();
|
||||
void debuggingFinished();
|
||||
|
||||
const Internal::DebuggerRunParameters &runParameters() const;
|
||||
|
||||
@@ -74,6 +73,9 @@ public:
|
||||
bool isQmlDebugging() const;
|
||||
int portsUsedByDebugger() const;
|
||||
|
||||
void setUsePortsGatherer(bool useCpp, bool useQml);
|
||||
GdbServerPortsGatherer *portsGatherer() const;
|
||||
|
||||
void setSolibSearchPath(const QStringList &list);
|
||||
void addSolibSearchDir(const QString &str);
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/savedaction.h>
|
||||
|
||||
#include <QTextBlock>
|
||||
#include <QDir>
|
||||
@@ -174,7 +175,10 @@ int DisassemblerAgentPrivate::lineForAddress(quint64 address) const
|
||||
|
||||
DisassemblerAgent::DisassemblerAgent(DebuggerEngine *engine)
|
||||
: d(new DisassemblerAgentPrivate(engine))
|
||||
{}
|
||||
{
|
||||
connect(action(IntelFlavor), &Utils::SavedAction::valueChanged,
|
||||
this, &DisassemblerAgent::reload);
|
||||
}
|
||||
|
||||
DisassemblerAgent::~DisassemblerAgent()
|
||||
{
|
||||
|
||||
@@ -4529,7 +4529,7 @@ void GdbEngine::interruptInferior2()
|
||||
|
||||
interruptLocalInferior(runParameters().attachPID.pid());
|
||||
|
||||
} else if (isRemoteEngine()) {
|
||||
} else if (isRemoteEngine() || runParameters().startMode == AttachToRemoteProcess) {
|
||||
|
||||
CHECK_STATE(InferiorStopRequested);
|
||||
if (usesTargetAsync()) {
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>400</height>
|
||||
<height>350</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
@@ -188,7 +188,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>200</height>
|
||||
<height>175</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
if (m_remoteNames.contains(input)) {
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("A remote with the name \"%1\" already exists.").arg(input);
|
||||
*errorMessage = RemoteDialog::tr("A remote with the name \"%1\" already exists.").arg(input);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
|
||||
const GitRemote r(edit->text());
|
||||
if (!r.isValid && errorMessage)
|
||||
*errorMessage = tr("The URL may not be valid.");
|
||||
*errorMessage = RemoteDialog::tr("The URL may not be valid.");
|
||||
|
||||
return r.isValid;
|
||||
});
|
||||
|
||||
@@ -166,7 +166,7 @@ bool NimProject::supportsKit(Kit *k, QString *errorMessage) const
|
||||
}
|
||||
if (!tc->compilerCommand().exists()) {
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("Nim compiler does not exist");
|
||||
*errorMessage = tr("Nim compiler does not exist.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -13,6 +13,8 @@ Project {
|
||||
"bineditor/bineditor.qbs",
|
||||
"bookmarks/bookmarks.qbs",
|
||||
"clangcodemodel/clangcodemodel.qbs",
|
||||
"clangpchmanager/clangpchmanager.qbs",
|
||||
"clangrefactoring/clangrefactoring.qbs",
|
||||
"clangstaticanalyzer/clangstaticanalyzer.qbs",
|
||||
"classview/classview.qbs",
|
||||
"clearcase/clearcase.qbs",
|
||||
|
||||
@@ -57,9 +57,11 @@
|
||||
*/
|
||||
|
||||
using namespace Utils;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
using namespace Internal;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
enum State { Inactive, Run };
|
||||
|
||||
@@ -186,6 +186,7 @@ PortsGatheringMethod::Ptr DesktopDevice::portsGatheringMethod() const
|
||||
QUrl DesktopDevice::toolControlChannel(const ControlChannelHint &) const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(urlTcpScheme());
|
||||
url.setHost("localhost");
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -177,6 +177,13 @@ PortsGatherer::PortsGatherer(RunControl *runControl)
|
||||
: RunWorker(runControl)
|
||||
{
|
||||
setDisplayName("PortGatherer");
|
||||
|
||||
connect(&m_portsGatherer, &DeviceUsedPortsGatherer::error, this, &PortsGatherer::reportFailure);
|
||||
connect(&m_portsGatherer, &DeviceUsedPortsGatherer::portListReady, this, [this] {
|
||||
m_portList = device()->freePorts();
|
||||
appendMessage(tr("Found %n free ports.", nullptr, m_portList.count()), NormalMessageFormat);
|
||||
reportStarted();
|
||||
});
|
||||
}
|
||||
|
||||
PortsGatherer::~PortsGatherer()
|
||||
@@ -185,15 +192,7 @@ PortsGatherer::~PortsGatherer()
|
||||
|
||||
void PortsGatherer::start()
|
||||
{
|
||||
appendMessage(tr("Checking available ports...") + '\n', NormalMessageFormat);
|
||||
connect(&m_portsGatherer, &DeviceUsedPortsGatherer::error, this, [this](const QString &msg) {
|
||||
reportFailure(msg);
|
||||
});
|
||||
connect(&m_portsGatherer, &DeviceUsedPortsGatherer::portListReady, this, [this] {
|
||||
m_portList = device()->freePorts();
|
||||
appendMessage(tr("Found %n free ports.", nullptr, m_portList.count()) + '\n', NormalMessageFormat);
|
||||
reportStarted();
|
||||
});
|
||||
appendMessage(tr("Checking available ports..."), NormalMessageFormat);
|
||||
m_portsGatherer.start(device());
|
||||
}
|
||||
|
||||
|
||||
@@ -414,6 +414,7 @@ void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameter
|
||||
QUrl IDevice::toolControlChannel(const ControlChannelHint &) const
|
||||
{
|
||||
QUrl url;
|
||||
url.setScheme(urlTcpScheme());
|
||||
url.setHost(d->sshParameters.host);
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ void FolderNavigationWidget::setAutoSynchronization(bool sync)
|
||||
|
||||
void FolderNavigationWidget::setCurrentEditor(Core::IEditor *editor)
|
||||
{
|
||||
if (!editor)
|
||||
if (!editor || editor->document()->filePath().isEmpty() || editor->document()->isTemporary())
|
||||
return;
|
||||
const Utils::FileName filePath = editor->document()->filePath();
|
||||
// switch to most fitting root
|
||||
@@ -303,15 +303,20 @@ void FolderNavigationWidget::openItem(const QModelIndex &index)
|
||||
Core::EditorManager::openEditor(path);
|
||||
}
|
||||
|
||||
void FolderNavigationWidget::openProjectsInDirectory(const QModelIndex &index)
|
||||
QStringList FolderNavigationWidget::projectsInDirectory(const QModelIndex &index) const
|
||||
{
|
||||
QTC_ASSERT(index.isValid() && m_fileSystemModel->isDir(index), return);
|
||||
QTC_ASSERT(index.isValid() && m_fileSystemModel->isDir(index), return {});
|
||||
const QFileInfo fi = m_fileSystemModel->fileInfo(index);
|
||||
if (!fi.isReadable() || !fi.isExecutable())
|
||||
return;
|
||||
return {};
|
||||
const QString path = m_fileSystemModel->filePath(index);
|
||||
// Try to find project files in directory and open those.
|
||||
const QStringList projectFiles = FolderNavigationWidget::projectFilesInDirectory(path);
|
||||
return FolderNavigationWidget::projectFilesInDirectory(path);
|
||||
}
|
||||
|
||||
void FolderNavigationWidget::openProjectsInDirectory(const QModelIndex &index)
|
||||
{
|
||||
const QStringList projectFiles = projectsInDirectory(index);
|
||||
if (!projectFiles.isEmpty())
|
||||
Core::ICore::instance()->openFiles(projectFiles);
|
||||
}
|
||||
@@ -332,6 +337,8 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev)
|
||||
const QString fileName = m_fileSystemModel->fileName(current);
|
||||
if (m_fileSystemModel->isDir(current)) {
|
||||
actionOpenProjects = menu.addAction(tr("Open Project in \"%1\"").arg(fileName));
|
||||
if (projectsInDirectory(current).isEmpty())
|
||||
actionOpenProjects->setEnabled(false);
|
||||
} else {
|
||||
actionOpenFile = menu.addAction(tr("Open \"%1\"").arg(fileName));
|
||||
if (ProjectExplorerPlugin::isProjectFile(Utils::FileName::fromString(fileName)))
|
||||
|
||||
@@ -107,6 +107,7 @@ private:
|
||||
void setRootDirectory(const Utils::FileName &directory);
|
||||
int bestRootForFile(const Utils::FileName &filePath);
|
||||
void openItem(const QModelIndex &index);
|
||||
QStringList projectsInDirectory(const QModelIndex &index) const;
|
||||
void openProjectsInDirectory(const QModelIndex &index);
|
||||
|
||||
Utils::NavigationTreeView *m_listView = nullptr;
|
||||
|
||||
@@ -719,7 +719,10 @@ GccToolChain::GccToolChain(const GccToolChain &) = default;
|
||||
|
||||
void GccToolChain::addToEnvironment(Environment &env) const
|
||||
{
|
||||
Q_UNUSED(env);
|
||||
// On Windows gcc invokes cc1plus which is in libexec directory.
|
||||
// cc1plus depends on libwinpthread-1.dll which is in bin, so bin must be in the PATH.
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
addCommandPathToEnvironment(m_compilerCommand, env);
|
||||
}
|
||||
|
||||
FileNameList GccToolChain::suggestedMkspecList() const
|
||||
|
||||
@@ -234,7 +234,6 @@ const char M_SESSION[] = "ProjectExplorer.Menu.Session";
|
||||
const char RUNMENUCONTEXTMENU[] = "Project.RunMenu";
|
||||
const char FOLDER_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.F.OpenLocation.CtxMenu";
|
||||
const char PROJECT_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.P.OpenLocation.CtxMenu";
|
||||
const char SUBPROJECT_OPEN_LOCATIONS_CONTEXT_MENU[] = "Project.S.OpenLocation.CtxMenu";
|
||||
|
||||
} // namespace Constants
|
||||
|
||||
@@ -693,11 +692,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
folderOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
|
||||
folderOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Show);
|
||||
|
||||
ActionContainer *subProjectOpenLocationCtxMenu =
|
||||
ActionManager::createMenu(Constants::SUBPROJECT_OPEN_LOCATIONS_CONTEXT_MENU);
|
||||
subProjectOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
|
||||
subProjectOpenLocationCtxMenu->setOnAllDisabledBehavior(ActionContainer::Show);
|
||||
|
||||
ActionContainer *projectOpenLocationCtxMenu =
|
||||
ActionManager::createMenu(Constants::PROJECT_OPEN_LOCATIONS_CONTEXT_MENU);
|
||||
projectOpenLocationCtxMenu->menu()->setTitle(tr("Open..."));
|
||||
@@ -758,7 +752,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_LAST);
|
||||
msubProjectContextMenu->appendGroup(Constants::G_PROJECT_TREE);
|
||||
|
||||
msubProjectContextMenu->addMenu(subProjectOpenLocationCtxMenu, Constants::G_FOLDER_LOCATIONS);
|
||||
connect(msubProjectContextMenu->menu(), &QMenu::aboutToShow,
|
||||
dd, &ProjectExplorerPluginPrivate::updateLocationSubMenus);
|
||||
|
||||
|
||||
@@ -71,13 +71,9 @@ ProjectTree::ProjectTree(QObject *parent) : QObject(parent)
|
||||
this, &ProjectTree::update);
|
||||
|
||||
connect(SessionManager::instance(), &SessionManager::projectAdded,
|
||||
this, &ProjectTree::sessionChanged);
|
||||
connect(SessionManager::instance(), &SessionManager::projectAdded,
|
||||
this, &ProjectTree::treeChanged);
|
||||
this, &ProjectTree::sessionAndTreeChanged);
|
||||
connect(SessionManager::instance(), &SessionManager::projectRemoved,
|
||||
this, &ProjectTree::sessionChanged);
|
||||
connect(SessionManager::instance(), &SessionManager::projectRemoved,
|
||||
this, &ProjectTree::treeChanged);
|
||||
this, &ProjectTree::sessionAndTreeChanged);
|
||||
connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
|
||||
this, &ProjectTree::sessionChanged);
|
||||
connect(this, &ProjectTree::subtreeChanged, this, &ProjectTree::treeChanged);
|
||||
@@ -262,6 +258,12 @@ void ProjectTree::emitSubtreeChanged(FolderNode *node)
|
||||
emit s_instance->subtreeChanged(node);
|
||||
}
|
||||
|
||||
void ProjectTree::sessionAndTreeChanged()
|
||||
{
|
||||
sessionChanged();
|
||||
emit treeChanged();
|
||||
}
|
||||
|
||||
void ProjectTree::collapseAll()
|
||||
{
|
||||
if (m_focusForContextMenu)
|
||||
|
||||
@@ -89,6 +89,7 @@ signals:
|
||||
void treeChanged();
|
||||
|
||||
private:
|
||||
void sessionAndTreeChanged();
|
||||
void sessionChanged();
|
||||
void update();
|
||||
void updateFromProjectTreeWidget(Internal::ProjectTreeWidget *widget);
|
||||
|
||||
@@ -233,7 +233,10 @@ protected:
|
||||
class SessionDelegate : public BaseDelegate
|
||||
{
|
||||
protected:
|
||||
QString entryType() override { return tr("session", "Appears in \"Open session <name>\""); }
|
||||
QString entryType() override
|
||||
{
|
||||
return ProjectWelcomePage::tr("session", "Appears in \"Open session <name>\"");
|
||||
}
|
||||
QRect toolTipArea(const QRect &itemRect, const QModelIndex &idx) const override
|
||||
{
|
||||
// in expanded state bottom contains 'Clone', 'Rename', etc links, where the tool tip
|
||||
@@ -413,7 +416,10 @@ private:
|
||||
|
||||
class ProjectDelegate : public BaseDelegate
|
||||
{
|
||||
QString entryType() override { return tr("project", "Appears in \"Open project <name>\""); }
|
||||
QString entryType() override
|
||||
{
|
||||
return ProjectWelcomePage::tr("project", "Appears in \"Open project <name>\"");
|
||||
}
|
||||
int shortcutRole() const override { return ProjectModel::ShortcutRole; }
|
||||
|
||||
public:
|
||||
|
||||
@@ -616,6 +616,9 @@ public:
|
||||
runnable = runConfiguration->runnable();
|
||||
displayName = runConfiguration->displayName();
|
||||
outputFormatter = runConfiguration->createOutputFormatter();
|
||||
if (runnable.is<StandardRunnable>())
|
||||
device = runnable.as<StandardRunnable>().device;
|
||||
if (!device)
|
||||
device = DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||
project = runConfiguration->target()->project();
|
||||
} else {
|
||||
@@ -985,7 +988,7 @@ void RunControlPrivate::onWorkerStarted(RunWorker *worker)
|
||||
continueStart();
|
||||
return;
|
||||
}
|
||||
showError(tr("Unexpected run control state %1 when worker %2 started.")
|
||||
showError(RunControl::tr("Unexpected run control state %1 when worker %2 started.")
|
||||
.arg(stateName(state))
|
||||
.arg(worker->d->id));
|
||||
}
|
||||
@@ -1573,14 +1576,14 @@ void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
|
||||
if (startWatchdogCallback)
|
||||
startWatchdogCallback();
|
||||
else
|
||||
q->reportFailure(tr("Worker start timed out."));
|
||||
q->reportFailure(RunWorker::tr("Worker start timed out."));
|
||||
return;
|
||||
}
|
||||
if (ev->timerId() == stopWatchdogTimerId) {
|
||||
if (stopWatchdogCallback)
|
||||
stopWatchdogCallback();
|
||||
else
|
||||
q->reportFailure(tr("Worker stop timed out."));
|
||||
q->reportFailure(RunWorker::tr("Worker stop timed out."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,6 +517,8 @@ private:
|
||||
|
||||
class PROJECTEXPLORER_EXPORT SimpleTargetRunner : public RunWorker
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimpleTargetRunner(RunControl *runControl);
|
||||
|
||||
|
||||
@@ -1020,10 +1020,15 @@ bool SessionManager::loadSession(const QString &session)
|
||||
}
|
||||
|
||||
// find a list of projects to close later
|
||||
const QList<Project *> oldProjects = Utils::filtered(projects(), [&fileList](Project *p) {
|
||||
const QList<Project *> projectsToRemove = Utils::filtered(projects(), [&fileList](Project *p) {
|
||||
return !fileList.contains(p->projectFilePath().toString());
|
||||
});
|
||||
|
||||
const QList<Project *> openProjects = projects();
|
||||
const QStringList projectPathsToLoad = Utils::filtered(fileList, [&openProjects](const QString &path) {
|
||||
return !Utils::contains(openProjects, [&path](Project *p) {
|
||||
return p->projectFilePath().toString() == path;
|
||||
});
|
||||
});
|
||||
d->m_failedProjects.clear();
|
||||
d->m_depMap.clear();
|
||||
d->m_values.clear();
|
||||
@@ -1055,19 +1060,19 @@ bool SessionManager::loadSession(const QString &session)
|
||||
if (c.isValid())
|
||||
StyleHelper::setBaseColor(c);
|
||||
|
||||
d->m_future.setProgressRange(0, fileList.count() + 1/*initialization above*/ + 1/*editors*/);
|
||||
d->m_future.setProgressRange(0, projectPathsToLoad.count() + 1/*initialization above*/ + 1/*editors*/);
|
||||
d->m_future.setProgressValue(1);
|
||||
|
||||
// if one processEvents doesn't get the job done
|
||||
// just use two!
|
||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
d->restoreProjects(fileList);
|
||||
d->restoreProjects(projectPathsToLoad);
|
||||
d->sessionLoadingProgress();
|
||||
d->restoreDependencies(reader);
|
||||
d->restoreStartupProject(reader);
|
||||
|
||||
removeProjects(oldProjects); // only remove old projects now that the startup project is set!
|
||||
removeProjects(projectsToRemove); // only remove old projects now that the startup project is set!
|
||||
|
||||
d->restoreEditors(reader);
|
||||
|
||||
@@ -1082,6 +1087,7 @@ bool SessionManager::loadSession(const QString &session)
|
||||
ModeManager::activateMode(modeId);
|
||||
ModeManager::setFocusToCurrentMode();
|
||||
} else {
|
||||
removeProjects(projects());
|
||||
ModeManager::activateMode(Id(Core::Constants::MODE_EDIT));
|
||||
ModeManager::setFocusToCurrentMode();
|
||||
}
|
||||
|
||||
@@ -265,6 +265,8 @@ public:
|
||||
return m_qbsCleanStep->keepGoing();
|
||||
}
|
||||
|
||||
bool forceProbeExecution() const { return m_qbsBuildStep && m_qbsBuildStep->forceProbes(); }
|
||||
|
||||
bool showCommandLines() const {
|
||||
return m_qbsBuildStep ? m_qbsBuildStep->showCommandLines() : false;
|
||||
}
|
||||
@@ -328,6 +330,8 @@ QString QbsBuildConfiguration::equivalentCommandLine(const BuildStep *buildStep)
|
||||
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--dry-run"));
|
||||
if (stepProxy.keepGoing())
|
||||
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--keep-going"));
|
||||
if (stepProxy.forceProbeExecution())
|
||||
Utils::QtcProcess::addArg(&commandLine, QLatin1String("--force-probe-execution"));
|
||||
if (stepProxy.showCommandLines())
|
||||
Utils::QtcProcess::addArgs(&commandLine, QStringList({"--command-echo-mode",
|
||||
"command-line"}));
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace Internal {
|
||||
|
||||
class QbsKitInformation final : public ProjectExplorer::KitInformation
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static QString displayName();
|
||||
static QString representation(const ProjectExplorer::Kit *kit);
|
||||
|
||||
@@ -162,6 +162,7 @@ const DesignerActionManager &DesignerActionManagerView::designerActionManager()
|
||||
|
||||
void DesignerActionManagerView::emitSelectionChanged()
|
||||
{
|
||||
if (model())
|
||||
emit selectionChanged(!selectedModelNodes().isEmpty(), singleSelectedModelNode().isRootNode());
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
#include <QColor>
|
||||
@@ -36,7 +38,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class Theme : public Utils::Theme
|
||||
class QMLDESIGNERCORE_EXPORT Theme : public Utils::Theme
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace QmlDesigner {
|
||||
|
||||
class NavigatorTreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NavigatorTreeView(QWidget *parent = 0);
|
||||
static void drawSelectionBackground(QPainter *painter, const QStyleOption &option);
|
||||
|
||||
@@ -133,13 +133,11 @@ void TextEditorWidget::jumpTextCursorToSelectedModelNode()
|
||||
|
||||
const int nodeOffset = rewriterView->nodeOffset(selectedNode);
|
||||
if (nodeOffset > 0) {
|
||||
if (!rewriterView->nodeContainsCursor(selectedNode, m_textEditor->editorWidget()->textCursor().position())) {
|
||||
int line, column;
|
||||
m_textEditor->editorWidget()->convertPosition(nodeOffset, &line, &column);
|
||||
m_textEditor->editorWidget()->gotoLine(line, column);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_updateSelectionTimer.stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
qreal currentFrame() const;
|
||||
qreal duration() const;
|
||||
|
||||
qreal minActualFrame() const;
|
||||
qreal maxActualFrame() const;
|
||||
qreal minActualFrame(const ModelNode &target) const;
|
||||
qreal maxActualFrame(const ModelNode &target) const;
|
||||
|
||||
QList<ModelNode> allTargets() const;
|
||||
QList<QmlTimelineFrames> framesForTarget(const ModelNode &target) const;
|
||||
|
||||
@@ -132,7 +132,6 @@ public:
|
||||
int firstDefinitionInsideLength(const ModelNode &node) const;
|
||||
bool modificationGroupActive();
|
||||
ModelNode nodeAtTextCursorPosition(int cursorPosition) const;
|
||||
bool nodeContainsCursor(const ModelNode &node, int cursorPosition) const;
|
||||
|
||||
bool renameId(const QString& oldId, const QString& newId);
|
||||
|
||||
|
||||
@@ -412,6 +412,12 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
||||
Utils::Environment environment = Utils::Environment::systemEnvironment();
|
||||
if (!useOnlyFallbackPuppet())
|
||||
m_kit->addToEnvironment(environment);
|
||||
const QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(m_kit);
|
||||
if (QTC_GUARD(qt)) { // Kits without a Qt version should not have a puppet!
|
||||
// Update PATH to include QT_HOST_BINS
|
||||
const Utils::FileName qtBinPath = qt->binPath();
|
||||
environment.prependOrSetPath(qtBinPath.toString());
|
||||
}
|
||||
environment.set("QML_BAD_GUI_RENDER_LOOP", "true");
|
||||
environment.set("QML_USE_MOCKUPS", "true");
|
||||
environment.set("QML_PUPPET_MODE", "true");
|
||||
|
||||
@@ -130,34 +130,28 @@ qreal QmlTimelineMutator::duration() const
|
||||
return endFrame() - startFrame();
|
||||
}
|
||||
|
||||
qreal QmlTimelineMutator::minActualFrame() const
|
||||
qreal QmlTimelineMutator::minActualFrame(const ModelNode &target) const
|
||||
{
|
||||
qreal min = std::numeric_limits<double>::max();
|
||||
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) {
|
||||
QmlTimelineFrames frames(childNode);
|
||||
for (const QmlTimelineFrames &frames : framesForTarget(target)) {
|
||||
qreal value = frames.minActualFrame();
|
||||
if (value < min)
|
||||
min = value;
|
||||
}
|
||||
}
|
||||
|
||||
return min;
|
||||
}
|
||||
|
||||
qreal QmlTimelineMutator::maxActualFrame() const
|
||||
qreal QmlTimelineMutator::maxActualFrame(const ModelNode &target) const
|
||||
{
|
||||
qreal max = std::numeric_limits<double>::min();
|
||||
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) {
|
||||
QmlTimelineFrames frames(childNode);
|
||||
for (const QmlTimelineFrames &frames : framesForTarget(target)) {
|
||||
qreal value = frames.maxActualFrame();
|
||||
if (value > max)
|
||||
max = value;
|
||||
}
|
||||
}
|
||||
|
||||
return max;
|
||||
}
|
||||
|
||||
@@ -612,17 +612,6 @@ ModelNode RewriterView::nodeAtTextCursorPosition(int cursorPosition) const
|
||||
return nodeAtTextCursorPositionRekursive(rootModelNode(), cursorPosition);
|
||||
}
|
||||
|
||||
bool RewriterView::nodeContainsCursor(const ModelNode &node, int cursorPosition) const
|
||||
{
|
||||
const int nodeTextLength = nodeLength(node);
|
||||
const int nodeTextOffset = nodeOffset(node);
|
||||
|
||||
if (isInNodeDefinition(nodeTextOffset, nodeTextLength, cursorPosition))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool RewriterView::renameId(const QString& oldId, const QString& newId)
|
||||
{
|
||||
if (textModifier()) {
|
||||
|
||||
@@ -231,18 +231,24 @@ void ConnectionViewWidget::handleTabChanged(int)
|
||||
void ConnectionViewWidget::removeButtonClicked()
|
||||
{
|
||||
if (currentTab() == ConnectionTab) {
|
||||
if (ui->connectionView->selectionModel()->selectedRows().isEmpty())
|
||||
return;
|
||||
int currentRow = ui->connectionView->selectionModel()->selectedRows().first().row();
|
||||
ConnectionModel *connectionModel = qobject_cast<ConnectionModel*>(ui->connectionView->model());
|
||||
if (connectionModel) {
|
||||
connectionModel->deleteConnectionByRow(currentRow);
|
||||
}
|
||||
} else if (currentTab() == BindingTab) {
|
||||
if (ui->bindingView->selectionModel()->selectedRows().isEmpty())
|
||||
return;
|
||||
int currentRow = ui->bindingView->selectionModel()->selectedRows().first().row();
|
||||
BindingModel *bindingModel = qobject_cast<BindingModel*>(ui->bindingView->model());
|
||||
if (bindingModel) {
|
||||
bindingModel->deleteBindindByRow(currentRow);
|
||||
}
|
||||
} else if (currentTab() == DynamicPropertiesTab) {
|
||||
if (ui->dynamicPropertiesView->selectionModel()->selectedRows().isEmpty())
|
||||
return;
|
||||
int currentRow = ui->dynamicPropertiesView->selectionModel()->selectedRows().first().row();
|
||||
DynamicPropertiesModel *dynamicPropertiesModel = qobject_cast<DynamicPropertiesModel*>(ui->dynamicPropertiesView->model());
|
||||
if (dynamicPropertiesModel)
|
||||
|
||||
@@ -136,22 +136,17 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl)
|
||||
setDisplayName("QnxDebugSupport");
|
||||
appendMessage(tr("Preparing remote side..."), LogMessageFormat);
|
||||
|
||||
m_portsGatherer = new GdbServerPortsGatherer(runControl);
|
||||
m_portsGatherer->setUseGdbServer(isCppDebugging());
|
||||
m_portsGatherer->setUseQmlServer(isQmlDebugging());
|
||||
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
||||
|
||||
auto debuggeeRunner = new QnxDebuggeeRunner(runControl, m_portsGatherer);
|
||||
debuggeeRunner->addStartDependency(m_portsGatherer);
|
||||
auto debuggeeRunner = new QnxDebuggeeRunner(runControl, portsGatherer());
|
||||
debuggeeRunner->addStartDependency(portsGatherer());
|
||||
|
||||
auto slog2InfoRunner = new Slog2InfoRunner(runControl);
|
||||
debuggeeRunner->addStartDependency(slog2InfoRunner);
|
||||
|
||||
addStartDependency(debuggeeRunner);
|
||||
}
|
||||
|
||||
void QnxDebugSupport::start()
|
||||
{
|
||||
auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl()->runConfiguration());
|
||||
auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl->runConfiguration());
|
||||
QTC_ASSERT(runConfig, return);
|
||||
Target *target = runConfig->target();
|
||||
Kit *k = target->kit();
|
||||
@@ -159,14 +154,10 @@ void QnxDebugSupport::start()
|
||||
setStartMode(AttachToRemoteServer);
|
||||
setCloseMode(KillAtClose);
|
||||
setUseCtrlCStub(true);
|
||||
setRemoteChannel(m_portsGatherer->gdbServerChannel());
|
||||
setQmlServer(m_portsGatherer->qmlServer());
|
||||
setSolibSearchPath(searchPaths(k));
|
||||
if (auto qtVersion = dynamic_cast<QnxQtVersion *>(QtSupport::QtKitInformation::qtVersion(k)))
|
||||
setSysRoot(qtVersion->qnxTarget());
|
||||
setSymbolFile(runConfig->localExecutableFilePath());
|
||||
|
||||
DebuggerRunTool::start();
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +204,7 @@ public:
|
||||
: SimpleTargetRunner(runControl), m_portsGatherer(portsGatherer)
|
||||
{
|
||||
setDisplayName("PDebugRunner");
|
||||
addStartDependency(m_portsGatherer);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -236,28 +228,14 @@ QnxAttachDebugSupport::QnxAttachDebugSupport(RunControl *runControl)
|
||||
{
|
||||
setDisplayName("QnxAttachDebugSupport");
|
||||
|
||||
m_portsGatherer = new GdbServerPortsGatherer(runControl);
|
||||
m_portsGatherer->setUseGdbServer(isCppDebugging());
|
||||
m_portsGatherer->setUseQmlServer(isQmlDebugging());
|
||||
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
||||
|
||||
if (isCppDebugging()) {
|
||||
m_pdebugRunner = new PDebugRunner(runControl, m_portsGatherer);
|
||||
m_pdebugRunner->addStartDependency(m_portsGatherer);
|
||||
addStartDependency(m_pdebugRunner);
|
||||
} else {
|
||||
// No pdebug needed for Qml-only debugging.
|
||||
addStartDependency(m_portsGatherer);
|
||||
auto pdebugRunner = new PDebugRunner(runControl, portsGatherer());
|
||||
addStartDependency(pdebugRunner);
|
||||
}
|
||||
}
|
||||
|
||||
void QnxAttachDebugSupport::start()
|
||||
{
|
||||
setRemoteChannel(m_portsGatherer->gdbServerChannel());
|
||||
setQmlServer(m_portsGatherer->qmlServer());
|
||||
|
||||
DebuggerRunTool::start();
|
||||
}
|
||||
|
||||
void QnxAttachDebugSupport::showProcessesDialog()
|
||||
{
|
||||
auto kitChooser = new KitChooser;
|
||||
|
||||
@@ -36,11 +36,6 @@ class QnxDebugSupport : public Debugger::DebuggerRunTool
|
||||
|
||||
public:
|
||||
explicit QnxDebugSupport(ProjectExplorer::RunControl *runControl);
|
||||
|
||||
private:
|
||||
void start() override;
|
||||
|
||||
Debugger::GdbServerPortsGatherer *m_portsGatherer;
|
||||
};
|
||||
|
||||
class QnxAttachDebugSupport : public Debugger::DebuggerRunTool
|
||||
@@ -51,12 +46,6 @@ public:
|
||||
explicit QnxAttachDebugSupport(ProjectExplorer::RunControl *runControl);
|
||||
|
||||
static void showProcessesDialog();
|
||||
|
||||
private:
|
||||
void start() final;
|
||||
|
||||
Debugger::GdbServerPortsGatherer *m_portsGatherer;
|
||||
ProjectExplorer::SimpleTargetRunner *m_pdebugRunner;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -598,7 +598,7 @@ public:
|
||||
|
||||
auto hbox = new QHBoxLayout;
|
||||
if (m_isExamples) {
|
||||
m_searcher->setPlaceholderText(tr("Search in Examples..."));
|
||||
m_searcher->setPlaceholderText(ExamplesWelcomePage::tr("Search in Examples..."));
|
||||
|
||||
auto exampleSetSelector = new QComboBox(this);
|
||||
exampleSetSelector->setMinimumWidth(itemWidth);
|
||||
@@ -614,7 +614,7 @@ public:
|
||||
hbox->setSpacing(17);
|
||||
hbox->addWidget(exampleSetSelector);
|
||||
} else {
|
||||
m_searcher->setPlaceholderText(tr("Search in Tutorials..."));
|
||||
m_searcher->setPlaceholderText(ExamplesWelcomePage::tr("Search in Tutorials..."));
|
||||
}
|
||||
hbox->addWidget(searchBox);
|
||||
hbox->addSpacing(sideMargin);
|
||||
|
||||
@@ -39,12 +39,10 @@ LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl)
|
||||
{
|
||||
setDisplayName("LinuxDeviceDebugSupport");
|
||||
|
||||
m_portsGatherer = new GdbServerPortsGatherer(runControl);
|
||||
m_portsGatherer->setUseGdbServer(isCppDebugging());
|
||||
m_portsGatherer->setUseQmlServer(isQmlDebugging());
|
||||
setUsePortsGatherer(isCppDebugging(), isQmlDebugging());
|
||||
addQmlServerInferiorCommandLineArgumentIfNeeded();
|
||||
|
||||
auto gdbServer = new GdbServerRunner(runControl, m_portsGatherer);
|
||||
gdbServer->addStartDependency(m_portsGatherer);
|
||||
auto gdbServer = new GdbServerRunner(runControl, portsGatherer());
|
||||
|
||||
addStartDependency(gdbServer);
|
||||
|
||||
@@ -59,14 +57,5 @@ LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RunControl *runControl)
|
||||
setSymbolFile(rlrc->localExecutableFilePath());
|
||||
}
|
||||
|
||||
void LinuxDeviceDebugSupport::start()
|
||||
{
|
||||
setRemoteChannel(m_portsGatherer->gdbServerChannel());
|
||||
setQmlServer(m_portsGatherer->qmlServer());
|
||||
addQmlServerInferiorCommandLineArgumentIfNeeded();
|
||||
|
||||
DebuggerRunTool::start();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace RemoteLinux
|
||||
|
||||
@@ -34,11 +34,6 @@ class LinuxDeviceDebugSupport : public Debugger::DebuggerRunTool
|
||||
{
|
||||
public:
|
||||
LinuxDeviceDebugSupport(ProjectExplorer::RunControl *runControl);
|
||||
|
||||
private:
|
||||
void start() override;
|
||||
|
||||
Debugger::GdbServerPortsGatherer *m_portsGatherer = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -202,7 +202,7 @@ void GraphicsScene::removeSelectedItems()
|
||||
{
|
||||
QVector<ScxmlTag*> tags = SceneUtils::findRemovedTags(m_baseItems);
|
||||
if (tags.count() > 0) {
|
||||
m_document->undoStack()->beginMacro(tr("Remove item(s)"));
|
||||
m_document->undoStack()->beginMacro(tr("Remove items"));
|
||||
|
||||
// Then remove found tags
|
||||
for (int i = tags.count(); i--;) {
|
||||
@@ -368,7 +368,7 @@ void GraphicsScene::init()
|
||||
|
||||
void GraphicsScene::runLayoutToSelectedStates()
|
||||
{
|
||||
m_document->undoStack()->beginMacro(tr("Relayout"));
|
||||
m_document->undoStack()->beginMacro(tr("Re-layout"));
|
||||
|
||||
QVector<BaseItem*> selectedItems;
|
||||
foreach (BaseItem *node, m_baseItems) {
|
||||
|
||||
@@ -54,7 +54,7 @@ void IdWarningItem::setId(const QString &text)
|
||||
|
||||
// Check new id
|
||||
if (m_id.isEmpty()) {
|
||||
setReason(tr("Missing ID"));
|
||||
setReason(tr("Missing ID."));
|
||||
setWarningActive(true);
|
||||
} else
|
||||
checkDuplicates(m_id);
|
||||
@@ -78,7 +78,7 @@ void IdWarningItem::checkDuplicates(const QString &id)
|
||||
foundItems[0]->setWarningActive(false);
|
||||
} else {
|
||||
for (int i = 0; i < foundItems.count(); ++i) {
|
||||
foundItems[i]->setReason(tr("Duplicate ID (%1)").arg(id));
|
||||
foundItems[i]->setReason(tr("Duplicate ID (%1).").arg(id));
|
||||
foundItems[i]->setWarningActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ InitialWarningItem::InitialWarningItem(InitialStateItem *parent)
|
||||
setSeverity(OutputPane::Warning::ErrorType);
|
||||
setTypeName(tr("Initial"));
|
||||
setDescription(tr("One level can contain only one initial state."));
|
||||
setReason(tr("Too many initial states at the same level"));
|
||||
setReason(tr("Too many initial states at the same level."));
|
||||
}
|
||||
|
||||
void InitialWarningItem::updatePos()
|
||||
|
||||
@@ -38,7 +38,7 @@ StateWarningItem::StateWarningItem(StateItem *parent)
|
||||
setDescription(tr("Draw some transitions to state."));
|
||||
|
||||
setPixmap(Utils::Icons::WARNING.pixmap());
|
||||
setReason(tr("No input connection"));
|
||||
setReason(tr("No input connection."));
|
||||
}
|
||||
|
||||
void StateWarningItem::setIdWarning(IdWarningItem *idwarning)
|
||||
@@ -56,15 +56,15 @@ void StateWarningItem::check()
|
||||
bool inputProblem = !m_parentItem->isInitial() && !m_parentItem->hasInputTransitions(m_parentItem, true);
|
||||
|
||||
if (outputProblem && inputProblem) {
|
||||
setReason(tr("No input or output connections (%1)").arg(m_parentItem->itemId()));
|
||||
setReason(tr("No input or output connections (%1).").arg(m_parentItem->itemId()));
|
||||
setDescription(tr("Draw some transitions to or from state."));
|
||||
setWarningActive(true);
|
||||
} else if (outputProblem) {
|
||||
setReason(tr("No output connections (%1)").arg(m_parentItem->itemId()));
|
||||
setReason(tr("No output connections (%1).").arg(m_parentItem->itemId()));
|
||||
setDescription(tr("Draw some transitions from state."));
|
||||
setWarningActive(true);
|
||||
} else if (inputProblem) {
|
||||
setReason(tr("No input connections (%1)").arg(m_parentItem->itemId()));
|
||||
setReason(tr("No input connections (%1).").arg(m_parentItem->itemId()));
|
||||
setDescription(tr("Draw some transitions to state."));
|
||||
setWarningActive(true);
|
||||
} else
|
||||
|
||||
@@ -45,7 +45,7 @@ void TransitionWarningItem::check()
|
||||
{
|
||||
if (m_parentItem) {
|
||||
if (m_parentItem->targetType() == TransitionItem::ExternalNoTarget) {
|
||||
setReason(tr("Not Connected (%1)").arg(m_parentItem->tagValue("event")));
|
||||
setReason(tr("Not connected (%1).").arg(m_parentItem->tagValue("event")));
|
||||
setWarningActive(true);
|
||||
} else
|
||||
setWarningActive(false);
|
||||
|
||||
@@ -64,7 +64,7 @@ class InternalEngine : public TextEditor::SearchEngine
|
||||
public:
|
||||
InternalEngine() : m_widget(new QWidget) {}
|
||||
~InternalEngine() override { delete m_widget;}
|
||||
QString title() const override { return tr("Internal"); }
|
||||
QString title() const override { return TextEditor::SearchEngine::tr("Internal"); }
|
||||
QString toolTip() const override { return QString(); }
|
||||
QWidget *widget() const override { return m_widget; }
|
||||
QVariant parameters() const override { return QVariant(); }
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user