forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.10'
Change-Id: I88a6704fb8d723a3cbdfb1a2d9c84741f30d4da6
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2018 The Qt Company Ltd.
|
** Copyright (C) 2019 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -77,10 +77,9 @@
|
|||||||
|
|
||||||
\QC supports native debuggers when working with compiled code. On
|
\QC supports native debuggers when working with compiled code. On
|
||||||
most supported platforms, the GNU Symbolic Debugger GDB can be used. On
|
most supported platforms, the GNU Symbolic Debugger GDB can be used. On
|
||||||
Microsoft Windows, when using the Microsoft tool chain the Microsoft Console
|
Microsoft Windows, when using the Microsoft tool chain, the Microsoft
|
||||||
Debugger CDB, is needed. On \macos, the LLDB debugger can be used. Basic
|
Console Debugger CDB is needed. On \macos and Linux, the LLDB debugger
|
||||||
support for LLDB is also available on Linux, but it is restricted by LLDB's
|
can be used.
|
||||||
capabilities there, and considered experimental.
|
|
||||||
|
|
||||||
The following table summarizes the support for debugging C++ code:
|
The following table summarizes the support for debugging C++ code:
|
||||||
|
|
||||||
@@ -92,7 +91,7 @@
|
|||||||
\row
|
\row
|
||||||
\li Linux
|
\li Linux
|
||||||
\li GCC, ICC
|
\li GCC, ICC
|
||||||
\li GDB, LLDB (experimental)
|
\li GDB, LLDB
|
||||||
\row
|
\row
|
||||||
\li Unix
|
\li Unix
|
||||||
\li GCC, ICC
|
\li GCC, ICC
|
||||||
@@ -340,29 +339,4 @@
|
|||||||
of the project.
|
of the project.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Setting Up Experimental LLDB Support
|
|
||||||
|
|
||||||
To use the experimental interface to LLDB, you must set up a kit that uses
|
|
||||||
the LLDB engine and select the kit for your project:
|
|
||||||
|
|
||||||
\list 1
|
|
||||||
|
|
||||||
\li Select \uicontrol Tools > \uicontrol Options >
|
|
||||||
\uicontrol Kits.
|
|
||||||
|
|
||||||
\li Select an automatically created kit in the list, and then select
|
|
||||||
\uicontrol Clone to create a copy of the kit.
|
|
||||||
|
|
||||||
\li In the \uicontrol Debugger field, select an LLDB Engine. If an LLDB
|
|
||||||
Engine is not listed, select \uicontrol Manage to add it in
|
|
||||||
\uicontrol Tools > \uicontrol Options > \uicontrol Kits >
|
|
||||||
\uicontrol Debuggers. For more information, see
|
|
||||||
\l {Adding Debuggers}.
|
|
||||||
|
|
||||||
\li To use the debugger, add the kit in the \uicontrol {Build Settings}
|
|
||||||
of the project.
|
|
||||||
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@@ -518,8 +518,8 @@ Column {
|
|||||||
height: 20
|
height: 20
|
||||||
visible: colorEditor.supportGradient
|
visible: colorEditor.supportGradient
|
||||||
|
|
||||||
color: "white"
|
color: Theme.qmlDesignerButtonColor()
|
||||||
border.color: "white"
|
border.color: Theme.qmlDesignerBorderColor()
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
ToolTipArea {
|
ToolTipArea {
|
||||||
@@ -566,20 +566,18 @@ Column {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Image {
|
||||||
width: 18
|
id: image
|
||||||
height: 18
|
width: 16
|
||||||
|
height: 16
|
||||||
|
smooth: false
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: "steelblue"
|
source: "images/icon-gradient-list.png"
|
||||||
|
}
|
||||||
border.color: "black"
|
MouseArea {
|
||||||
border.width: 1
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
MouseArea {
|
presetList.open()
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
presetList.open()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,59 @@
|
|||||||
|
import qbs.FileInfo
|
||||||
|
|
||||||
|
@if %{IsStatic}
|
||||||
|
StaticLibrary {
|
||||||
|
@else
|
||||||
|
DynamicLibrary {
|
||||||
|
@endif
|
||||||
|
@if '%{QtModule}' === 'none'
|
||||||
|
Depends { name: "cpp" }
|
||||||
|
@else
|
||||||
|
Depends { name: "Qt.%{QtModule}" }
|
||||||
|
@endif
|
||||||
|
|
||||||
|
cpp.cxxLanguageVersion: "c++11"
|
||||||
|
cpp.defines: [
|
||||||
|
@if %{IsShared}
|
||||||
|
"%{LibraryDefine}",
|
||||||
|
@endif
|
||||||
|
@if %{IsQtPlugin}
|
||||||
|
"QT_PLUGIN",
|
||||||
|
@endif
|
||||||
|
|
||||||
|
// The following define makes your compiler emit warnings if you use
|
||||||
|
// any Qt feature that has been marked deprecated (the exact warnings
|
||||||
|
// depend on your compiler). Please consult the documentation of the
|
||||||
|
// deprecated API in order to know how to port your code away from it.
|
||||||
|
"QT_DEPRECATED_WARNINGS",
|
||||||
|
|
||||||
|
// You can also make your code fail to compile if it uses deprecated APIs.
|
||||||
|
// In order to do so, uncomment the following line.
|
||||||
|
// You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
|
// "QT_DISABLE_DEPRECATED_BEFORE=0x060000", // disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
]
|
||||||
|
|
||||||
|
files: [
|
||||||
|
"%{SrcFileName}",
|
||||||
|
@if %{IsShared}
|
||||||
|
"%{GlobalHdrFileName}",
|
||||||
|
@endif
|
||||||
|
"%{HdrFileName}",
|
||||||
|
@if %{IsQtPlugin}
|
||||||
|
"%{PluginJsonFile}",
|
||||||
|
@endif
|
||||||
|
]
|
||||||
|
|
||||||
|
@if '%{TargetInstallPath}' != ''
|
||||||
|
// Default rules for deployment.
|
||||||
|
qbs.installPrefix: ""
|
||||||
|
Properties {
|
||||||
|
condition: qbs.targetOS.contains("unix")
|
||||||
|
install: true
|
||||||
|
@if %{IsQtPlugin}
|
||||||
|
installDir: FileInfo.joinPaths(Qt.core.pluginPath, "%{PluginTargetPath}")
|
||||||
|
@else
|
||||||
|
installDir: "%{TargetInstallPath}"
|
||||||
|
@endif
|
||||||
|
}
|
||||||
|
@endif
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qt4ProjectManager.Qt4Project" ],
|
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ],
|
||||||
"id": "H.CppLibrary",
|
"id": "H.CppLibrary",
|
||||||
"category": "G.Library",
|
"category": "G.Library",
|
||||||
"trDescription": "Creates a C++ library. This can be used to create:<ul><li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li><li>a shared or static C++ library for use with another project at linktime</li></ul>",
|
"trDescription": "Creates a C++ library. This can be used to create:<ul><li>a shared C++ library for use with <tt>QPluginLoader</tt> and runtime (Plugins)</li><li>a shared or static C++ library for use with another project at linktime</li></ul>",
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
"options":
|
"options":
|
||||||
[
|
[
|
||||||
{ "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : value('CMakeFile')}" },
|
{ "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('ProFile')}" },
|
||||||
{ "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" },
|
{ "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), value('BuildSystem') === 'qmake' ? 'pro' : 'qbs')}" },
|
||||||
{ "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
|
{ "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" },
|
||||||
{ "key": "PluginJsonFile", "value": "%{JS: Util.fileName(value('ProjectName'), 'json')}" },
|
{ "key": "PluginJsonFile", "value": "%{JS: Util.fileName(value('ProjectName'), 'json')}" },
|
||||||
{ "key": "IsShared", "value": "%{JS: value('Type') === 'shared'}" },
|
{ "key": "IsShared", "value": "%{JS: value('Type') === 'shared'}" },
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
"items":
|
"items":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"trKey": "Qmake",
|
"trKey": "qmake",
|
||||||
"value": "qmake",
|
"value": "qmake",
|
||||||
"condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}"
|
"condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}"
|
||||||
},
|
},
|
||||||
@@ -67,6 +67,11 @@
|
|||||||
"trKey": "CMake",
|
"trKey": "CMake",
|
||||||
"value": "cmake",
|
"value": "cmake",
|
||||||
"condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
|
"condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"trKey": "Qbs",
|
||||||
|
"value": "qbs",
|
||||||
|
"condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -291,6 +296,12 @@
|
|||||||
"openAsProject": true,
|
"openAsProject": true,
|
||||||
"condition": "%{JS: value('BuildSystem') === 'qmake'}"
|
"condition": "%{JS: value('BuildSystem') === 'qmake'}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"source": "project.qbs",
|
||||||
|
"target": "%{ProFile}",
|
||||||
|
"openAsProject": true,
|
||||||
|
"condition": "%{JS: value('BuildSystem') === 'qbs'}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"source": "CMakeLists.txt",
|
"source": "CMakeLists.txt",
|
||||||
"openAsProject": true,
|
"openAsProject": true,
|
||||||
|
@@ -145,6 +145,7 @@ constexpr char optionsKey[] = "options";
|
|||||||
constexpr char parametersKey[] = "params";
|
constexpr char parametersKey[] = "params";
|
||||||
constexpr char patternKey[] = "pattern";
|
constexpr char patternKey[] = "pattern";
|
||||||
constexpr char positionKey[] = "position";
|
constexpr char positionKey[] = "position";
|
||||||
|
constexpr char prepareProviderKey[] = "prepareProvider";
|
||||||
constexpr char processIdKey[] = "processId";
|
constexpr char processIdKey[] = "processId";
|
||||||
constexpr char queryKey[] = "query";
|
constexpr char queryKey[] = "query";
|
||||||
constexpr char rangeFormattingKey[] = "rangeFormatting";
|
constexpr char rangeFormattingKey[] = "rangeFormatting";
|
||||||
|
@@ -111,6 +111,44 @@ Utils::optional<Utils::variant<bool, CodeActionOptions>> ServerCapabilities::cod
|
|||||||
return Utils::nullopt;
|
return Utils::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils::optional<Utils::variant<ServerCapabilities::RenameOptions, bool>> ServerCapabilities::renameProvider() const
|
||||||
|
{
|
||||||
|
using RetType = Utils::variant<ServerCapabilities::RenameOptions, bool>;
|
||||||
|
const QJsonValue &localValue = value(renameProviderKey);
|
||||||
|
if (localValue.isBool())
|
||||||
|
return RetType(localValue.toBool());
|
||||||
|
if (localValue.isObject())
|
||||||
|
return RetType(RenameOptions(localValue.toObject()));
|
||||||
|
return Utils::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerCapabilities::setRenameProvider(Utils::variant<ServerCapabilities::RenameOptions, bool> renameProvider)
|
||||||
|
{
|
||||||
|
if (Utils::holds_alternative<bool>(renameProvider))
|
||||||
|
insert(renameProviderKey, Utils::get<bool>(renameProvider));
|
||||||
|
else if (Utils::holds_alternative<RenameOptions>(renameProvider))
|
||||||
|
insert(renameProviderKey, Utils::get<RenameOptions>(renameProvider));
|
||||||
|
}
|
||||||
|
|
||||||
|
Utils::optional<Utils::variant<bool, JsonObject>> ServerCapabilities::colorProvider() const
|
||||||
|
{
|
||||||
|
using RetType = Utils::variant<bool, JsonObject>;
|
||||||
|
const QJsonValue &localValue = value(colorProviderKey);
|
||||||
|
if (localValue.isBool())
|
||||||
|
return RetType(localValue.toBool());
|
||||||
|
if (localValue.isObject())
|
||||||
|
return RetType(JsonObject(localValue.toObject()));
|
||||||
|
return Utils::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ServerCapabilities::setColorProvider(Utils::variant<bool, JsonObject> colorProvider)
|
||||||
|
{
|
||||||
|
if (Utils::holds_alternative<bool>(colorProvider))
|
||||||
|
insert(renameProviderKey, Utils::get<bool>(colorProvider));
|
||||||
|
else if (Utils::holds_alternative<JsonObject>(colorProvider))
|
||||||
|
insert(renameProviderKey, Utils::get<JsonObject>(colorProvider));
|
||||||
|
}
|
||||||
|
|
||||||
bool ServerCapabilities::isValid(QStringList *error) const
|
bool ServerCapabilities::isValid(QStringList *error) const
|
||||||
{
|
{
|
||||||
return checkOptional<TextDocumentSyncOptions, int>(error, textDocumentSyncKey)
|
return checkOptional<TextDocumentSyncOptions, int>(error, textDocumentSyncKey)
|
||||||
@@ -128,9 +166,9 @@ bool ServerCapabilities::isValid(QStringList *error) const
|
|||||||
&& checkOptional<CodeLensOptions>(error, codeLensProviderKey)
|
&& checkOptional<CodeLensOptions>(error, codeLensProviderKey)
|
||||||
&& checkOptional<bool>(error, documentFormattingProviderKey)
|
&& checkOptional<bool>(error, documentFormattingProviderKey)
|
||||||
&& checkOptional<bool>(error, documentRangeFormattingProviderKey)
|
&& checkOptional<bool>(error, documentRangeFormattingProviderKey)
|
||||||
&& checkOptional<bool>(error, renameProviderKey)
|
&& checkOptional<bool, RenameOptions>(error, renameProviderKey)
|
||||||
&& checkOptional<DocumentLinkOptions>(error, documentLinkProviderKey)
|
&& checkOptional<DocumentLinkOptions>(error, documentLinkProviderKey)
|
||||||
&& checkOptional<TextDocumentRegistrationOptions>(error, colorProviderKey)
|
&& checkOptional<bool, JsonObject>(error, colorProviderKey)
|
||||||
&& checkOptional<ExecuteCommandOptions>(error, executeCommandProviderKey)
|
&& checkOptional<ExecuteCommandOptions>(error, executeCommandProviderKey)
|
||||||
&& checkOptional<WorkspaceServerCapabilities>(error, workspaceKey)
|
&& checkOptional<WorkspaceServerCapabilities>(error, workspaceKey)
|
||||||
&& checkOptional<SemanticHighlightingServerCapabilities>(error, semanticHighlightingKey);
|
&& checkOptional<SemanticHighlightingServerCapabilities>(error, semanticHighlightingKey);
|
||||||
|
@@ -357,9 +357,23 @@ public:
|
|||||||
{ insert(documentRangeFormattingProviderKey, documentRangeFormattingProvider); }
|
{ insert(documentRangeFormattingProviderKey, documentRangeFormattingProvider); }
|
||||||
void clearDocumentRangeFormattingProvider() { remove(documentRangeFormattingProviderKey); }
|
void clearDocumentRangeFormattingProvider() { remove(documentRangeFormattingProviderKey); }
|
||||||
|
|
||||||
|
class RenameOptions : public JsonObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using JsonObject::JsonObject;
|
||||||
|
|
||||||
|
// Renames should be checked and tested before being executed.
|
||||||
|
Utils::optional<bool> prepareProvider() const { return optionalValue<bool>(prepareProviderKey); }
|
||||||
|
void setPrepareProvider(bool prepareProvider) { insert(prepareProviderKey, prepareProvider); }
|
||||||
|
void clearPrepareProvider() { remove(prepareProviderKey); }
|
||||||
|
|
||||||
|
bool isValid(QStringList * error) const override
|
||||||
|
{ return checkOptional<bool>(error, prepareProviderKey); }
|
||||||
|
};
|
||||||
|
|
||||||
// The server provides rename support.
|
// The server provides rename support.
|
||||||
Utils::optional<bool> renameProvider() const { return optionalValue<bool>(renameProviderKey); }
|
Utils::optional<Utils::variant<RenameOptions, bool>> renameProvider() const;
|
||||||
void setRenameProvider(bool renameProvider) { insert(renameProviderKey, renameProvider); }
|
void setRenameProvider(Utils::variant<RenameOptions,bool> renameProvider);
|
||||||
void clearRenameProvider() { remove(renameProviderKey); }
|
void clearRenameProvider() { remove(renameProviderKey); }
|
||||||
|
|
||||||
// The server provides document link support.
|
// The server provides document link support.
|
||||||
@@ -370,10 +384,8 @@ public:
|
|||||||
void clearDocumentLinkProvider() { remove(documentLinkProviderKey); }
|
void clearDocumentLinkProvider() { remove(documentLinkProviderKey); }
|
||||||
|
|
||||||
// The server provides color provider support.
|
// The server provides color provider support.
|
||||||
Utils::optional<TextDocumentRegistrationOptions> colorProvider() const
|
Utils::optional<Utils::variant<bool, JsonObject>> colorProvider() const;
|
||||||
{ return optionalValue<TextDocumentRegistrationOptions>(colorProviderKey); }
|
void setColorProvider(Utils::variant<bool, JsonObject> colorProvider);
|
||||||
void setColorProvider(TextDocumentRegistrationOptions colorProvider)
|
|
||||||
{ insert(colorProviderKey, colorProvider); }
|
|
||||||
void clearColorProvider() { remove(colorProviderKey); }
|
void clearColorProvider() { remove(colorProviderKey); }
|
||||||
|
|
||||||
// The server provides execute command support.
|
// The server provides execute command support.
|
||||||
|
@@ -651,11 +651,16 @@ SubDirFileIterator::SubDirFileIterator(const QStringList &directories, const QSt
|
|||||||
{
|
{
|
||||||
m_encoding = (encoding == nullptr ? QTextCodec::codecForLocale() : encoding);
|
m_encoding = (encoding == nullptr ? QTextCodec::codecForLocale() : encoding);
|
||||||
qreal maxPer = qreal(MAX_PROGRESS) / directories.count();
|
qreal maxPer = qreal(MAX_PROGRESS) / directories.count();
|
||||||
foreach (const QString &directoryEntry, directories) {
|
for (const QString &directoryEntry : directories) {
|
||||||
if (!directoryEntry.isEmpty()) {
|
if (!directoryEntry.isEmpty()) {
|
||||||
m_dirs.push(QDir(directoryEntry));
|
const QDir dir(directoryEntry);
|
||||||
m_progressValues.push(maxPer);
|
const QString canonicalPath = dir.canonicalPath();
|
||||||
m_processedValues.push(false);
|
if (!canonicalPath.isEmpty() && dir.exists()) {
|
||||||
|
m_dirs.push(dir);
|
||||||
|
m_knownDirs.insert(canonicalPath);
|
||||||
|
m_progressValues.push(maxPer);
|
||||||
|
m_processedValues.push(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -676,10 +681,18 @@ void SubDirFileIterator::update(int index)
|
|||||||
const bool processed = m_processedValues.pop();
|
const bool processed = m_processedValues.pop();
|
||||||
if (dir.exists()) {
|
if (dir.exists()) {
|
||||||
const QString dirPath = dir.path();
|
const QString dirPath = dir.path();
|
||||||
QStringList subDirs;
|
using Dir = QString;
|
||||||
if (!processed)
|
using CanonicalDir = QString;
|
||||||
subDirs = dir.entryList(QDir::Dirs|QDir::Hidden|QDir::NoDotAndDotDot);
|
std::vector<std::pair<Dir, CanonicalDir>> subDirs;
|
||||||
if (subDirs.isEmpty()) {
|
if (!processed) {
|
||||||
|
for (const QFileInfo &info :
|
||||||
|
dir.entryInfoList(QDir::Dirs | QDir::Hidden | QDir::NoDotAndDotDot)) {
|
||||||
|
const QString canonicalDir = info.canonicalFilePath();
|
||||||
|
if (!m_knownDirs.contains(canonicalDir))
|
||||||
|
subDirs.emplace_back(info.filePath(), canonicalDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (subDirs.empty()) {
|
||||||
const QStringList allFileEntries = dir.entryList(QDir::Files|QDir::Hidden);
|
const QStringList allFileEntries = dir.entryList(QDir::Files|QDir::Hidden);
|
||||||
const QStringList allFilePaths = Utils::transform(allFileEntries,
|
const QStringList allFilePaths = Utils::transform(allFileEntries,
|
||||||
[&dirPath](const QString &entry) {
|
[&dirPath](const QString &entry) {
|
||||||
@@ -696,14 +709,13 @@ void SubDirFileIterator::update(int index)
|
|||||||
m_dirs.push(dir);
|
m_dirs.push(dir);
|
||||||
m_progressValues.push(subProgress);
|
m_progressValues.push(subProgress);
|
||||||
m_processedValues.push(true);
|
m_processedValues.push(true);
|
||||||
QStringListIterator it(subDirs);
|
Utils::reverseForeach(subDirs,
|
||||||
it.toBack();
|
[this, subProgress](const std::pair<Dir, CanonicalDir> &dir) {
|
||||||
while (it.hasPrevious()) {
|
m_dirs.push(QDir(dir.first));
|
||||||
const QString &directory = it.previous();
|
m_knownDirs.insert(dir.second);
|
||||||
m_dirs.push(QDir(dirPath + QLatin1Char('/') + directory));
|
m_progressValues.push(subProgress);
|
||||||
m_progressValues.push(subProgress);
|
m_processedValues.push(false);
|
||||||
m_processedValues.push(false);
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_progress += dirProgressMax;
|
m_progress += dirProgressMax;
|
||||||
|
@@ -159,6 +159,7 @@ private:
|
|||||||
std::function<QStringList(const QStringList &)> m_filterFiles;
|
std::function<QStringList(const QStringList &)> m_filterFiles;
|
||||||
QTextCodec *m_encoding;
|
QTextCodec *m_encoding;
|
||||||
QStack<QDir> m_dirs;
|
QStack<QDir> m_dirs;
|
||||||
|
QSet<QString> m_knownDirs;
|
||||||
QStack<qreal> m_progressValues;
|
QStack<qreal> m_progressValues;
|
||||||
QStack<bool> m_processedValues;
|
QStack<bool> m_processedValues;
|
||||||
qreal m_progress;
|
qreal m_progress;
|
||||||
|
@@ -655,6 +655,7 @@ void ClangCodeCompletionTest::testCompleteProjectDependingCodeAfterChangingProje
|
|||||||
|
|
||||||
// Check completion with project configuration 2
|
// Check completion with project configuration 2
|
||||||
QVERIFY(projectLoader.updateProject({{"PROJECT_CONFIGURATION_2"}}));
|
QVERIFY(projectLoader.updateProject({{"PROJECT_CONFIGURATION_2"}}));
|
||||||
|
openEditor.waitUntilBackendIsNotified();
|
||||||
proposal = completionResults(openEditor.editor());
|
proposal = completionResults(openEditor.editor());
|
||||||
|
|
||||||
QVERIFY(!hasItem(proposal, "projectConfiguration1"));
|
QVERIFY(!hasItem(proposal, "projectConfiguration1"));
|
||||||
|
@@ -384,10 +384,13 @@ void GenericProject::parseProject(RefreshOptions options)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GenericProject::findCommonSourceRoot(const QStringList &list)
|
FilePath GenericProject::findCommonSourceRoot()
|
||||||
{
|
{
|
||||||
QString root = list.front();
|
if (m_files.isEmpty())
|
||||||
for (const QString &item : list) {
|
return FilePath::fromFileInfo(QFileInfo(m_filesFileName).absolutePath());
|
||||||
|
|
||||||
|
QString root = m_files.front();
|
||||||
|
for (const QString &item : m_files) {
|
||||||
if (root.length() > item.length())
|
if (root.length() > item.length())
|
||||||
root.truncate(item.length());
|
root.truncate(item.length());
|
||||||
|
|
||||||
@@ -398,7 +401,7 @@ QString GenericProject::findCommonSourceRoot(const QStringList &list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QFileInfo(root).absolutePath();
|
return FilePath::fromString(QFileInfo(root).absolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericProject::refresh(RefreshOptions options)
|
void GenericProject::refresh(RefreshOptions options)
|
||||||
@@ -410,7 +413,7 @@ void GenericProject::refresh(RefreshOptions options)
|
|||||||
auto newRoot = std::make_unique<GenericProjectNode>(this);
|
auto newRoot = std::make_unique<GenericProjectNode>(this);
|
||||||
|
|
||||||
// find the common base directory of all source files
|
// find the common base directory of all source files
|
||||||
Utils::FilePath baseDir = FilePath::fromFileInfo(QFileInfo(findCommonSourceRoot(m_files)));
|
Utils::FilePath baseDir = findCommonSourceRoot();
|
||||||
|
|
||||||
for (const QString &f : m_files) {
|
for (const QString &f : m_files) {
|
||||||
FileType fileType = FileType::Source; // ### FIXME
|
FileType fileType = FileType::Source; // ### FIXME
|
||||||
|
@@ -69,7 +69,7 @@ private:
|
|||||||
QStringList processEntries(const QStringList &paths,
|
QStringList processEntries(const QStringList &paths,
|
||||||
QHash<QString, QString> *map = nullptr) const;
|
QHash<QString, QString> *map = nullptr) const;
|
||||||
|
|
||||||
static QString findCommonSourceRoot(const QStringList &list);
|
Utils::FilePath findCommonSourceRoot();
|
||||||
void refreshCppCodeModel();
|
void refreshCppCodeModel();
|
||||||
void updateDeploymentData();
|
void updateDeploymentData();
|
||||||
void activeTargetWasChanged();
|
void activeTargetWasChanged();
|
||||||
|
@@ -45,6 +45,7 @@
|
|||||||
#include <texteditor/texteditor.h>
|
#include <texteditor/texteditor.h>
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <texteditor/textmark.h>
|
#include <texteditor/textmark.h>
|
||||||
|
#include <texteditor/ioutlinewidget.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
@@ -487,6 +488,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document,
|
|||||||
cursor.setPosition(position + charsRemoved);
|
cursor.setPosition(position + charsRemoved);
|
||||||
cursor.setPosition(position, QTextCursor::KeepAnchor);
|
cursor.setPosition(position, QTextCursor::KeepAnchor);
|
||||||
change.setRange(Range(cursor));
|
change.setRange(Range(cursor));
|
||||||
|
change.setRangeLength(cursor.selectionEnd() - cursor.selectionStart());
|
||||||
change.setText(document->textAt(position, charsAdded));
|
change.setText(document->textAt(position, charsAdded));
|
||||||
params.setContentChanges({change});
|
params.setContentChanges({change});
|
||||||
} else {
|
} else {
|
||||||
@@ -1175,8 +1177,10 @@ void Client::intializeCallback(const InitializeRequest::Response &initResponse)
|
|||||||
} else {
|
} else {
|
||||||
const InitializeResult &result = _result.value();
|
const InitializeResult &result = _result.value();
|
||||||
QStringList error;
|
QStringList error;
|
||||||
if (!result.isValid(&error)) // continue on ill formed result
|
if (!result.isValid(&error)) { // continue on ill formed result
|
||||||
|
std::reverse(error.begin(), error.end());
|
||||||
log(tr("Initialize result is not valid: ") + error.join("->"));
|
log(tr("Initialize result is not valid: ") + error.join("->"));
|
||||||
|
}
|
||||||
|
|
||||||
m_serverCapabilities = result.capabilities().value_or(ServerCapabilities());
|
m_serverCapabilities = result.capabilities().value_or(ServerCapabilities());
|
||||||
}
|
}
|
||||||
@@ -1193,6 +1197,10 @@ void Client::intializeCallback(const InitializeRequest::Response &initResponse)
|
|||||||
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor))
|
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor))
|
||||||
textEditor->editorWidget()->addHoverHandler(&m_hoverHandler);
|
textEditor->editorWidget()->addHoverHandler(&m_hoverHandler);
|
||||||
}
|
}
|
||||||
|
if (m_dynamicCapabilities.isRegistered(DocumentSymbolsRequest::methodName)
|
||||||
|
.value_or(capabilities().documentSymbolProvider().value_or(false))) {
|
||||||
|
TextEditor::IOutlineWidgetFactory::updateOutline();
|
||||||
|
}
|
||||||
emit initialized(m_serverCapabilities);
|
emit initialized(m_serverCapabilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -223,7 +223,10 @@ DeployConfiguration *DeployConfigurationFactory::restore(Target *parent, const Q
|
|||||||
if (!dc->fromMap(map)) {
|
if (!dc->fromMap(map)) {
|
||||||
delete dc;
|
delete dc;
|
||||||
dc = nullptr;
|
dc = nullptr;
|
||||||
|
} else if (factory->postRestore()) {
|
||||||
|
factory->postRestore()(dc, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dc;
|
return dc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -97,6 +97,10 @@ public:
|
|||||||
void setConfigWidgetCreator(const std::function<NamedWidget *(Target *)> &configWidgetCreator);
|
void setConfigWidgetCreator(const std::function<NamedWidget *(Target *)> &configWidgetCreator);
|
||||||
void setUseDeploymentDataView();
|
void setUseDeploymentDataView();
|
||||||
|
|
||||||
|
using PostRestore = std::function<void(DeployConfiguration *dc, const QVariantMap &)>;
|
||||||
|
void setPostRestore(const PostRestore &postRestore) { m_postRestore = postRestore; }
|
||||||
|
PostRestore postRestore() const { return m_postRestore; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using DeployConfigurationCreator = std::function<DeployConfiguration *(Target *)>;
|
using DeployConfigurationCreator = std::function<DeployConfiguration *(Target *)>;
|
||||||
void setConfigBaseId(Core::Id deployConfigBaseId);
|
void setConfigBaseId(Core::Id deployConfigBaseId);
|
||||||
@@ -109,6 +113,7 @@ private:
|
|||||||
QList<BuildStepList::StepCreationInfo> m_initialSteps;
|
QList<BuildStepList::StepCreationInfo> m_initialSteps;
|
||||||
QString m_defaultDisplayName;
|
QString m_defaultDisplayName;
|
||||||
std::function<NamedWidget *(Target *)> m_configWidgetCreator;
|
std::function<NamedWidget *(Target *)> m_configWidgetCreator;
|
||||||
|
PostRestore m_postRestore;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DefaultDeployConfigurationFactory : public DeployConfigurationFactory
|
class DefaultDeployConfigurationFactory : public DeployConfigurationFactory
|
||||||
|
@@ -55,7 +55,7 @@ class KitAspectWidget;
|
|||||||
class KitManager;
|
class KitManager;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class KitModel;
|
class KitManagerConfigWidget;
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -220,7 +220,7 @@ private:
|
|||||||
|
|
||||||
friend class ProjectExplorerPlugin; // for constructor
|
friend class ProjectExplorerPlugin; // for constructor
|
||||||
friend class Kit;
|
friend class Kit;
|
||||||
friend class Internal::KitModel;
|
friend class Internal::KitManagerConfigWidget;
|
||||||
friend class KitAspect; // for notifyAboutUpdate and self-registration
|
friend class KitAspect; // for notifyAboutUpdate and self-registration
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -172,6 +172,7 @@ void KitManagerConfigWidget::apply()
|
|||||||
const auto copyIntoKit = [this](Kit *k) { k->copyFrom(m_modifiedKit.get()); };
|
const auto copyIntoKit = [this](Kit *k) { k->copyFrom(m_modifiedKit.get()); };
|
||||||
if (m_kit) {
|
if (m_kit) {
|
||||||
copyIntoKit(m_kit);
|
copyIntoKit(m_kit);
|
||||||
|
KitManager::notifyAboutUpdate(m_kit);
|
||||||
} else {
|
} else {
|
||||||
m_isRegistering = true;
|
m_isRegistering = true;
|
||||||
m_kit = KitManager::registerKit(copyIntoKit);
|
m_kit = KitManager::registerKit(copyIntoKit);
|
||||||
|
@@ -3320,20 +3320,21 @@ void ProjectExplorerPluginPrivate::updateContextMenuActions()
|
|||||||
m_addExistingFilesAction->setEnabled(supports(AddExistingFile));
|
m_addExistingFilesAction->setEnabled(supports(AddExistingFile));
|
||||||
m_addExistingDirectoryAction->setEnabled(supports(AddExistingDirectory));
|
m_addExistingDirectoryAction->setEnabled(supports(AddExistingDirectory));
|
||||||
m_renameFileAction->setEnabled(supports(Rename));
|
m_renameFileAction->setEnabled(supports(Rename));
|
||||||
} else if (currentNode->asFileNode()) {
|
} else if (auto fileNode = currentNode->asFileNode()) {
|
||||||
// Enable and show remove / delete in magic ways:
|
// Enable and show remove / delete in magic ways:
|
||||||
// If both are disabled show Remove
|
// If both are disabled show Remove
|
||||||
// If both are enabled show both (can't happen atm)
|
// If both are enabled show both (can't happen atm)
|
||||||
// If only removeFile is enabled only show it
|
// If only removeFile is enabled only show it
|
||||||
// If only deleteFile is enable only show it
|
// If only deleteFile is enable only show it
|
||||||
bool enableRemove = supports(RemoveFile);
|
bool isTypeProject = fileNode->fileType() == FileType::Project;
|
||||||
|
bool enableRemove = !isTypeProject && supports(RemoveFile);
|
||||||
m_removeFileAction->setEnabled(enableRemove);
|
m_removeFileAction->setEnabled(enableRemove);
|
||||||
bool enableDelete = supports(EraseFile);
|
bool enableDelete = !isTypeProject && supports(EraseFile);
|
||||||
m_deleteFileAction->setEnabled(enableDelete);
|
m_deleteFileAction->setEnabled(enableDelete);
|
||||||
m_deleteFileAction->setVisible(enableDelete);
|
m_deleteFileAction->setVisible(enableDelete);
|
||||||
|
|
||||||
m_removeFileAction->setVisible(!enableDelete || enableRemove);
|
m_removeFileAction->setVisible(!enableDelete || enableRemove);
|
||||||
m_renameFileAction->setEnabled(supports(Rename));
|
m_renameFileAction->setEnabled(!isTypeProject && supports(Rename));
|
||||||
const bool currentNodeIsTextFile = isTextFile(
|
const bool currentNodeIsTextFile = isTextFile(
|
||||||
currentNode->filePath().toString());
|
currentNode->filePath().toString());
|
||||||
m_diffFileAction->setEnabled(DiffService::instance()
|
m_diffFileAction->setEnabled(DiffService::instance()
|
||||||
|
@@ -155,6 +155,18 @@ public:
|
|||||||
static QVariant process(const QVariant &entry);
|
static QVariant process(const QVariant &entry);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Version 21 adds a "make install" step to an existing RemoteLinux deploy configuration
|
||||||
|
// if and only if such a step would be added when creating a new one.
|
||||||
|
// See QTCREATORBUG-22689.
|
||||||
|
class UserFileVersion21Upgrader : public VersionUpgrader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
UserFileVersion21Upgrader() : VersionUpgrader(21, "4.10-pre1") { }
|
||||||
|
QVariantMap upgrade(const QVariantMap &map) final;
|
||||||
|
|
||||||
|
static QVariant process(const QVariant &entry);
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -315,6 +327,7 @@ UserFileAccessor::UserFileAccessor(Project *project) :
|
|||||||
addVersionUpgrader(std::make_unique<UserFileVersion18Upgrader>());
|
addVersionUpgrader(std::make_unique<UserFileVersion18Upgrader>());
|
||||||
addVersionUpgrader(std::make_unique<UserFileVersion19Upgrader>());
|
addVersionUpgrader(std::make_unique<UserFileVersion19Upgrader>());
|
||||||
addVersionUpgrader(std::make_unique<UserFileVersion20Upgrader>());
|
addVersionUpgrader(std::make_unique<UserFileVersion20Upgrader>());
|
||||||
|
addVersionUpgrader(std::make_unique<UserFileVersion21Upgrader>());
|
||||||
}
|
}
|
||||||
|
|
||||||
Project *UserFileAccessor::project() const
|
Project *UserFileAccessor::project() const
|
||||||
@@ -855,6 +868,33 @@ QVariant UserFileVersion20Upgrader::process(const QVariant &entry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariantMap UserFileVersion21Upgrader::upgrade(const QVariantMap &map)
|
||||||
|
{
|
||||||
|
return process(map).toMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant UserFileVersion21Upgrader::process(const QVariant &entry)
|
||||||
|
{
|
||||||
|
switch (entry.type()) {
|
||||||
|
case QVariant::List:
|
||||||
|
return Utils::transform(entry.toList(), &UserFileVersion21Upgrader::process);
|
||||||
|
case QVariant::Map: {
|
||||||
|
QVariantMap entryMap = entry.toMap();
|
||||||
|
if (entryMap.value("ProjectExplorer.ProjectConfiguration.Id").toString()
|
||||||
|
== "DeployToGenericLinux") {
|
||||||
|
entryMap.insert("_checkMakeInstall", true);
|
||||||
|
return entryMap;
|
||||||
|
}
|
||||||
|
return Utils::transform<QVariantMap>(
|
||||||
|
entryMap.toStdMap(), [](const std::pair<const QString, QVariant> &item) {
|
||||||
|
return qMakePair(item.first, UserFileVersion21Upgrader::process(item.second));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(WITH_TESTS)
|
#if defined(WITH_TESTS)
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
@@ -218,17 +218,8 @@ static bool supportsNodeAction(ProjectAction action, const Node *node)
|
|||||||
const QbsProject * const project = parentQbsProjectNode(node)->project();
|
const QbsProject * const project = parentQbsProjectNode(node)->project();
|
||||||
if (!project->isProjectEditable())
|
if (!project->isProjectEditable())
|
||||||
return false;
|
return false;
|
||||||
|
if (action == RemoveFile || action == Rename)
|
||||||
auto equalsNodeFilePath = [node](const QString &str)
|
return node->asFileNode();
|
||||||
{
|
|
||||||
return str == node->filePath().toString();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (action == RemoveFile || action == Rename) {
|
|
||||||
if (node->asFileNode())
|
|
||||||
return !Utils::contains(project->qbsProject().buildSystemFiles(), equalsNodeFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -67,7 +67,7 @@ Utils::FilePath UicGenerator::command() const
|
|||||||
|
|
||||||
QStringList UicGenerator::arguments() const
|
QStringList UicGenerator::arguments() const
|
||||||
{
|
{
|
||||||
return {"-p", source().toString()};
|
return {"-p"};
|
||||||
}
|
}
|
||||||
|
|
||||||
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
||||||
@@ -87,6 +87,12 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UicGenerator::handleProcessStarted(QProcess *process, const QByteArray &sourceContents)
|
||||||
|
{
|
||||||
|
process->write(sourceContents);
|
||||||
|
process->closeWriteChannel();
|
||||||
|
}
|
||||||
|
|
||||||
FileType UicGeneratorFactory::sourceType() const
|
FileType UicGeneratorFactory::sourceType() const
|
||||||
{
|
{
|
||||||
return FileType::Form;
|
return FileType::Form;
|
||||||
|
@@ -43,6 +43,7 @@ protected:
|
|||||||
Utils::FilePath command() const override;
|
Utils::FilePath command() const override;
|
||||||
QStringList arguments() const override;
|
QStringList arguments() const override;
|
||||||
ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override;
|
ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override;
|
||||||
|
void handleProcessStarted(QProcess *process, const QByteArray &sourceContents) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory
|
class UicGeneratorFactory : public ProjectExplorer::ExtraCompilerFactory
|
||||||
|
@@ -61,11 +61,19 @@ RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory()
|
|||||||
"Deploy to Remote Linux Host"));
|
"Deploy to Remote Linux Host"));
|
||||||
setUseDeploymentDataView();
|
setUseDeploymentDataView();
|
||||||
|
|
||||||
addInitialStep(MakeInstallStep::stepId(), [](Target *target) {
|
const auto needsMakeInstall = [](Target *target)
|
||||||
|
{
|
||||||
const Project * const prj = target->project();
|
const Project * const prj = target->project();
|
||||||
return prj->deploymentKnowledge() == DeploymentKnowledge::Bad
|
return prj->deploymentKnowledge() == DeploymentKnowledge::Bad
|
||||||
&& prj->hasMakeInstallEquivalent();
|
&& prj->hasMakeInstallEquivalent();
|
||||||
|
};
|
||||||
|
setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) {
|
||||||
|
// 4.9 -> 4.10. See QTCREATORBUG-22689.
|
||||||
|
if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target()))
|
||||||
|
dc->stepList()->insertStep(0, new MakeInstallStep(dc->stepList()));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addInitialStep(MakeInstallStep::stepId(), needsMakeInstall);
|
||||||
addInitialStep(RemoteLinuxCheckForFreeDiskSpaceStep::stepId());
|
addInitialStep(RemoteLinuxCheckForFreeDiskSpaceStep::stepId());
|
||||||
addInitialStep(RemoteLinuxKillAppStep::stepId());
|
addInitialStep(RemoteLinuxKillAppStep::stepId());
|
||||||
addInitialStep(RsyncDeployStep::stepId(), [](Target *target) {
|
addInitialStep(RsyncDeployStep::stepId(), [](Target *target) {
|
||||||
|
@@ -56,6 +56,8 @@ public:
|
|||||||
|
|
||||||
virtual bool supportsEditor(Core::IEditor *editor) const = 0;
|
virtual bool supportsEditor(Core::IEditor *editor) const = 0;
|
||||||
virtual IOutlineWidget *createWidget(Core::IEditor *editor) = 0;
|
virtual IOutlineWidget *createWidget(Core::IEditor *editor) = 0;
|
||||||
|
|
||||||
|
static void updateOutline();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace TextEditor
|
} // namespace TextEditor
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
|
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
|
|
||||||
static QList<IOutlineWidgetFactory *> g_outlineWidgetFactories;
|
static QList<IOutlineWidgetFactory *> g_outlineWidgetFactories;
|
||||||
|
static QPointer<Internal::OutlineFactory> g_outlineFactory;
|
||||||
|
|
||||||
IOutlineWidgetFactory::IOutlineWidgetFactory()
|
IOutlineWidgetFactory::IOutlineWidgetFactory()
|
||||||
{
|
{
|
||||||
@@ -51,6 +53,12 @@ IOutlineWidgetFactory::~IOutlineWidgetFactory()
|
|||||||
g_outlineWidgetFactories.removeOne(this);
|
g_outlineWidgetFactories.removeOne(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IOutlineWidgetFactory::updateOutline()
|
||||||
|
{
|
||||||
|
if (QTC_GUARD(!g_outlineFactory.isNull()))
|
||||||
|
emit g_outlineFactory->updateOutline();
|
||||||
|
}
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
|
OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
|
||||||
@@ -88,8 +96,10 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
|
|||||||
m_filterButton->setMenu(m_filterMenu);
|
m_filterButton->setMenu(m_filterMenu);
|
||||||
|
|
||||||
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||||
|
this, &OutlineWidgetStack::updateEditor);
|
||||||
|
connect(factory, &OutlineFactory::updateOutline,
|
||||||
this, &OutlineWidgetStack::updateCurrentEditor);
|
this, &OutlineWidgetStack::updateCurrentEditor);
|
||||||
updateCurrentEditor(Core::EditorManager::currentEditor());
|
updateCurrentEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
OutlineWidgetStack::~OutlineWidgetStack() = default;
|
OutlineWidgetStack::~OutlineWidgetStack() = default;
|
||||||
@@ -159,7 +169,12 @@ void OutlineWidgetStack::updateFilterMenu()
|
|||||||
m_filterButton->setVisible(!m_filterMenu->actions().isEmpty());
|
m_filterButton->setVisible(!m_filterMenu->actions().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutlineWidgetStack::updateCurrentEditor(Core::IEditor *editor)
|
void OutlineWidgetStack::updateCurrentEditor()
|
||||||
|
{
|
||||||
|
updateEditor(Core::EditorManager::currentEditor());
|
||||||
|
}
|
||||||
|
|
||||||
|
void OutlineWidgetStack::updateEditor(Core::IEditor *editor)
|
||||||
{
|
{
|
||||||
IOutlineWidget *newWidget = nullptr;
|
IOutlineWidget *newWidget = nullptr;
|
||||||
|
|
||||||
@@ -195,6 +210,8 @@ void OutlineWidgetStack::updateCurrentEditor(Core::IEditor *editor)
|
|||||||
|
|
||||||
OutlineFactory::OutlineFactory()
|
OutlineFactory::OutlineFactory()
|
||||||
{
|
{
|
||||||
|
QTC_CHECK(g_outlineFactory.isNull());
|
||||||
|
g_outlineFactory = this;
|
||||||
setDisplayName(tr("Outline"));
|
setDisplayName(tr("Outline"));
|
||||||
setId("Outline");
|
setId("Outline");
|
||||||
setPriority(600);
|
setPriority(600);
|
||||||
|
@@ -55,7 +55,8 @@ private:
|
|||||||
QWidget *dummyWidget() const;
|
QWidget *dummyWidget() const;
|
||||||
void updateFilterMenu();
|
void updateFilterMenu();
|
||||||
void toggleCursorSynchronization();
|
void toggleCursorSynchronization();
|
||||||
void updateCurrentEditor(Core::IEditor *editor);
|
void updateEditor(Core::IEditor *editor);
|
||||||
|
void updateCurrentEditor();
|
||||||
|
|
||||||
QStackedWidget *m_widgetStack;
|
QStackedWidget *m_widgetStack;
|
||||||
OutlineFactory *m_factory;
|
OutlineFactory *m_factory;
|
||||||
@@ -76,6 +77,9 @@ public:
|
|||||||
Core::NavigationView createWidget() override;
|
Core::NavigationView createWidget() override;
|
||||||
void saveSettings(QSettings *settings, int position, QWidget *widget) override;
|
void saveSettings(QSettings *settings, int position, QWidget *widget) override;
|
||||||
void restoreSettings(QSettings *settings, int position, QWidget *widget) override;
|
void restoreSettings(QSettings *settings, int position, QWidget *widget) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void updateOutline();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -5344,11 +5344,11 @@ void tst_Dumpers::dumper_data()
|
|||||||
+ CheckType("t", "char [5]") % CdbEngine
|
+ CheckType("t", "char [5]") % CdbEngine
|
||||||
+ Check("t.0", "[0]", "97", "char")
|
+ Check("t.0", "[0]", "97", "char")
|
||||||
+ CheckType("w", "wchar_t [4]")
|
+ CheckType("w", "wchar_t [4]")
|
||||||
+ Check("ch.0", "[0]", "97", "CHAR")
|
+ Check("ch.0", "[0]", "97", TypeDef("char", "CHAR"))
|
||||||
+ CheckType("ch", "CHAR [5]") % NoCdbEngine
|
+ CheckType("ch", "CHAR [5]") % NoCdbEngine
|
||||||
+ CheckType("ch", "CHAR [4]") % CdbEngine
|
+ CheckType("ch", "char [4]") % CdbEngine
|
||||||
+ Check("wch.0", "[0]", "97", "WCHAR")
|
+ Check("wch.0", "[0]", "97", TypeDef("wchar_t", "WCHAR"))
|
||||||
+ CheckType("wch", "WCHAR [4]");
|
+ CheckType("wch", TypeDef("wchar_t[4]", "WCHAR [4]"));
|
||||||
|
|
||||||
|
|
||||||
QTest::newRow("CharPointers")
|
QTest::newRow("CharPointers")
|
||||||
|
Reference in New Issue
Block a user