Merge remote-tracking branch 'origin/4.7'

Change-Id: I3c5d7e9e8c589ad4425cd89d61e1f572f5cb7997
This commit is contained in:
Eike Ziller
2018-06-19 10:03:28 +02:00
110 changed files with 913 additions and 260 deletions

View File

@@ -71,7 +71,7 @@
\image qtcreator-files-to-analyze.png
\li In the \uicontrol {Diagnostic Configuration} group, select
\uicontrol Custom, and then select \uicontrol Manage to
\uicontrol {Custom Settings}, and then select \uicontrol Manage to
specify the Clang-Tidy and Clazy checks to perform.
\li Select the new custom configuration in the list of configurations

View File

@@ -1,4 +1,6 @@
%{Cpp:LicenseTemplate}\
#pragma once
#include <gtest/gtest.h>
#include <gmock/gmock-matchers.h>

View File

@@ -36,7 +36,7 @@
namespace ClangBackEnd {
template <typename FilePathStorage>
class FilePathCache
class CLANGSUPPORT_GCCEXPORT FilePathCache
{
class FileNameView
{

View File

@@ -33,7 +33,7 @@ QDebug operator<<(QDebug debug, const FollowSymbolResult &result)
{
debug.nospace() << "FollowSymbolResult("
<< result.range
<< ", " << result.isPureDeclarationForUsage;
<< ", " << result.isResultOnlyForFallBack;
debug.nospace() << ")";

View File

@@ -40,15 +40,15 @@ public:
FollowSymbolResult(SourceRangeContainer range)
: range(std::move(range))
{}
FollowSymbolResult(SourceRangeContainer range, bool isPureDeclarationForUsage)
FollowSymbolResult(SourceRangeContainer range, bool isResultOnlyForFallBack)
: range(std::move(range))
, isPureDeclarationForUsage(isPureDeclarationForUsage)
, isResultOnlyForFallBack(isResultOnlyForFallBack)
{}
friend QDataStream &operator<<(QDataStream &out, const FollowSymbolResult &container)
{
out << container.range;
out << container.isPureDeclarationForUsage;
out << container.isResultOnlyForFallBack;
return out;
}
@@ -56,7 +56,7 @@ public:
friend QDataStream &operator>>(QDataStream &in, FollowSymbolResult &container)
{
in >> container.range;
in >> container.isPureDeclarationForUsage;
in >> container.isResultOnlyForFallBack;
return in;
}
@@ -64,11 +64,11 @@ public:
friend bool operator==(const FollowSymbolResult &first, const FollowSymbolResult &second)
{
return first.range == second.range
&& first.isPureDeclarationForUsage == second.isPureDeclarationForUsage;
&& first.isResultOnlyForFallBack == second.isResultOnlyForFallBack;
}
SourceRangeContainer range;
bool isPureDeclarationForUsage = false;
bool isResultOnlyForFallBack = false;
};
class FollowSymbolMessage

View File

@@ -248,12 +248,13 @@ public:
{}
virtual void pragmaLibrary(int line, int column) override
void pragmaLibrary(int line, int column) override
{
isLibrary = true;
addLocation(line, column);
}
virtual void importFile(const QString &jsfile, const QString &module,
void importFile(const QString &jsfile, const QString &module,
int line, int column) override
{
imports += ImportInfo::pathImport(
@@ -261,7 +262,7 @@ public:
addLocation(line, column);
}
virtual void importModule(const QString &uri, const QString &version, const QString &module,
void importModule(const QString &uri, const QString &version, const QString &module,
int line, int column) override
{
imports += ImportInfo::moduleImport(uri, LanguageUtils::ComponentVersion(version), module);

View File

@@ -30,6 +30,8 @@ namespace FlameGraph {
FlameGraph::FlameGraph(QQuickItem *parent) :
QQuickItem(parent)
{
setAcceptedMouseButtons(Qt::LeftButton);
// Queue the rebuild in this case so that a delegate can set the root without getting deleted
// during the call.
connect(this, &FlameGraph::rootChanged, this, &FlameGraph::rebuild, Qt::QueuedConnection);
@@ -130,7 +132,6 @@ QObject *FlameGraph::appendChild(QObject *parentObject, QQuickItem *parentItem,
return childObject;
}
int FlameGraph::buildNode(const QModelIndex &parentIndex, QObject *parentObject, int depth,
int maximumDepth)
{
@@ -194,4 +195,22 @@ void FlameGraph::rebuild()
emit depthChanged(m_depth);
}
void FlameGraph::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event);
}
void FlameGraph::mouseReleaseEvent(QMouseEvent *event)
{
Q_UNUSED(event);
setSelectedTypeId(-1);
}
void FlameGraph::mouseDoubleClickEvent(QMouseEvent *event)
{
Q_UNUSED(event);
setSelectedTypeId(-1);
resetRoot();
}
} // namespace FlameGraph

View File

@@ -45,6 +45,8 @@ class TRACING_EXPORT FlameGraph : public QQuickItem
NOTIFY maximumDepthChanged)
Q_PROPERTY(int depth READ depth NOTIFY depthChanged)
Q_PROPERTY(QPersistentModelIndex root READ root WRITE setRoot NOTIFY rootChanged)
Q_PROPERTY(int selectedTypeId READ selectedTypeId WRITE setSelectedTypeId
NOTIFY selectedTypeIdChanged)
public:
FlameGraph(QQuickItem *parent = nullptr);
@@ -101,6 +103,20 @@ public:
static FlameGraphAttached *qmlAttachedProperties(QObject *object);
int selectedTypeId() const
{
return m_selectedTypeId;
}
void setSelectedTypeId(int selectedTypeId)
{
if (m_selectedTypeId == selectedTypeId)
return;
m_selectedTypeId = selectedTypeId;
emit selectedTypeIdChanged(m_selectedTypeId);
}
signals:
void delegateChanged(QQmlComponent *delegate);
void modelChanged(QAbstractItemModel *model);
@@ -109,6 +125,7 @@ signals:
void depthChanged(int depth);
void maximumDepthChanged();
void rootChanged(const QPersistentModelIndex &root);
void selectedTypeIdChanged(int selectedTypeId);
private:
void rebuild();
@@ -120,11 +137,16 @@ private:
int m_depth = 0;
qreal m_sizeThreshold = 0;
int m_maximumDepth = std::numeric_limits<int>::max();
int m_selectedTypeId = -1;
int buildNode(const QModelIndex &parentIndex, QObject *parentObject, int depth,
int maximumDepth);
QObject *appendChild(QObject *parentObject, QQuickItem *parentItem, QQmlContext *context,
const QModelIndex &childIndex, qreal position, qreal size);
void mousePressEvent(QMouseEvent *event) final;
void mouseReleaseEvent(QMouseEvent *event) final;
void mouseDoubleClickEvent(QMouseEvent *event) final;
};
} // namespace FlameGraph

View File

@@ -32,7 +32,16 @@ import QtQuick.Controls 1.3
ScrollView {
id: root
property int selectedTypeId: -1
signal typeSelected(int typeId)
onSelectedTypeIdChanged: {
// selectedTypeId can be set from outside. Don't send typeSelected() from here.
tooltip.hoveredNode = null;
flamegraph.selectedTypeId = selectedTypeId;
}
property int sizeRole: -1
property var model: null
@@ -117,25 +126,6 @@ ScrollView {
}
}
onSelectedTypeIdChanged: tooltip.hoveredNode = null
MouseArea {
anchors.fill: parent
onClicked: {
selectedTypeId = -1;
tooltip.selectedNode = null;
if (model !== null)
model.typeSelected(-1);
}
onDoubleClicked: {
selectedTypeId = -1;
tooltip.selectedNode = null;
if (model !== null)
model.typeSelected(-1);
flamegraph.resetRoot();
}
}
Flickable {
id: flickable
contentHeight: flamegraph.height
@@ -158,6 +148,14 @@ ScrollView {
maximumDepth: 128
y: flickable.height > height ? flickable.height - height : 0
onSelectedTypeIdChanged: {
if (selectedTypeId !== root.selectedTypeId) {
// Change originates from inside. Send typeSelected().
root.selectedTypeId = selectedTypeId;
root.typeSelected(selectedTypeId);
}
}
delegate: FlameGraphDelegate {
id: flamegraphItem
@@ -165,7 +163,7 @@ ScrollView {
property bool isHighlighted: root.isHighlighted(flamegraphItem)
itemHeight: flamegraph.delegateHeight
isSelected: typeId !== -1 && typeId === root.selectedTypeId
isSelected: typeId !== -1 && typeId === flamegraph.selectedTypeId
borderColor: {
if (isSelected)
@@ -189,7 +187,7 @@ ScrollView {
onIsSelectedChanged: {
if (isSelected && (tooltip.selectedNode === null ||
tooltip.selectedNode.typeId !== root.selectedTypeId)) {
tooltip.selectedNode.typeId !== flamegraph.selectedTypeId)) {
tooltip.selectedNode = flamegraphItem;
} else if (!isSelected && tooltip.selectedNode === flamegraphItem) {
tooltip.selectedNode = null;
@@ -222,7 +220,7 @@ ScrollView {
if (tooltip.hoveredNode === flamegraphItem) {
// Keep the window around until something else is hovered or selected.
if (tooltip.selectedNode === null
|| tooltip.selectedNode.typeId !== root.selectedTypeId) {
|| tooltip.selectedNode.typeId !== flamegraph.selectedTypeId) {
tooltip.selectedNode = flamegraphItem;
}
tooltip.hoveredNode = null;
@@ -232,8 +230,7 @@ ScrollView {
function selectClicked() {
if (FlameGraph.dataValid) {
tooltip.selectedNode = flamegraphItem;
selectedTypeId = FlameGraph.data(root.typeIdRole);
model.typeSelected(selectedTypeId);
flamegraph.selectedTypeId = FlameGraph.data(root.typeIdRole);
model.gotoSourceLocation(
FlameGraph.data(root.sourceFileRole),
FlameGraph.data(root.sourceLineRole),
@@ -246,6 +243,7 @@ ScrollView {
tooltip.selectedNode = null;
tooltip.hoveredNode = null;
flamegraph.root = FlameGraph.modelIndex;
selectClicked();
}
// Functions, not properties to limit the initial overhead when creating the nodes,
@@ -288,9 +286,8 @@ ScrollView {
}
onClearSelection: {
selectedTypeId = -1;
flamegraph.selectedTypeId = -1;
selectedNode = null;
root.model.typeSelected(-1);
}
dialogTitle: {

View File

@@ -36,6 +36,7 @@
#include <QKeyEvent>
#include <QListView>
#include <QPainter>
#include <QWindow>
namespace Utils {
namespace Internal {
@@ -62,19 +63,35 @@ public:
class HistoryLineDelegate : public QItemDelegate
{
public:
HistoryLineDelegate(QObject *parent)
HistoryLineDelegate(QAbstractItemView *parent)
: QItemDelegate(parent)
, pixmap(Icons::EDIT_CLEAR.pixmap())
, view(parent)
, icon(Icons::EDIT_CLEAR.icon())
{}
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
// from QHistoryCompleter
QStyleOptionViewItem optCopy = option;
optCopy.showDecorationSelected = true;
if (view->currentIndex() == index)
optCopy.state |= QStyle::State_HasFocus;
QItemDelegate::paint(painter,option,index);
QRect r = QStyle::alignedRect(option.direction, Qt::AlignRight | Qt::AlignVCenter , pixmap.size(), option.rect);
painter->drawPixmap(r, pixmap);
// add remove button
QWindow *window = view->window()->windowHandle();
const QPixmap iconPixmap = icon.pixmap(window, option.rect.size());
QRect pixmapRect = QStyle::alignedRect(option.direction,
Qt::AlignRight | Qt::AlignVCenter,
iconPixmap.size() / window->devicePixelRatio(),
option.rect);
if (!clearIconSize.isValid())
clearIconSize = pixmapRect.size();
painter->drawPixmap(pixmapRect, iconPixmap);
}
QPixmap pixmap;
QAbstractItemView *view;
QIcon icon;
mutable QSize clearIconSize;
};
class HistoryLineView : public QListView
@@ -83,26 +100,32 @@ public:
HistoryLineView(HistoryCompleterPrivate *model_)
: model(model_)
{
HistoryLineDelegate *delegate = new HistoryLineDelegate(this);
pixmapWidth = delegate->pixmap.width();
}
void installDelegate()
{
delegate = new HistoryLineDelegate(this);
setItemDelegate(delegate);
}
private:
void mousePressEvent(QMouseEvent *event)
{
int rr= event->x();
const QSize clearButtonSize = delegate->clearIconSize;
if (clearButtonSize.isValid()) {
int rr = event->x();
if (layoutDirection() == Qt::LeftToRight)
rr = viewport()->width() - event->x();
if (rr < pixmapWidth) {
if (rr < clearButtonSize.width()) {
model->removeRow(indexAt(event->pos()).row());
return;
}
}
QListView::mousePressEvent(event);
}
HistoryCompleterPrivate *model;
int pixmapWidth;
HistoryLineDelegate *delegate;
};
} // namespace Internal
@@ -178,7 +201,11 @@ HistoryCompleter::HistoryCompleter(const QString &historyKey, QObject *parent)
d->isLastItemEmpty = theSettings->value(d->historyKeyIsLastItemEmpty, false).toBool();
setModel(d);
setPopup(new HistoryLineView(d));
auto popup = new HistoryLineView(d);
setPopup(popup);
// setPopup unconditionally sets a delegate on the popup,
// so we need to set our delegate afterwards
popup->installDelegate();
}
bool HistoryCompleter::removeHistoryItem(int index)

View File

@@ -75,7 +75,6 @@ JavaEditorFactory::JavaEditorFactory()
setUseGenericHighlighter(true);
setCommentDefinition(Utils::CommentDefinition::CppStyle);
setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection);
setMarksVisible(true);
setCompletionAssistProvider(new TextEditor::KeywordsCompletionAssistProvider(keywords));
}

View File

@@ -33,7 +33,7 @@ namespace Internal {
class GTestResult : public TestResult
{
public:
GTestResult(const QString &projectFile, const QString &name = QString());
explicit GTestResult(const QString &projectFile, const QString &name = QString());
GTestResult(const QString &id, const QString &projectFile, const QString &name);
const QString outputString(bool selected) const override;

View File

@@ -91,8 +91,7 @@ GTestSettings GTestSettingsWidget::settings() const
GTestSettingsPage::GTestSettingsPage(QSharedPointer<IFrameworkSettings> settings,
const ITestFramework *framework)
: ITestSettingsPage(framework),
m_settings(qSharedPointerCast<GTestSettings>(settings)),
m_widget(0)
m_settings(qSharedPointerCast<GTestSettings>(settings))
{
setDisplayName(QCoreApplication::translate("GTestFramework",
GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));

View File

@@ -41,7 +41,7 @@ class GTestSettingsWidget : public QWidget
{
Q_OBJECT
public:
explicit GTestSettingsWidget(QWidget *parent = 0);
explicit GTestSettingsWidget(QWidget *parent = nullptr);
void setSettings(const GTestSettings &settings);
GTestSettings settings() const;

View File

@@ -47,11 +47,11 @@ public:
virtual const char *name() const = 0;
virtual unsigned priority() const = 0; // should this be modifyable?
virtual bool hasFrameworkSettings() const { return false; }
virtual IFrameworkSettings *createFrameworkSettings() const { return 0; }
virtual IFrameworkSettings *createFrameworkSettings() const { return nullptr; }
virtual ITestSettingsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
{
Q_UNUSED(settings);
return 0;
return nullptr;
}
TestTreeItem *rootNode()
@@ -78,8 +78,8 @@ protected:
virtual TestTreeItem *createRootNode() const = 0;
private:
TestTreeItem *m_rootNode = 0;
ITestParser *m_testParser = 0;
TestTreeItem *m_rootNode = nullptr;
ITestParser *m_testParser = nullptr;
bool m_active = false;
bool m_grouping = false;
};

View File

@@ -97,8 +97,9 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted,
// handle Quick options as well
static const QSet<QString> knownInterferingQuickOption = { "-qtquick1" };
static const QSet<QString> knownAllowedQuickOptionsWithParameter {
"-import", "-plugins", "-input"
"-import", "-plugins", "-input", "-translation"
};
static const QSet<QString> knownAllowedSingleQuickOptions = { "-opengl", "-widgets" };
QStringList allowed;
auto it = provided.cbegin();
@@ -126,6 +127,8 @@ QStringList filterInterfering(const QStringList &provided, QStringList *omitted,
++it;
QTC_ASSERT(it != end, return QStringList());
allowed.append(*it);
} else if (knownAllowedSingleQuickOptions.contains(currentOpt)) {
allowed.append(currentOpt);
} else if (knownInterferingQuickOption.contains(currentOpt)) {
if (omitted)
omitted->append(currentOpt);

View File

@@ -95,8 +95,7 @@ QtTestSettings QtTestSettingsWidget::settings() const
QtTestSettingsPage::QtTestSettingsPage(QSharedPointer<IFrameworkSettings> settings,
const ITestFramework *framework)
: ITestSettingsPage(framework),
m_settings(qSharedPointerCast<QtTestSettings>(settings)),
m_widget(0)
m_settings(qSharedPointerCast<QtTestSettings>(settings))
{
setDisplayName(QCoreApplication::translate("QtTestFramework",
QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));

View File

@@ -35,7 +35,8 @@ namespace Autotest {
namespace Internal {
namespace QuickTestUtils {
static const QByteArrayList valid = {"QUICK_TEST_MAIN", "QUICK_TEST_OPENGL_MAIN"};
static const QByteArrayList valid = {"QUICK_TEST_MAIN", "QUICK_TEST_OPENGL_MAIN",
"QUICK_TEST_MAIN_WITH_SETUP"};
bool isQuickTestMacro(const QByteArray &macro)
{

View File

@@ -56,7 +56,7 @@ public:
Shutdown
};
explicit TestCodeParser(TestTreeModel *parent = 0);
explicit TestCodeParser(TestTreeModel *parent = nullptr);
virtual ~TestCodeParser();
void setState(State state);
State state() const { return m_parserState; }

View File

@@ -59,8 +59,8 @@ TestConfiguration::~TestConfiguration()
static bool isLocal(RunConfiguration *runConfiguration)
{
Target *target = runConfiguration ? runConfiguration->target() : 0;
Kit *kit = target ? target->kit() : 0;
Target *target = runConfiguration ? runConfiguration->target() : nullptr;
Kit *kit = target ? target->kit() : nullptr;
return DeviceTypeKitInformation::deviceTypeId(kit) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
}

View File

@@ -37,7 +37,7 @@ class TestResultDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit TestResultDelegate(QObject *parent = 0);
explicit TestResultDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;

View File

@@ -266,7 +266,7 @@ const TestResult *TestResultModel::testResult(const QModelIndex &idx)
if (idx.isValid())
return static_cast<TestResultItem *>(itemForIndex(idx))->testResult();
return 0;
return nullptr;
}
void TestResultModel::recalculateMaxWidthOfFileName(const QFont &font)

View File

@@ -57,7 +57,7 @@ private:
class TestResultModel : public Utils::TreeModel<>
{
public:
explicit TestResultModel(QObject *parent = 0);
explicit TestResultModel(QObject *parent = nullptr);
void addTestResult(const TestResultPtr &testResult, bool autoExpand = false);
void removeCurrentTestMessage();
@@ -75,7 +75,7 @@ private:
void recalculateMaxWidthOfFileName(const QFont &font);
void addFileName(const QString &fileName);
TestResultItem *findParentItemFor(const TestResultItem *item,
const TestResultItem *startItem = 0) const;
const TestResultItem *startItem = nullptr) const;
void updateParent(const TestResultItem *item);
QMap<Result::Type, int> m_testResultCount;
int m_widthOfLineNumber = 0;
@@ -89,7 +89,7 @@ class TestResultFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit TestResultFilterModel(TestResultModel *sourceModel, QObject *parent = 0);
explicit TestResultFilterModel(TestResultModel *sourceModel, QObject *parent = nullptr);
void enableAllResultTypes();
void toggleTestResultType(Result::Type type);

View File

@@ -59,7 +59,7 @@ class ResultsTreeView : public Utils::TreeView
{
Q_OBJECT
public:
explicit ResultsTreeView(QWidget *parent = 0);
explicit ResultsTreeView(QWidget *parent = nullptr);
signals:
void copyShortcutTriggered();
@@ -96,7 +96,7 @@ public:
void showTestResult(const QModelIndex &index);
private:
explicit TestResultsPane(QObject *parent = 0);
explicit TestResultsPane(QObject *parent = nullptr);
void onItemActivated(const QModelIndex &index);
void onRunAllTriggered();

View File

@@ -73,8 +73,8 @@ public:
}
private:
QWidget *createConfigurationWidget() override { return 0; }
TestConfiguration *m_testConfig = 0;
QWidget *createConfigurationWidget() override { return nullptr; }
TestConfiguration *m_testConfig = nullptr;
};
} // namespace Internal

View File

@@ -249,12 +249,10 @@ void TestRunner::onProcessFinished()
resetInternalPointers();
if (!m_selectedTests.isEmpty() && !m_fakeFutureInterface->isCanceled()) {
if (!m_selectedTests.isEmpty() && !m_fakeFutureInterface->isCanceled())
scheduleNext();
} else {
else
m_fakeFutureInterface->reportFinished();
onFinished();
}
}
void TestRunner::resetInternalPointers()
@@ -516,7 +514,7 @@ void TestRunner::debugTests()
m_futureWatcher.setFuture(futureInterface->future());
if (useOutputProcessor) {
TestOutputReader *outputreader = config->outputReader(*futureInterface, 0);
TestOutputReader *outputreader = config->outputReader(*futureInterface, nullptr);
outputreader->setId(inferior.executable);
connect(outputreader, &TestOutputReader::newOutputAvailable,
TestResultsPane::instance(), &TestResultsPane::addOutput);

View File

@@ -85,7 +85,7 @@ private:
void runTests();
void debugTests();
void runOrDebugTests();
explicit TestRunner(QObject *parent = 0);
explicit TestRunner(QObject *parent = nullptr);
QFutureWatcher<TestResultPtr> m_futureWatcher;
QFutureInterface<TestResultPtr> *m_fakeFutureInterface = nullptr;

View File

@@ -45,7 +45,7 @@ namespace Internal {
class TestFilterDialog : public QDialog
{
public:
explicit TestFilterDialog(QWidget *parent = 0, Qt::WindowFlags f = 0);
explicit TestFilterDialog(QWidget *parent = nullptr, Qt::WindowFlags f = 0);
QString filterPath() const;
void setDetailsText(const QString &details) { m_details->setText(details); }
void setDefaultFilterPath(const QString &defaultPath);
@@ -276,7 +276,7 @@ void TestSettingsWidget::onRemoveFilterClicked()
}
TestSettingsPage::TestSettingsPage(const QSharedPointer<TestSettings> &settings)
: m_settings(settings), m_widget(0)
: m_settings(settings)
{
setId("A.AutoTest.0.General");
setDisplayName(tr("General"));

View File

@@ -40,7 +40,7 @@ class TestSettingsWidget : public QWidget
{
Q_OBJECT
public:
explicit TestSettingsWidget(QWidget *parent = 0);
explicit TestSettingsWidget(QWidget *parent = nullptr);
void setSettings(const TestSettings &settings);
TestSettings settings() const;

View File

@@ -109,8 +109,8 @@ public:
virtual bool canProvideTestConfiguration() const { return false; }
virtual bool canProvideDebugConfiguration() const { return false; }
virtual TestConfiguration *testConfiguration() const { return 0; }
virtual TestConfiguration *debugConfiguration() const { return 0; }
virtual TestConfiguration *testConfiguration() const { return nullptr; }
virtual TestConfiguration *debugConfiguration() const { return nullptr; }
TestConfiguration *asConfiguration(TestRunMode mode) const;
virtual QList<TestConfiguration *> getAllTestConfigurations() const;
virtual QList<TestConfiguration *> getSelectedTestConfigurations() const;

View File

@@ -34,7 +34,7 @@ class TestTreeItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit TestTreeItemDelegate(QObject *parent = 0);
explicit TestTreeItemDelegate(QObject *parent = nullptr);
~TestTreeItemDelegate();
public:

View File

@@ -92,7 +92,7 @@ private:
bool sweepChildren(TestTreeItem *item);
void insertItemInParent(TestTreeItem *item, TestTreeItem *root, bool groupingEnabled);
void revalidateCheckState(TestTreeItem *item);
explicit TestTreeModel(QObject *parent = 0);
explicit TestTreeModel(QObject *parent = nullptr);
void setupParsingConnections();
void filterAndInsert(TestTreeItem *item, TestTreeItem *root, bool groupingEnabled);
QList<TestTreeItem *> testItemsByName(TestTreeItem *root, const QString &testName);
@@ -111,7 +111,7 @@ public:
ShowAll = ShowInitAndCleanup | ShowTestData
};
explicit TestTreeSortFilterModel(TestTreeModel *sourceModel, QObject *parent = 0);
explicit TestTreeSortFilterModel(TestTreeModel *sourceModel, QObject *parent = nullptr);
void setSortMode(TestTreeItem::SortMode sortMode);
void setFilterMode(FilterMode filterMode);
void toggleFilter(FilterMode filterMode);

View File

@@ -39,7 +39,7 @@ class TestTreeView : public Utils::NavigationTreeView
Q_OBJECT
public:
explicit TestTreeView(QWidget *parent = 0);
explicit TestTreeView(QWidget *parent = nullptr);
void selectAll() override;
void deselectAll();

View File

@@ -22,8 +22,8 @@
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#ifndef FOO_H_INCLUDED
#define FOO_H_INCLUDED
#pragma once
#include <QObject>
@@ -46,5 +46,3 @@ private slots:
void test_case4();
void test_case5() {}
};
#endif

View File

@@ -22,6 +22,9 @@
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <QQueue>
class QueueTest : public ::testing::Test

View File

@@ -22,6 +22,9 @@
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <gtest/gtest.h>
#include <QString>

View File

@@ -120,6 +120,9 @@
<property name="suffix">
<string>s</string>
</property>
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>30</number>
</property>

View File

@@ -265,7 +265,7 @@ CppTools::SymbolInfo toSymbolInfo(const FollowSymbolMessage &message)
result.endColumn = static_cast<int>(end.column);
result.fileName = start.filePath;
result.isPureDeclarationForUsage = message.result.isPureDeclarationForUsage;
result.isResultOnlyForFallBack = message.result.isResultOnlyForFallBack;
return result;
}

View File

@@ -289,7 +289,7 @@ private:
const QString link = documentationUrlForOption(option);
if (link.isEmpty())
return QString();
return option;
return wrapInLink(option.toString(), link);
}

View File

@@ -145,7 +145,7 @@ static ::Utils::ProcessLinkCallback extendedCallback(::Utils::ProcessLinkCallbac
{
// If globalFollowSymbol finds nothing follow to the declaration.
return [original_callback = std::move(callback), result](const ::Utils::Link &link) {
if (!link.hasValidTarget() && result.isPureDeclarationForUsage) {
if (link.linkTextStart < 0 && result.isResultOnlyForFallBack) {
return original_callback(::Utils::Link(result.fileName, result.startLine,
result.startColumn - 1));
}
@@ -198,7 +198,7 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
return callback(Utils::Link());
CppTools::SymbolInfo result = m_watcher->result();
// We did not fail but the result is empty
if (result.fileName.isEmpty() || result.isPureDeclarationForUsage) {
if (result.fileName.isEmpty() || result.isResultOnlyForFallBack) {
const CppTools::RefactoringEngineInterface &refactoringEngine
= *CppTools::CppModelManager::instance();
refactoringEngine.globalFollowSymbol(data,

View File

@@ -59,6 +59,8 @@ QtcPlugin {
"projectpartutilities.h",
"qtcreatorclangqueryfindfilter.cpp",
"qtcreatorclangqueryfindfilter.h",
"qtcreatoreditormanager.cpp",
"qtcreatoreditormanager.h",
"qtcreatorsearch.cpp",
"qtcreatorsearch.h",
"qtcreatorsearchhandle.cpp",

View File

@@ -25,6 +25,7 @@
#include "clangselectablefilesdialog.h"
#include "ui_clangselectablefilesdialog.h"
#include "ui_clangtoolsbasicsettings.h"
#include "clangtoolsprojectsettings.h"
#include "clangtoolssettings.h"
@@ -269,9 +270,10 @@ enum { GlobalSettings , CustomSettings };
static Core::Id diagnosticConfiguration(ClangToolsProjectSettings *settings)
{
if (settings->useGlobalSettings())
Core::Id id = settings->diagnosticConfig();
if (id.isValid())
return id;
return ClangToolsSettings::instance()->savedDiagnosticConfigId();
return settings->diagnosticConfig();
}
SelectableFilesDialog::SelectableFilesDialog(const ProjectInfo &projectInfo,
@@ -290,37 +292,54 @@ SelectableFilesDialog::SelectableFilesDialog(const ProjectInfo &projectInfo,
m_ui->buttons->setStandardButtons(QDialogButtonBox::Cancel);
m_ui->buttons->addButton(m_analyzeButton, QDialogButtonBox::AcceptRole);
m_ui->diagnosticConfigsSelectionWidget->showLabel(false);
CppTools::ClangDiagnosticConfigsSelectionWidget *diagnosticConfigsSelectionWidget
= m_ui->clangToolsBasicSettings->ui()->clangDiagnosticConfigsSelectionWidget;
QCheckBox *buildBeforeAnalysis = m_ui->clangToolsBasicSettings->ui()->buildBeforeAnalysis;
ClangToolsProjectSettings *settings = ClangToolsProjectSettingsManager::getSettings(m_project);
m_customDiagnosticConfig = diagnosticConfiguration(settings);
m_buildBeforeAnalysis = settings->buildBeforeAnalysis();
if (settings->useGlobalSettings()) {
m_ui->globalOrCustom->setCurrentIndex(GlobalSettings);
m_ui->diagnosticConfigsSelectionWidget->setEnabled(false);
m_ui->clangToolsBasicSettings->setEnabled(false);
diagnosticConfigsSelectionWidget->refresh(
ClangToolsSettings::instance()->savedDiagnosticConfigId());
buildBeforeAnalysis->setCheckState(
ClangToolsSettings::instance()->savedBuildBeforeAnalysis()
? Qt::Checked : Qt::Unchecked);
} else {
m_ui->globalOrCustom->setCurrentIndex(CustomSettings);
m_ui->diagnosticConfigsSelectionWidget->setEnabled(true);
m_ui->clangToolsBasicSettings->setEnabled(true);
diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
buildBeforeAnalysis->setCheckState(m_buildBeforeAnalysis ? Qt::Checked : Qt::Unchecked);
}
m_customDiagnosticConfig = diagnosticConfiguration(settings);
m_ui->diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
connect(m_ui->globalOrCustom,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
[this](int index){
m_ui->diagnosticConfigsSelectionWidget->setEnabled(index == CustomSettings);
[=](int index){
m_ui->clangToolsBasicSettings->setEnabled(index == CustomSettings);
if (index == CustomSettings) {
m_ui->diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
buildBeforeAnalysis->setCheckState(m_buildBeforeAnalysis ? Qt::Checked : Qt::Unchecked);
} else {
m_ui->diagnosticConfigsSelectionWidget->refresh(
diagnosticConfigsSelectionWidget->refresh(
ClangToolsSettings::instance()->savedDiagnosticConfigId());
buildBeforeAnalysis->setCheckState(
ClangToolsSettings::instance()->savedBuildBeforeAnalysis()
? Qt::Checked : Qt::Unchecked);
}
});
connect(m_ui->diagnosticConfigsSelectionWidget,
connect(diagnosticConfigsSelectionWidget,
&ClangDiagnosticConfigsSelectionWidget::currentConfigChanged,
[this](const Core::Id &currentConfigId) {
if (m_ui->globalOrCustom->currentIndex() == CustomSettings)
m_customDiagnosticConfig = currentConfigId;
});
connect(buildBeforeAnalysis, &QCheckBox::toggled, [this](bool checked) {
if (m_ui->globalOrCustom->currentIndex() == CustomSettings)
m_buildBeforeAnalysis = checked;
});
// Restore selection
if (settings->selectedDirs().isEmpty() && settings->selectedFiles().isEmpty())
@@ -335,7 +354,12 @@ SelectableFilesDialog::SelectableFilesDialog(const ProjectInfo &projectInfo,
connect(CppTools::codeModelSettings().data(), &CppTools::CppCodeModelSettings::changed,
this, [=]() {
m_ui->diagnosticConfigsSelectionWidget->refresh(diagnosticConfiguration(settings));
if (m_ui->globalOrCustom->currentIndex() == CustomSettings) {
diagnosticConfigsSelectionWidget->refresh(m_customDiagnosticConfig);
} else {
diagnosticConfigsSelectionWidget->refresh(
ClangToolsSettings::instance()->savedDiagnosticConfigId());
}
});
}
@@ -350,9 +374,10 @@ void SelectableFilesDialog::accept()
{
ClangToolsProjectSettings *settings = ClangToolsProjectSettingsManager::getSettings(m_project);
// Save diagnostic configuration
// Save diagnostic configuration and flag to build before analysis
settings->setUseGlobalSettings(m_ui->globalOrCustom->currentIndex() == GlobalSettings);
settings->setDiagnosticConfig(m_customDiagnosticConfig);
settings->setBuildBeforeAnalysis(m_buildBeforeAnalysis);
// Save selection
QSet<FileName> checkedDirs;

View File

@@ -65,6 +65,7 @@ private:
Core::Id m_customDiagnosticConfig;
ProjectExplorer::Project *m_project;
QPushButton *m_analyzeButton = nullptr;
bool m_buildBeforeAnalysis = true;
};
} // namespace Internal

View File

@@ -15,33 +15,44 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Diagnostic Configuration</string>
</property>
<property name="checkable">
<bool>false</bool>
</property>
<property name="checked">
<bool>false</bool>
<string>General</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="globalOrCustom">
<item>
<property name="text">
<string>Global</string>
<string>Global Settings</string>
</property>
</item>
<item>
<property name="text">
<string>Custom</string>
<string>Custom Settings</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="diagnosticConfigsSelectionWidget" native="true"/>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="ClangTools::ClangToolsBasicSettings" name="clangToolsBasicSettings" native="true"/>
</item>
</layout>
</widget>
@@ -76,9 +87,9 @@
</widget>
<customwidgets>
<customwidget>
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
<class>ClangTools::ClangToolsBasicSettings</class>
<extends>QWidget</extends>
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
<header>clangtools/clangtoolsbasicsettings.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@@ -27,6 +27,7 @@
#include "clangtool.h"
#include "clangtoolslogfilereader.h"
#include "clangtoolsprojectsettings.h"
#include "clangtoolssettings.h"
#include "clangtoolsutils.h"
#include "clangtoolrunner.h"
@@ -237,12 +238,12 @@ ClangToolRunControl::ClangToolRunControl(RunControl *runControl,
{
addStartDependency(m_projectBuilder);
auto *settings = ClangToolsSettings::instance();
m_projectBuilder->setEnabled(settings->savedBuildBeforeAnalysis());
connect(settings, &ClangToolsSettings::buildBeforeAnalysisChanged, this, [this](bool checked) {
m_projectBuilder->setEnabled(checked);
});
ClangToolsProjectSettings *projectSettings = ClangToolsProjectSettingsManager::getSettings(
target->project());
if (projectSettings->useGlobalSettings())
m_projectBuilder->setEnabled(ClangToolsSettings::instance()->savedBuildBeforeAnalysis());
else
m_projectBuilder->setEnabled(projectSettings->buildBeforeAnalysis());
}
void ClangToolRunControl::init()

View File

@@ -19,6 +19,7 @@ SOURCES += \
clangtool.cpp \
clangtoolruncontrol.cpp \
clangtoolrunner.cpp \
clangtoolsbasicsettings.cpp \
clangtoolsdiagnostic.cpp \
clangtoolsdiagnosticmodel.cpp \
clangtoolslogfilereader.cpp \
@@ -41,6 +42,7 @@ HEADERS += \
clangtoolruncontrol.h \
clangtoolrunner.h \
clangtools_global.h \
clangtoolsbasicsettings.h \
clangtoolsconstants.h \
clangtoolsdiagnostic.h \
clangtoolsdiagnosticmodel.h \
@@ -54,7 +56,8 @@ HEADERS += \
FORMS += \
clangtoolsprojectsettingswidget.ui \
clangtoolsconfigwidget.ui \
clangselectablefilesdialog.ui
clangselectablefilesdialog.ui \
clangtoolsbasicsettings.ui
equals(TEST, 1) {
HEADERS += \

View File

@@ -48,11 +48,6 @@ QtcPlugin {
"clangselectablefilesdialog.cpp",
"clangselectablefilesdialog.h",
"clangselectablefilesdialog.ui",
"clangtoolsdiagnosticview.cpp",
"clangtoolsdiagnosticview.h",
"clangtoolsprojectsettingswidget.cpp",
"clangtoolsprojectsettingswidget.h",
"clangtoolsprojectsettingswidget.ui",
"clangtidyclazyruncontrol.cpp",
"clangtidyclazyruncontrol.h",
"clangtidyclazyrunner.cpp",
@@ -66,6 +61,9 @@ QtcPlugin {
"clangtoolrunner.cpp",
"clangtoolrunner.h",
"clangtools_global.h",
"clangtoolsbasicsettings.cpp",
"clangtoolsbasicsettings.h",
"clangtoolsbasicsettings.ui",
"clangtoolsconfigwidget.cpp",
"clangtoolsconfigwidget.h",
"clangtoolsconfigwidget.ui",
@@ -74,10 +72,15 @@ QtcPlugin {
"clangtoolsdiagnostic.h",
"clangtoolsdiagnosticmodel.cpp",
"clangtoolsdiagnosticmodel.h",
"clangtoolsdiagnosticview.cpp",
"clangtoolsdiagnosticview.h",
"clangtoolslogfilereader.cpp",
"clangtoolslogfilereader.h",
"clangtoolsprojectsettings.cpp",
"clangtoolsprojectsettings.h",
"clangtoolsprojectsettingswidget.cpp",
"clangtoolsprojectsettingswidget.h",
"clangtoolsprojectsettingswidget.ui",
"clangtoolssettings.cpp",
"clangtoolssettings.h",
"clangtoolsutils.cpp",

View File

@@ -0,0 +1,50 @@
/****************************************************************************
**
** Copyright (C) 2018 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.
**
****************************************************************************/
#include "clangtoolsbasicsettings.h"
#include "ui_clangtoolsbasicsettings.h"
#include "clangtoolsutils.h"
namespace ClangTools {
ClangToolsBasicSettings::ClangToolsBasicSettings(QWidget *parent)
: QWidget(parent)
, m_ui(new Ui::ClangToolsBasicSettings)
{
m_ui->setupUi(this);
}
ClangToolsBasicSettings::~ClangToolsBasicSettings()
{
delete m_ui;
}
Ui::ClangToolsBasicSettings *ClangToolsBasicSettings::ui()
{
return m_ui;
}
} // namespace ClangTools

View File

@@ -0,0 +1,49 @@
/****************************************************************************
**
** Copyright (C) 2016 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.
**
****************************************************************************/
#pragma once
#include <QWidget>
namespace ClangTools {
namespace Ui { class ClangToolsBasicSettings; }
class ClangExecutableVersion;
class ClangToolsBasicSettings : public QWidget
{
Q_OBJECT
public:
explicit ClangToolsBasicSettings(QWidget *parent = 0);
~ClangToolsBasicSettings();
Ui::ClangToolsBasicSettings *ui();
private:
Ui::ClangToolsBasicSettings *m_ui;
};
} // namespace ClangTools

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ClangTools::ClangToolsBasicSettings</class>
<widget class="QWidget" name="ClangTools::ClangToolsBasicSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="buildBeforeAnalysis">
<property name="text">
<string>Build the project before analysis</string>
</property>
</widget>
</item>
<item>
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="clangDiagnosticConfigsSelectionWidget" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
<extends>QWidget</extends>
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -24,6 +24,7 @@
****************************************************************************/
#include "clangtoolsconfigwidget.h"
#include "ui_clangtoolsbasicsettings.h"
#include "ui_clangtoolsconfigwidget.h"
#include "clangtoolsutils.h"
@@ -54,24 +55,27 @@ ClangToolsConfigWidget::ClangToolsConfigWidget(
static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
[settings](int count) { settings->setSimultaneousProcesses(count); });
m_ui->buildBeforeAnalysis->setCheckState(settings->savedBuildBeforeAnalysis()
QCheckBox *buildBeforeAnalysis = m_ui->clangToolsBasicSettings->ui()->buildBeforeAnalysis;
buildBeforeAnalysis->setCheckState(settings->savedBuildBeforeAnalysis()
? Qt::Checked : Qt::Unchecked);
connect(m_ui->buildBeforeAnalysis, &QCheckBox::toggled, [settings](bool checked) {
connect(buildBeforeAnalysis, &QCheckBox::toggled, [settings](bool checked) {
settings->setBuildBeforeAnalysis(checked);
});
m_ui->clangDiagnosticConfigsSelectionWidget->refresh(settings->savedDiagnosticConfigId());
CppTools::ClangDiagnosticConfigsSelectionWidget *clangDiagnosticConfigsSelectionWidget
= m_ui->clangToolsBasicSettings->ui()->clangDiagnosticConfigsSelectionWidget;
clangDiagnosticConfigsSelectionWidget->refresh(settings->savedDiagnosticConfigId());
connect(m_ui->clangDiagnosticConfigsSelectionWidget,
connect(clangDiagnosticConfigsSelectionWidget,
&CppTools::ClangDiagnosticConfigsSelectionWidget::currentConfigChanged,
this, [this](const Core::Id &currentConfigId) {
m_settings->setDiagnosticConfigId(currentConfigId);
});
connect(CppTools::codeModelSettings().data(), &CppTools::CppCodeModelSettings::changed,
this, [this]() {
this, [=]() {
// Settings were applied so apply also the current selection if possible.
m_ui->clangDiagnosticConfigsSelectionWidget->refresh(m_settings->diagnosticConfigId());
clangDiagnosticConfigsSelectionWidget->refresh(m_settings->diagnosticConfigId());
m_settings->writeSettings();
});
}

View File

@@ -21,11 +21,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="buildBeforeAnalysis">
<property name="text">
<string>Build the project before analysis</string>
</property>
</widget>
<widget class="ClangTools::ClangToolsBasicSettings" name="clangToolsBasicSettings" native="true"/>
</item>
<item>
<layout class="QHBoxLayout" name="processesLayout">
@@ -61,9 +57,6 @@
</item>
</layout>
</item>
<item>
<widget class="CppTools::ClangDiagnosticConfigsSelectionWidget" name="clangDiagnosticConfigsSelectionWidget" native="true"/>
</item>
</layout>
</widget>
</item>
@@ -84,9 +77,9 @@
</widget>
<customwidgets>
<customwidget>
<class>CppTools::ClangDiagnosticConfigsSelectionWidget</class>
<class>ClangTools::ClangToolsBasicSettings</class>
<extends>QWidget</extends>
<header>cpptools/clangdiagnosticconfigsselectionwidget.h</header>
<header>clangtools/clangtoolsbasicsettings.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@@ -36,6 +36,7 @@ namespace Internal {
static const char SETTINGS_KEY_USE_GLOBAL_SETTINGS[] = "ClangTools.UseGlobalSettings";
static const char SETTINGS_KEY_DIAGNOSTIC_CONFIG[] = "ClangTools.DiagnosticConfig";
static const char SETTINGS_KEY_BUILD_BEFORE_ANALYSIS[] = "ClangTools.BuildBeforeAnalysis";
static const char SETTINGS_KEY_SELECTED_DIRS[] = "ClangTools.SelectedDirs";
static const char SETTINGS_KEY_SELECTED_FILES[] = "ClangTools.SelectedFiles";
static const char SETTINGS_KEY_SUPPRESSED_DIAGS[] = "ClangTools.SuppressedDiagnostics";
@@ -86,6 +87,7 @@ void ClangToolsProjectSettings::load()
m_useGlobalSettings = useGlobalVariant.isValid() ? useGlobalVariant.toBool() : true;
m_diagnosticConfig = Core::Id::fromSetting(
m_project->namedSettings(SETTINGS_KEY_DIAGNOSTIC_CONFIG));
m_buildBeforeAnalysis = m_project->namedSettings(SETTINGS_KEY_BUILD_BEFORE_ANALYSIS).toBool();
auto toFileName = [](const QString &s) { return Utils::FileName::fromString(s); };
@@ -124,6 +126,7 @@ void ClangToolsProjectSettings::store()
{
m_project->setNamedSettings(SETTINGS_KEY_USE_GLOBAL_SETTINGS, m_useGlobalSettings);
m_project->setNamedSettings(SETTINGS_KEY_DIAGNOSTIC_CONFIG, m_diagnosticConfig.toSetting());
m_project->setNamedSettings(SETTINGS_KEY_BUILD_BEFORE_ANALYSIS, m_buildBeforeAnalysis);
const QStringList dirs = Utils::transform(m_selectedDirs.toList(), &Utils::FileName::toString);
m_project->setNamedSettings(SETTINGS_KEY_SELECTED_DIRS, dirs);
@@ -164,6 +167,16 @@ void ClangToolsProjectSettings::setDiagnosticConfig(const Core::Id &diagnosticCo
m_diagnosticConfig = diagnosticConfig;
}
bool ClangToolsProjectSettings::buildBeforeAnalysis() const
{
return m_buildBeforeAnalysis;
}
void ClangToolsProjectSettings::setBuildBeforeAnalysis(bool build)
{
m_buildBeforeAnalysis = build;
}
ClangToolsProjectSettingsManager::ClangToolsProjectSettingsManager()
{
QObject::connect(ProjectExplorer::SessionManager::instance(),

View File

@@ -81,6 +81,9 @@ public:
Core::Id diagnosticConfig() const;
void setDiagnosticConfig(const Core::Id &diagnosticConfig);
bool buildBeforeAnalysis() const;
void setBuildBeforeAnalysis(bool build);
QSet<Utils::FileName> selectedDirs() const { return m_selectedDirs; }
void setSelectedDirs(const QSet<Utils::FileName> &value) { m_selectedDirs = value; }
@@ -105,6 +108,7 @@ private:
QSet<Utils::FileName> m_selectedDirs;
QSet<Utils::FileName> m_selectedFiles;
SuppressedDiagnosticsList m_suppressedDiagnostics;
bool m_buildBeforeAnalysis = true;
};
class ClangToolsProjectSettingsManager

View File

@@ -73,7 +73,7 @@ bool ClangToolsSettings::savedBuildBeforeAnalysis() const
return m_savedBuildBeforeAnalysis;
}
int ClangToolsSettings::buildBeforeAnalysis() const
bool ClangToolsSettings::buildBeforeAnalysis() const
{
return m_buildBeforeAnalysis;
}

View File

@@ -48,7 +48,7 @@ public:
int simultaneousProcesses() const;
void setSimultaneousProcesses(int processes);
int buildBeforeAnalysis() const;
bool buildBeforeAnalysis() const;
void setBuildBeforeAnalysis(bool build);
Core::Id diagnosticConfigId() const;

View File

@@ -190,6 +190,9 @@
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">

View File

@@ -403,6 +403,7 @@ void MenuActionContainer::insertAction(QAction *before, QAction *action)
void MenuActionContainer::insertMenu(QAction *before, QMenu *menu)
{
menu->setParent(m_menu, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636)
m_menu->insertMenu(before, menu);
}
@@ -509,6 +510,7 @@ void MenuBarActionContainer::insertAction(QAction *before, QAction *action)
void MenuBarActionContainer::insertMenu(QAction *before, QMenu *menu)
{
menu->setParent(m_menuBar, menu->windowFlags()); // work around issues with Qt Wayland (QTBUG-68636)
m_menuBar->insertMenu(before, menu);
}

View File

@@ -85,11 +85,11 @@ public:
: QAbstractTableModel(parent) {}
virtual ~MimeTypeSettingsModel() {}
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
virtual QVariant data(const QModelIndex &modelIndex, int role = Qt::DisplayRole) const override;
QVariant data(const QModelIndex &modelIndex, int role = Qt::DisplayRole) const override;
void load();

View File

@@ -10,6 +10,7 @@ QtcPlugin {
Depends { name: "TextEditor" }
cpp.includePaths: base.concat([project.sharedSourcesDir + "/cpaster"])
cpp.defines: ["CPASTER_PLUGIN_GUI"]
files: [
"columnindicatortextedit.cpp",

View File

@@ -302,6 +302,7 @@ void KdePasteProtocol::paste(const QString &text, Protocol::ContentType ct, int
const QString user;
const QString passwd;
qDebug() << "KDE needs credentials for pasting";
emit pasteDone(QString());
return;
#endif
// store input data as members to be able to use them after the authentication succeeded

View File

@@ -24,6 +24,9 @@
****************************************************************************/
#include "protocol.h"
#ifdef CPASTER_PLUGIN_GUI
#include "authenticationdialog.h"
#endif
#include <utils/networkaccessmanager.h>
@@ -47,6 +50,7 @@
#include <QMessageBox>
#include <QApplication>
#include <QPushButton>
#include <QAuthenticator>
namespace CodePaster {
@@ -205,10 +209,37 @@ QNetworkReply *NetworkProtocol::httpPost(const QString &link, const QByteArray &
return Utils::NetworkAccessManager::instance()->post(r, data);
}
NetworkProtocol::NetworkProtocol()
: Protocol()
{
connect(Utils::NetworkAccessManager::instance(), &QNetworkAccessManager::authenticationRequired,
this, &NetworkProtocol::authenticationRequired);
}
NetworkProtocol::~NetworkProtocol()
{
}
void NetworkProtocol::requestAuthentication(const QUrl &url, QNetworkReply *reply, QAuthenticator *authenticator)
{
#ifdef CPASTER_PLUGIN_GUI
if (reply->request().url().host() == url.host()) {
const QString details = tr("Pasting needs authentication.<br/>"
"Enter your identity credentials to continue.");
AuthenticationDialog authDialog(details, Core::ICore::dialogParent());
authDialog.setWindowTitle(tr("Authenticate for Paster"));
if (authDialog.exec() == QDialog::Accepted) {
authenticator->setUser(authDialog.userName());
authenticator->setPassword(authDialog.password());
}
}
#else
Q_UNUSED(url);
Q_UNUSED(reply);
Q_UNUSED(authenticator);
#endif
}
bool NetworkProtocol::httpStatus(QString url, QString *errorMessage, bool useHttps)
{
// Connect to host and display a message box, using its event loop.

View File

@@ -30,6 +30,7 @@
#include <QSharedPointer>
QT_BEGIN_NAMESPACE
class QAuthenticator;
class QNetworkReply;
class QWidget;
QT_END_NAMESPACE
@@ -107,9 +108,16 @@ class NetworkProtocol : public Protocol
Q_OBJECT
public:
NetworkProtocol();
~NetworkProtocol() override;
signals:
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
protected:
void requestAuthentication(const QUrl &url, QNetworkReply *reply, QAuthenticator *authenticator);
QNetworkReply *httpGet(const QString &url, bool handleCookies = false);
QNetworkReply *httpPost(const QString &link, const QByteArray &data,

View File

@@ -99,7 +99,6 @@ public:
setAutoCompleterCreator([]() { return new CppAutoCompleter; });
setCommentDefinition(CommentDefinition::CppStyle);
setCodeFoldingSupported(true);
setMarksVisible(true);
setParenthesesMatchingEnabled(true);
setEditorActionHandlers(TextEditorActionHandler::Format

View File

@@ -106,11 +106,6 @@ void ClangDiagnosticConfigsSelectionWidget::refresh(Core::Id id)
connectToCurrentIndexChanged();
}
void ClangDiagnosticConfigsSelectionWidget::showLabel(bool show)
{
m_label->setVisible(show);
}
void ClangDiagnosticConfigsSelectionWidget::connectToClangDiagnosticConfigsDialog(QPushButton *button)
{
connect(button, &QPushButton::clicked, [this]() {

View File

@@ -50,8 +50,6 @@ public:
void refresh(Core::Id id);
void showLabel(bool show);
signals:
void currentConfigChanged(const Core::Id &currentConfigId);

View File

@@ -39,7 +39,7 @@ public:
int endLine = 0;
int endColumn = 0;
QString fileName;
bool isPureDeclarationForUsage = false;
bool isResultOnlyForFallBack = false;
};
} // namespace CppTools

View File

@@ -97,6 +97,9 @@
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
</layout>

View File

@@ -254,6 +254,11 @@ void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
setContext(QString());
}
void Console::populateFileFinder()
{
m_consoleView->populateFileFinder();
}
void Console::printItem(ConsoleItem::ItemType itemType, const QString &text)
{
printItem(new ConsoleItem(itemType, text));

View File

@@ -76,6 +76,7 @@ public:
void setContext(const QString &context);
void setScriptEvaluator(const ScriptEvaluator &evaluator);
void populateFileFinder();
void evaluate(const QString &expression);
void printItem(ConsoleItem *item);

View File

@@ -29,6 +29,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/manhattanstyle.h>
#include <qtsupport/baseqtversion.h>
#include <utils/hostosinfo.h>
#include <QAction>
@@ -107,13 +108,6 @@ ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) :
// Sometimes we get the standard windows 95 style as a fallback
if (QStyleFactory::keys().contains(QLatin1String("Fusion"))) {
baseName = QLatin1String("fusion"); // Qt5
} else { // Qt4
// e.g. if we are running on a KDE4 desktop
QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION");
if (desktopEnvironment == "kde")
baseName = QLatin1String("plastique");
else
baseName = QLatin1String("cleanlooks");
}
}
ConsoleViewStyle *style = new ConsoleViewStyle(baseName);
@@ -135,6 +129,11 @@ void ConsoleView::onScrollToBottom()
scrollToBottom();
}
void ConsoleView::populateFileFinder()
{
QtSupport::BaseQtVersion::populateQmlFileFinder(&m_finder, nullptr);
}
void ConsoleView::mousePressEvent(QMouseEvent *event)
{
QPoint pos = event->pos();
@@ -219,17 +218,10 @@ void ConsoleView::onRowActivated(const QModelIndex &index)
if (!index.isValid())
return;
// See if we have file and line Info
QString filePath = model()->data(index, ConsoleItem::FileRole).toString();
const QUrl fileUrl = QUrl(filePath);
if (fileUrl.isLocalFile())
filePath = fileUrl.toLocalFile();
if (!filePath.isEmpty()) {
QFileInfo fi(filePath);
const QFileInfo fi(m_finder.findFile(model()->data(index, ConsoleItem::FileRole).toString()));
if (fi.exists() && fi.isFile() && fi.isReadable()) {
int line = model()->data(index, ConsoleItem::LineRole).toInt();
Core::EditorManager::openEditorAt(fi.canonicalFilePath(), line);
}
Core::EditorManager::openEditorAt(fi.canonicalFilePath(),
model()->data(index, ConsoleItem::LineRole).toInt());
}
}
@@ -257,17 +249,9 @@ bool ConsoleView::canShowItemInTextEditor(const QModelIndex &index)
if (!index.isValid())
return false;
// See if we have file and line Info
QString filePath = model()->data(index, ConsoleItem::FileRole).toString();
const QUrl fileUrl = QUrl(filePath);
if (fileUrl.isLocalFile())
filePath = fileUrl.toLocalFile();
if (!filePath.isEmpty()) {
QFileInfo fi(filePath);
if (fi.exists() && fi.isFile() && fi.isReadable())
return true;
}
return false;
bool success = false;
m_finder.findFile(model()->data(index, ConsoleItem::FileRole).toString(), &success);
return success;
}
} // Internal

View File

@@ -25,6 +25,7 @@
#pragma once
#include <utils/fileinprojectfinder.h>
#include <utils/itemviews.h>
namespace Debugger {
@@ -40,6 +41,7 @@ public:
ConsoleView(ConsoleItemModel *model, QWidget *parent);
void onScrollToBottom();
void populateFileFinder();
protected:
void mousePressEvent(QMouseEvent *event);
@@ -55,6 +57,7 @@ private:
bool canShowItemInTextEditor(const QModelIndex &index);
ConsoleItemModel *m_model;
Utils::FileInProjectFinder m_finder;
};
} // Internal

View File

@@ -265,6 +265,7 @@ QmlEngine::QmlEngine()
connect(&d->applicationLauncher, &ApplicationLauncher::processStarted,
this, &QmlEngine::handleLauncherStarted);
debuggerConsole()->populateFileFinder();
debuggerConsole()->setScriptEvaluator([this](const QString &expr) {
executeDebuggerCommand(expr, QmlLanguage);
});

View File

@@ -416,9 +416,9 @@ public:
QString removeNamespaces(QString str) const;
bool contextMenuEvent(const ItemViewEvent &ev);
QMenu *createFormatMenu(WatchItem *item);
QMenu *createMemoryMenu(WatchItem *item);
QMenu *createBreakpointMenu(WatchItem *item);
QMenu *createFormatMenu(WatchItem *item, QWidget *parent);
QMenu *createMemoryMenu(WatchItem *item, QWidget *parent);
QMenu *createBreakpointMenu(WatchItem *item, QWidget *parent);
void addStackLayoutMemoryView(bool separateView, const QPoint &p);
@@ -1657,9 +1657,9 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
[this] { grabWidget(); });
menu->addSeparator();
menu->addMenu(createFormatMenu(item));
menu->addMenu(createMemoryMenu(item));
menu->addMenu(createBreakpointMenu(item));
menu->addMenu(createFormatMenu(item, menu));
menu->addMenu(createMemoryMenu(item, menu));
menu->addMenu(createBreakpointMenu(item, menu));
menu->addSeparator();
addAction(menu, tr("Expand All Children"),
@@ -1712,13 +1712,14 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
menu->addSeparator();
menu->addAction(action(SettingsDialog));
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
menu->popup(ev.globalPos());
return true;
}
QMenu *WatchModel::createBreakpointMenu(WatchItem *item)
QMenu *WatchModel::createBreakpointMenu(WatchItem *item, QWidget *parent)
{
auto menu = new QMenu(tr("Add Data Breakpoint"));
auto menu = new QMenu(tr("Add Data Breakpoint"), parent);
if (!item) {
menu->setEnabled(false);
return menu;
@@ -1760,9 +1761,9 @@ QMenu *WatchModel::createBreakpointMenu(WatchItem *item)
return menu;
}
QMenu *WatchModel::createMemoryMenu(WatchItem *item)
QMenu *WatchModel::createMemoryMenu(WatchItem *item, QWidget *parent)
{
auto menu = new QMenu(tr("Open Memory Editor"));
auto menu = new QMenu(tr("Open Memory Editor"), parent);
if (!item || !m_engine->hasCapability(ShowMemoryCapability)) {
menu->setEnabled(false);
return menu;
@@ -1813,9 +1814,9 @@ QMenu *WatchModel::createMemoryMenu(WatchItem *item)
return menu;
}
QMenu *WatchModel::createFormatMenu(WatchItem *item)
QMenu *WatchModel::createFormatMenu(WatchItem *item, QWidget *parent)
{
auto menu = new QMenu(tr("Change Value Display Format"));
auto menu = new QMenu(tr("Change Value Display Format"), parent);
if (!item) {
menu->setEnabled(false);
return menu;

View File

@@ -132,6 +132,7 @@ public:
setEditorWidgetCreator([]() { return new Internal::DesignerXmlEditorWidget; });
setUseGenericHighlighter(true);
setDuplicatedSupported(false);
setMarksVisible(false);
}
FormWindowEditor *create(QDesignerFormWindowInterface *form)

View File

@@ -79,7 +79,7 @@ public:
DescriptionEditorWidget(QWidget *parent = nullptr);
~DescriptionEditorWidget() override;
virtual QSize sizeHint() const override;
QSize sizeHint() const override;
protected:
void setDisplaySettings(const DisplaySettings &ds) override;

View File

@@ -60,6 +60,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
m_process = new QProcess(this);
m_process->setWorkingDirectory(workingDirectory);
m_process->setProcessEnvironment(env);
m_process->setReadChannelMode(QProcess::MergedChannels);
const Utils::FileName binary = GitPlugin::client()->vcsBinary();
VcsOutputWindow::appendCommand(workingDirectory, binary, arguments);
m_process->start(binary.toString(), arguments);
@@ -68,7 +69,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
connect(m_process, &QIODevice::readyRead, this, &MergeTool::readData);
} else {
delete m_process;
m_process = 0;
m_process = nullptr;
return false;
}
return true;

View File

@@ -89,7 +89,7 @@
<number>10</number>
</property>
<property name="maximum">
<number>300</number>
<number>360</number>
</property>
<property name="value">
<number>30</number>

View File

@@ -325,7 +325,6 @@ GlslEditorFactory::GlslEditorFactory()
setCommentDefinition(Utils::CommentDefinition::CppStyle);
setCompletionAssistProvider(new GlslCompletionAssistProvider);
setParenthesesMatchingEnabled(true);
setMarksVisible(true);
setCodeFoldingSupported(true);
setEditorActionHandlers(TextEditorActionHandler::Format

View File

@@ -100,6 +100,9 @@
<property name="suffix">
<string>s</string>
</property>
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>30</number>
</property>

View File

@@ -67,9 +67,7 @@ NimEditorFactory::NimEditorFactory()
});
setCommentDefinition(CommentDefinition::HashStyle);
setParenthesesMatchingEnabled(true);
setMarksVisible(false);
setCodeFoldingSupported(true);
setMarksVisible(true);
}
Core::IEditor *NimEditorFactory::createEditor()

View File

@@ -106,6 +106,8 @@ NimCompilerBuildStep::NimCompilerBuildStep(BuildStepList *parentList)
auto bc = qobject_cast<NimBuildConfiguration *>(buildConfiguration());
connect(bc, &NimBuildConfiguration::buildDirectoryChanged,
this, &NimCompilerBuildStep::updateProcessParameters);
connect(bc, &BuildConfiguration::environmentChanged,
this, &NimCompilerBuildStep::updateProcessParameters);
connect(this, &NimCompilerBuildStep::outFilePathChanged,
bc, &NimBuildConfiguration::outFilePathChanged);
connect(bc->target()->project(), &ProjectExplorer::Project::fileListChanged,

View File

@@ -119,6 +119,9 @@
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
<item row="0" column="4">

View File

@@ -489,7 +489,13 @@ void AppOutputPane::appendMessage(RunControl *rc, const QString &out, Utils::Out
const int index = indexOf(rc);
if (index != -1) {
Core::OutputWindow *window = m_runControlTabs.at(index).window;
window->appendMessage(out, format);
QString stringToWrite;
if (format == Utils::NormalMessageFormat || format == Utils::ErrorMessageFormat) {
stringToWrite = QTime::currentTime().toString();
stringToWrite += QLatin1String(": ");
}
stringToWrite += out;
window->appendMessage(stringToWrite, format);
if (format != Utils::NormalMessageFormat) {
if (m_runControlTabs.at(index).behaviorOnOutput == Flash)
flash();

View File

@@ -421,7 +421,7 @@ void ProjectTreeWidget::editCurrentItem()
m_view->edit(currentIndex);
// Select complete file basename for renaming
const Node *node = m_model->nodeForIndex(currentIndex);
if (!node || node->nodeType() != NodeType::File)
if (!node)
return;
QLineEdit *editor = qobject_cast<QLineEdit*>(m_view->indexWidget(currentIndex));
if (!editor)

View File

@@ -57,7 +57,6 @@ PythonEditorFactory::PythonEditorFactory()
setSyntaxHighlighterCreator([] { return new PythonHighlighter; });
setCommentDefinition(Utils::CommentDefinition::HashStyle);
setParenthesesMatchingEnabled(true);
setMarksVisible(true);
setCodeFoldingSupported(true);
}

View File

@@ -57,7 +57,7 @@ namespace Internal {
class ProFileEditorWidget : public TextEditorWidget
{
protected:
virtual void findLinkAt(const QTextCursor &,
void findLinkAt(const QTextCursor &,
Utils::ProcessLinkCallback &&processLinkCallback,
bool resolveTarget = true,
bool inNextSplit = false) override;

View File

@@ -357,9 +357,11 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF
return MakefileForWrongProject;
}
if (parse.srcProFile() != qs->project()->projectFilePath().toString()) {
const Utils::FileName projectPath =
m_subNodeBuild ? m_subNodeBuild->filePath() : qs->project()->projectFilePath();
if (parse.srcProFile() != projectPath.toString()) {
qCDebug(logs) << "**Different profile used to generate the Makefile:"
<< parse.srcProFile() << " expected profile:" << qs->project()->projectFilePath();
<< parse.srcProFile() << " expected profile:" << projectPath;
if (errorString)
*errorString = tr("The Makefile is for a different project.");
return MakefileIncompatible;

View File

@@ -1059,7 +1059,6 @@ QmlJSEditorFactory::QmlJSEditorFactory()
setAutoCompleterCreator([]() { return new AutoCompleter; });
setCommentDefinition(Utils::CommentDefinition::CppStyle);
setParenthesesMatchingEnabled(true);
setMarksVisible(true);
setCodeFoldingSupported(true);
addHoverHandler(new QmlJSHoverHandler);

View File

@@ -95,7 +95,6 @@ public:
signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
void typeSelected(int typeIndex);
private:
QVariant lookup(const FlameGraphData &data, int role) const;

View File

@@ -67,7 +67,7 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent
layout->addWidget(m_content);
setLayout(layout);
connect(m_model, &FlameGraphModel::typeSelected, this, &FlameGraphView::typeSelected);
connect(m_content->rootObject(), SIGNAL(typeSelected(int)), this, SIGNAL(typeSelected(int)));
connect(m_model, &FlameGraphModel::gotoSourceLocation,
this, &FlameGraphView::gotoSourceLocation);
}

View File

@@ -509,13 +509,13 @@ void QmlProfilerEventStorage::clear()
m_size = 0;
m_file.clear();
if (!m_file.open())
m_errorHandler(tr("Failed to reset temporary trace file"));
m_errorHandler(tr("Failed to reset temporary trace file."));
}
void QmlProfilerEventStorage::finalize()
{
if (!m_file.flush())
m_errorHandler(tr("Failed to flush temporary trace file"));
m_errorHandler(tr("Failed to flush temporary trace file."));
}
QmlProfilerEventStorage::ErrorHandler QmlProfilerEventStorage::errorHandler() const
@@ -536,13 +536,13 @@ bool QmlProfilerEventStorage::replay(
case Timeline::TraceStashFile<QmlEvent>::ReplaySuccess:
return true;
case Timeline::TraceStashFile<QmlEvent>::ReplayOpenFailed:
m_errorHandler(tr("Could not re-open temporary trace file"));
m_errorHandler(tr("Could not re-open temporary trace file."));
break;
case Timeline::TraceStashFile<QmlEvent>::ReplayLoadFailed:
// Happens if the loader rejects an event. Not an actual error
break;
case Timeline::TraceStashFile<QmlEvent>::ReplayReadPastEnd:
m_errorHandler(tr("Read past end in temporary trace file"));
m_errorHandler(tr("Read past end in temporary trace file."));
break;
}
return false;

View File

@@ -88,7 +88,7 @@ void QmlProfilerTraceClientTest::testMessageReceived()
traceClient.clear();
}, [this, &lastError](const QString &message) {
QVERIFY(!message.isEmpty());
if (lastError == QmlProfilerModelManager::tr("Read past end in temporary trace file")) {
if (lastError == QmlProfilerModelManager::tr("Read past end in temporary trace file.")) {
// Ignore read-past-end errors: Our test traces are somewhat dirty and don't end on
// packet boundaries
modelManager.clearAll();

View File

@@ -66,7 +66,7 @@ public:
signals:
void contextMenuRequested(const QPoint &pos, int index);
protected:
bool eventFilter(QObject *object, QEvent *event) override final;
bool eventFilter(QObject *object, QEvent *event) final;
private:
int m_tabIndexForMiddleClick = -1;
};
@@ -112,7 +112,7 @@ class ComboBox : public QComboBox
{
Q_OBJECT
public:
void showPopup() override final;
void showPopup() final;
signals:
void opened();
};

View File

@@ -113,6 +113,9 @@
<property name="maximum">
<number>360</number>
</property>
<property name="value">
<number>30</number>
</property>
</widget>
</item>
<item row="0" column="4">

View File

@@ -8477,7 +8477,6 @@ bool TextEditorWidget::isMissingSyntaxDefinition() const
// The remnants of PlainTextEditor.
void TextEditorWidget::setupGenericHighlighter()
{
setMarksVisible(true);
setLineSeparatorsAllowed(true);
connect(textDocument(), &IDocument::filePathChanged,
@@ -8574,7 +8573,7 @@ public:
bool m_duplicatedSupported = true;
bool m_codeFoldingSupported = false;
bool m_paranthesesMatchinEnabled = false;
bool m_marksVisible = false;
bool m_marksVisible = true;
};
} /// namespace Internal

View File

@@ -445,6 +445,8 @@ private:
#ifdef Q_OS_WIN
class HeobDialog : public QDialog
{
Q_DECLARE_TR_FUNCTIONS(HeobDialog)
public:
HeobDialog(QWidget *parent);
@@ -475,6 +477,8 @@ private:
class HeobData : public QObject
{
Q_DECLARE_TR_FUNCTIONS(HeobData)
public:
HeobData(MemcheckTool *mcTool, const QString &xmlPath, Kit *kit, bool attach);
~HeobData();

View File

@@ -80,6 +80,7 @@ VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters,
});
setEditorCreator([]() { return new VcsBaseEditor(); });
setMarksVisible(false);
}
VcsBaseEditor *VcsEditorFactory::createEditorById(const char *id)

View File

@@ -37,7 +37,7 @@ enum class PreferredTranslationUnit
};
// CLANG-UPGRADE-CHECK: Remove IS_PRETTY_DECL_SUPPORTED once we require clang >= 7.0
#if defined(CINDEX_VERSION_HAS_PRETTYDECL_BACKPORTED) || CINDEX_VERSION_MINOR >= 47
#if defined(CINDEX_VERSION_HAS_PRETTYDECL_BACKPORTED) || CINDEX_VERSION_MINOR >= 46
# define IS_PRETTY_DECL_SUPPORTED
#endif
@@ -46,4 +46,9 @@ enum class PreferredTranslationUnit
# define IS_INVALIDDECL_SUPPORTED
#endif
// CLANG-UPGRADE-CHECK: Remove IS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_SUPPORTED once we require clang >= 7.0
#if defined(CINDEX_VERSION_HAS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_BACKPORTED) || CINDEX_VERSION_MINOR >= 46
# define IS_LIMITSKIPFUNCTIONBODIESTOPREAMBLE_SUPPORTED
#endif
} // namespace ClangBackEnd

Some files were not shown because too many files have changed in this diff Show More