forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/master' into 4.5
Change-Id: I9fff4705cd5a7c92ddb18318cd87d0fe6f263f7e
This commit is contained in:
@@ -44,12 +44,6 @@ void ClangCodeModelClientInterface::dispatch(const MessageEnvelop &messageEnvelo
|
||||
case MessageType::CodeCompletedMessage:
|
||||
codeCompleted(messageEnvelop.message<CodeCompletedMessage>());
|
||||
break;
|
||||
case MessageType::TranslationUnitDoesNotExistMessage:
|
||||
translationUnitDoesNotExist(messageEnvelop.message<TranslationUnitDoesNotExistMessage>());
|
||||
break;
|
||||
case MessageType::ProjectPartsDoNotExistMessage:
|
||||
projectPartsDoNotExist(messageEnvelop.message<ProjectPartsDoNotExistMessage>());
|
||||
break;
|
||||
case MessageType::DocumentAnnotationsChangedMessage:
|
||||
documentAnnotationsChanged(messageEnvelop.message<DocumentAnnotationsChangedMessage>());
|
||||
break;
|
||||
|
@@ -35,7 +35,6 @@ class CodeCompletedMessage;
|
||||
class CompleteCodeMessage;
|
||||
class DocumentAnnotationsChangedMessage;
|
||||
class EchoMessage;
|
||||
class ProjectPartsDoNotExistMessage;
|
||||
class ReferencesMessage;
|
||||
class FollowSymbolMessage;
|
||||
class RegisterProjectPartsForEditorMessage;
|
||||
@@ -44,7 +43,6 @@ class RegisterUnsavedFilesForEditorMessage;
|
||||
class RequestDocumentAnnotationsMessage;
|
||||
class RequestReferencesMessage;
|
||||
class RequestFollowSymbolMessage;
|
||||
class TranslationUnitDoesNotExistMessage;
|
||||
class UnregisterProjectPartsForEditorMessage;
|
||||
class UnregisterTranslationUnitsForEditorMessage;
|
||||
class UnregisterUnsavedFilesForEditorMessage;
|
||||
@@ -59,8 +57,6 @@ public:
|
||||
virtual void alive() = 0;
|
||||
virtual void echo(const EchoMessage &message) = 0;
|
||||
virtual void codeCompleted(const CodeCompletedMessage &message) = 0;
|
||||
virtual void translationUnitDoesNotExist(const TranslationUnitDoesNotExistMessage &message) = 0;
|
||||
virtual void projectPartsDoNotExist(const ProjectPartsDoNotExistMessage &message) = 0;
|
||||
virtual void documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) = 0;
|
||||
virtual void references(const ReferencesMessage &message) = 0;
|
||||
virtual void followSymbol(const FollowSymbolMessage &message) = 0;
|
||||
|
@@ -29,7 +29,5 @@
|
||||
#include "cmbcodecompletedmessage.h"
|
||||
#include "cmbechomessage.h"
|
||||
#include "documentannotationschangedmessage.h"
|
||||
#include "projectpartsdonotexistmessage.h"
|
||||
#include "referencesmessage.h"
|
||||
#include "followsymbolmessage.h"
|
||||
#include "translationunitdoesnotexistmessage.h"
|
||||
|
@@ -80,16 +80,6 @@ void ClangCodeModelClientProxy::codeCompleted(const CodeCompletedMessage &messag
|
||||
m_writeMessageBlock.write(message);
|
||||
}
|
||||
|
||||
void ClangCodeModelClientProxy::translationUnitDoesNotExist(const TranslationUnitDoesNotExistMessage &message)
|
||||
{
|
||||
m_writeMessageBlock.write(message);
|
||||
}
|
||||
|
||||
void ClangCodeModelClientProxy::projectPartsDoNotExist(const ProjectPartsDoNotExistMessage &message)
|
||||
{
|
||||
m_writeMessageBlock.write(message);
|
||||
}
|
||||
|
||||
void ClangCodeModelClientProxy::documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message)
|
||||
{
|
||||
m_writeMessageBlock.write(message);
|
||||
|
@@ -54,8 +54,6 @@ public:
|
||||
void alive() override;
|
||||
void echo(const EchoMessage &message) override;
|
||||
void codeCompleted(const CodeCompletedMessage &message) override;
|
||||
void translationUnitDoesNotExist(const TranslationUnitDoesNotExistMessage &message) override;
|
||||
void projectPartsDoNotExist(const ProjectPartsDoNotExistMessage &message) override;
|
||||
void documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) override;
|
||||
void references(const ReferencesMessage &message) override;
|
||||
void followSymbol(const FollowSymbolMessage &message) override;
|
||||
|
@@ -53,7 +53,6 @@ SOURCES += \
|
||||
$$PWD/projectpartcontainer.cpp \
|
||||
$$PWD/projectpartcontainerv2.cpp \
|
||||
$$PWD/projectpartpch.cpp \
|
||||
$$PWD/projectpartsdonotexistmessage.cpp \
|
||||
$$PWD/readmessageblock.cpp \
|
||||
$$PWD/refactoringclientinterface.cpp \
|
||||
$$PWD/refactoringclientproxy.cpp \
|
||||
@@ -79,7 +78,6 @@ SOURCES += \
|
||||
$$PWD/sourcerangescontainer.cpp \
|
||||
$$PWD/sourcerangesforquerymessage.cpp \
|
||||
$$PWD/sourcerangewithtextcontainer.cpp \
|
||||
$$PWD/translationunitdoesnotexistmessage.cpp \
|
||||
$$PWD/unregisterunsavedfilesforeditormessage.cpp \
|
||||
$$PWD/updatepchprojectpartsmessage.cpp \
|
||||
$$PWD/updatetranslationunitsforeditormessage.cpp \
|
||||
@@ -138,7 +136,6 @@ HEADERS += \
|
||||
$$PWD/projectpartcontainer.h \
|
||||
$$PWD/projectpartcontainerv2.h \
|
||||
$$PWD/projectpartpch.h \
|
||||
$$PWD/projectpartsdonotexistmessage.h \
|
||||
$$PWD/readmessageblock.h \
|
||||
$$PWD/refactoringclientinterface.h \
|
||||
$$PWD/refactoringclientproxy.h \
|
||||
@@ -165,7 +162,6 @@ HEADERS += \
|
||||
$$PWD/sourcerangesforquerymessage.h \
|
||||
$$PWD/sourcerangewithtextcontainer.h \
|
||||
$$PWD/stringcache.h \
|
||||
$$PWD/translationunitdoesnotexistmessage.h \
|
||||
$$PWD/unregisterunsavedfilesforeditormessage.h \
|
||||
$$PWD/updatepchprojectpartsmessage.h \
|
||||
$$PWD/updatetranslationunitsforeditormessage.h \
|
||||
|
@@ -124,9 +124,6 @@ enum class MessageType : quint8 {
|
||||
CompleteCodeMessage,
|
||||
CodeCompletedMessage,
|
||||
|
||||
TranslationUnitDoesNotExistMessage,
|
||||
ProjectPartsDoNotExistMessage,
|
||||
|
||||
SourceLocationsForRenamingMessage,
|
||||
RequestSourceLocationsForRenamingMessage,
|
||||
|
||||
|
@@ -83,12 +83,6 @@ QDebug operator<<(QDebug debug, const MessageEnvelop &messageEnvelop)
|
||||
case MessageType::ReferencesMessage:
|
||||
qDebug() << messageEnvelop.message<ReferencesMessage>();
|
||||
break;
|
||||
case MessageType::TranslationUnitDoesNotExistMessage:
|
||||
qDebug() << messageEnvelop.message<TranslationUnitDoesNotExistMessage>();
|
||||
break;
|
||||
case MessageType::ProjectPartsDoNotExistMessage:
|
||||
qDebug() << messageEnvelop.message<ProjectPartsDoNotExistMessage>();
|
||||
break;
|
||||
case MessageType::DocumentAnnotationsChangedMessage:
|
||||
qDebug() << messageEnvelop.message<DocumentAnnotationsChangedMessage>();
|
||||
break;
|
||||
|
@@ -1,77 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 "clangsupport_global.h"
|
||||
|
||||
#include <utf8stringvector.h>
|
||||
|
||||
#include <QDataStream>
|
||||
|
||||
namespace ClangBackEnd {
|
||||
|
||||
class ProjectPartsDoNotExistMessage
|
||||
{
|
||||
public:
|
||||
ProjectPartsDoNotExistMessage() = default;
|
||||
ProjectPartsDoNotExistMessage(const Utf8StringVector &projectPartIds)
|
||||
: m_projectPartIds(projectPartIds)
|
||||
{
|
||||
}
|
||||
|
||||
const Utf8StringVector &projectPartIds() const
|
||||
{
|
||||
return m_projectPartIds;
|
||||
}
|
||||
|
||||
friend QDataStream &operator<<(QDataStream &out, const ProjectPartsDoNotExistMessage &message)
|
||||
{
|
||||
out << message.m_projectPartIds;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
friend QDataStream &operator>>(QDataStream &in, ProjectPartsDoNotExistMessage &message)
|
||||
{
|
||||
in >> message.m_projectPartIds;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
friend bool operator==(const ProjectPartsDoNotExistMessage &first, const ProjectPartsDoNotExistMessage &second)
|
||||
{
|
||||
return first.m_projectPartIds == second.m_projectPartIds;
|
||||
}
|
||||
|
||||
private:
|
||||
Utf8StringVector m_projectPartIds;
|
||||
};
|
||||
|
||||
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const ProjectPartsDoNotExistMessage &message);
|
||||
std::ostream &operator<<(std::ostream &os, const ProjectPartsDoNotExistMessage &message);
|
||||
|
||||
DECLARE_MESSAGE(ProjectPartsDoNotExistMessage)
|
||||
} // namespace ClangBackEnd
|
@@ -1,88 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 "filecontainer.h"
|
||||
|
||||
namespace ClangBackEnd {
|
||||
|
||||
class TranslationUnitDoesNotExistMessage
|
||||
{
|
||||
public:
|
||||
TranslationUnitDoesNotExistMessage() = default;
|
||||
TranslationUnitDoesNotExistMessage(const FileContainer &fileContainer)
|
||||
: m_fileContainer(fileContainer)
|
||||
{
|
||||
}
|
||||
|
||||
TranslationUnitDoesNotExistMessage(const Utf8String &filePath, const Utf8String &projectPartId)
|
||||
: m_fileContainer(filePath, projectPartId)
|
||||
{
|
||||
}
|
||||
|
||||
const FileContainer &fileContainer() const
|
||||
{
|
||||
return m_fileContainer;
|
||||
}
|
||||
|
||||
const Utf8String &filePath() const
|
||||
{
|
||||
return m_fileContainer.filePath();
|
||||
}
|
||||
|
||||
const Utf8String &projectPartId() const
|
||||
{
|
||||
return m_fileContainer.projectPartId();
|
||||
}
|
||||
|
||||
friend QDataStream &operator<<(QDataStream &out, const TranslationUnitDoesNotExistMessage &message)
|
||||
{
|
||||
out << message.m_fileContainer;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
friend QDataStream &operator>>(QDataStream &in, TranslationUnitDoesNotExistMessage &message)
|
||||
{
|
||||
in >> message.m_fileContainer;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
friend bool operator==(const TranslationUnitDoesNotExistMessage &first, const TranslationUnitDoesNotExistMessage &second)
|
||||
{
|
||||
return first.m_fileContainer == second.m_fileContainer;
|
||||
}
|
||||
|
||||
private:
|
||||
FileContainer m_fileContainer;
|
||||
};
|
||||
|
||||
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message);
|
||||
std::ostream &operator<<(std::ostream &os, const TranslationUnitDoesNotExistMessage &message);
|
||||
|
||||
DECLARE_MESSAGE(TranslationUnitDoesNotExistMessage)
|
||||
} // namespace ClangBackEnd
|
@@ -47,6 +47,7 @@
|
||||
#include <QSysInfo>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/benchmarker.h>
|
||||
#include <utils/executeondestruction.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
@@ -1559,6 +1560,13 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s
|
||||
qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS);
|
||||
else
|
||||
qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS);
|
||||
if (what && *what == '<') {
|
||||
QString tc;
|
||||
if (spec)
|
||||
tc = spec->name() + '_';
|
||||
tc += QString::fromUtf8(QByteArray(what + 1));
|
||||
Utils::Benchmarker::report("loadPlugins", tc, elapsedMS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1579,6 +1587,7 @@ void PluginManagerPrivate::profilingSummary() const
|
||||
qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it.value()->name()),
|
||||
it.key(), 100.0 * it.key() / total);
|
||||
qDebug("Total: %8dms", total);
|
||||
Utils::Benchmarker::report("loadPlugins", "Total", total);
|
||||
}
|
||||
}
|
||||
|
||||
|
67
src/libs/utils/benchmarker.cpp
Normal file
67
src/libs/utils/benchmarker.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "benchmarker.h"
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
static Q_LOGGING_CATEGORY(benchmarksLog, "qtc.benchmark");
|
||||
|
||||
namespace Utils {
|
||||
|
||||
Benchmarker::Benchmarker(const QString &testsuite, const QString &testcase,
|
||||
const QString &tagData) :
|
||||
m_tagData(tagData),
|
||||
m_testsuite(testsuite),
|
||||
m_testcase(testcase)
|
||||
{
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
Benchmarker::~Benchmarker()
|
||||
{
|
||||
if (m_timer.isValid())
|
||||
report(m_timer.elapsed());
|
||||
}
|
||||
|
||||
void Benchmarker::report(qint64 ms)
|
||||
{
|
||||
m_timer.invalidate();
|
||||
report(m_testsuite, m_testcase, ms, m_tagData);
|
||||
}
|
||||
|
||||
void Benchmarker::report(const QString &testsuite, const QString &testcase, qint64 ms,
|
||||
const QString &tags)
|
||||
{
|
||||
QString t = "unit=ms";
|
||||
if (!tags.isEmpty())
|
||||
t += "," + tags;
|
||||
|
||||
qCDebug(benchmarksLog, "%s::%s: %lld { %s }",
|
||||
testsuite.toUtf8().data(), testcase.toUtf8().data(), ms, t.toUtf8().data());
|
||||
}
|
||||
|
||||
|
||||
} // namespace Utils
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
@@ -23,33 +23,31 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "projectpartsdonotexistmessage.h"
|
||||
#pragma once
|
||||
|
||||
#include <QDebug>
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <ostream>
|
||||
#include <QString>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
namespace ClangBackEnd {
|
||||
namespace Utils {
|
||||
|
||||
QDebug operator<<(QDebug debug, const ProjectPartsDoNotExistMessage &message)
|
||||
class QTCREATOR_UTILS_EXPORT Benchmarker
|
||||
{
|
||||
debug.nospace() << "ProjectPartDoesNotExistMessage(";
|
||||
public:
|
||||
Benchmarker(const QString &testsuite, const QString &testcase,
|
||||
const QString &tags = QString());
|
||||
~Benchmarker();
|
||||
|
||||
debug.nospace() << message.projectPartIds();
|
||||
void report(qint64 ms);
|
||||
static void report(const QString &testsuite, const QString &testcase, qint64 ms,
|
||||
const QString &tags = QString());
|
||||
|
||||
debug.nospace() << ")";
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const ProjectPartsDoNotExistMessage &message)
|
||||
{
|
||||
os << "("
|
||||
<< message.projectPartIds()
|
||||
<< ")";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
private:
|
||||
QElapsedTimer m_timer;
|
||||
QString m_tagData;
|
||||
QString m_testsuite;
|
||||
QString m_testcase;
|
||||
};
|
||||
|
||||
} // namespace Utils
|
@@ -21,7 +21,9 @@ win32: LIBS += -luser32 -lshell32
|
||||
# PortsGatherer
|
||||
win32: LIBS += -liphlpapi -lws2_32
|
||||
|
||||
SOURCES += $$PWD/environment.cpp \
|
||||
SOURCES += \
|
||||
$$PWD/benchmarker.cpp \
|
||||
$$PWD/environment.cpp \
|
||||
$$PWD/environmentmodel.cpp \
|
||||
$$PWD/environmentdialog.cpp \
|
||||
$$PWD/qtcprocess.cpp \
|
||||
@@ -122,6 +124,7 @@ win32:SOURCES += $$PWD/consoleprocess_win.cpp
|
||||
else:SOURCES += $$PWD/consoleprocess_unix.cpp
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/benchmarker.h \
|
||||
$$PWD/environment.h \
|
||||
$$PWD/environmentmodel.h \
|
||||
$$PWD/environmentdialog.h \
|
||||
|
@@ -48,6 +48,8 @@ Project {
|
||||
"appmainwindow.h",
|
||||
"basetreeview.cpp",
|
||||
"basetreeview.h",
|
||||
"benchmarker.cpp",
|
||||
"benchmarker.h",
|
||||
"bracematcher.cpp",
|
||||
"bracematcher.h",
|
||||
"buildablehelperlibrary.cpp",
|
||||
|
@@ -94,9 +94,6 @@ private:
|
||||
void references(const ClangBackEnd::ReferencesMessage &message) override;
|
||||
void followSymbol(const ClangBackEnd::FollowSymbolMessage &message) override;
|
||||
|
||||
void translationUnitDoesNotExist(const ClangBackEnd::TranslationUnitDoesNotExistMessage &) override {}
|
||||
void projectPartsDoNotExist(const ClangBackEnd::ProjectPartsDoNotExistMessage &) override {}
|
||||
|
||||
private:
|
||||
AliveHandler m_aliveHandler;
|
||||
QHash<quint64, ClangCompletionAssistProcessor *> m_assistProcessorsTable;
|
||||
|
@@ -50,7 +50,9 @@ std::unique_ptr<SearchHandle> QtCreatorSearch::startNewSearch(const QString &sea
|
||||
|
||||
QObject::connect(searchResult,
|
||||
&Core::SearchResult::activated,
|
||||
&QtCreatorSearch::openEditor);
|
||||
[](const Core::SearchResultItem& item) {
|
||||
Core::EditorManager::openEditorAtSearchResult(item);
|
||||
});
|
||||
|
||||
auto searchHandle = std::unique_ptr<SearchHandle>(new QtCreatorSearchHandle(searchResult));
|
||||
|
||||
@@ -61,11 +63,4 @@ std::unique_ptr<SearchHandle> QtCreatorSearch::startNewSearch(const QString &sea
|
||||
return searchHandle;
|
||||
}
|
||||
|
||||
void QtCreatorSearch::openEditor(const Core::SearchResultItem &item)
|
||||
{
|
||||
Core::EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
|
||||
item.mainRange.begin.line,
|
||||
item.mainRange.begin.column);
|
||||
}
|
||||
|
||||
} // namespace ClangRefactoring
|
||||
|
@@ -43,9 +43,6 @@ public:
|
||||
std::unique_ptr<SearchHandle> startNewSearch(const QString &searchLabel,
|
||||
const QString &searchTerm);
|
||||
|
||||
private:
|
||||
static void openEditor(const Core::SearchResultItem &item);
|
||||
|
||||
private:
|
||||
Core::SearchResultWindow &searchResultWindow;
|
||||
};
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include <coreplugin/editortoolbar.h>
|
||||
#include <coreplugin/fileutils.h>
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
#include <coreplugin/find/searchresultitem.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/imode.h>
|
||||
#include <coreplugin/infobar.h>
|
||||
@@ -2646,6 +2647,17 @@ IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int colu
|
||||
fileName, line, column, editorId, flags, newEditor);
|
||||
}
|
||||
|
||||
void EditorManager::openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags)
|
||||
{
|
||||
if (item.path.empty()) {
|
||||
openEditor(QDir::fromNativeSeparators(item.text), Id(), flags);
|
||||
return;
|
||||
}
|
||||
|
||||
openEditorAt(QDir::fromNativeSeparators(item.path.first()), item.mainRange.begin.line,
|
||||
item.mainRange.begin.column, Id(), flags);
|
||||
}
|
||||
|
||||
EditorManager::FilePathInfo EditorManager::splitLineAndColumnNumber(const QString &fullFilePath)
|
||||
{
|
||||
// :10:2 GCC/Clang-style
|
||||
|
@@ -50,6 +50,7 @@ class IMode;
|
||||
class IVersionControl;
|
||||
|
||||
class EditorToolBar;
|
||||
class SearchResultItem;
|
||||
|
||||
enum MakeWritableResult {
|
||||
OpenedWithVersionControl,
|
||||
@@ -114,6 +115,7 @@ public:
|
||||
static IEditor *openEditorAt(const QString &fileName, int line, int column = 0,
|
||||
Id editorId = Id(), OpenEditorFlags flags = NoFlags,
|
||||
bool *newEditor = 0);
|
||||
static void openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags = NoFlags);
|
||||
static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = 0,
|
||||
const QByteArray &contents = QByteArray(),
|
||||
const QString &uniqueId = QString(),
|
||||
|
@@ -370,7 +370,9 @@ void CppFindReferences::findAll_helper(SearchResult *search, Symbol *symbol,
|
||||
return;
|
||||
}
|
||||
connect(search, &SearchResult::activated,
|
||||
this, &CppFindReferences::openEditor);
|
||||
[](const SearchResultItem& item) {
|
||||
Core::EditorManager::openEditorAtSearchResult(item);
|
||||
});
|
||||
|
||||
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
const WorkingCopy workingCopy = m_modelManager->workingCopy();
|
||||
@@ -589,18 +591,6 @@ static void searchFinished(SearchResult *search, QFutureWatcher<Usage> *watcher)
|
||||
watcher->deleteLater();
|
||||
}
|
||||
|
||||
void CppFindReferences::openEditor(const SearchResultItem &item)
|
||||
{
|
||||
if (item.path.size() > 0) {
|
||||
EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
|
||||
item.mainRange.begin.line,
|
||||
item.mainRange.begin.column);
|
||||
} else {
|
||||
EditorManager::openEditor(QDir::fromNativeSeparators(item.text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
class FindMacroUsesInFile: public std::unary_function<QString, QList<Usage> >
|
||||
@@ -728,7 +718,9 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro ¯o, const QStri
|
||||
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
|
||||
|
||||
connect(search, &SearchResult::activated,
|
||||
this, &CppFindReferences::openEditor);
|
||||
[](const Core::SearchResultItem& item) {
|
||||
Core::EditorManager::openEditorAtSearchResult(item);
|
||||
});
|
||||
|
||||
const Snapshot snapshot = m_modelManager->snapshot();
|
||||
const WorkingCopy workingCopy = m_modelManager->workingCopy();
|
||||
|
@@ -77,7 +77,6 @@ public:
|
||||
void renameMacroUses(const CPlusPlus::Macro ¯o, const QString &replacement = QString());
|
||||
|
||||
private:
|
||||
void openEditor(const Core::SearchResultItem &item);
|
||||
void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase);
|
||||
void searchAgain();
|
||||
|
||||
|
@@ -78,7 +78,9 @@ SOURCES += $$PWD/model/abstractview.cpp \
|
||||
$$PWD/model/signalhandlerproperty.cpp \
|
||||
$$PWD/model/internalsignalhandlerproperty.cpp \
|
||||
$$PWD/model/anchorline.cpp \
|
||||
$$PWD/instances/puppetdialog.cpp
|
||||
$$PWD/instances/puppetdialog.cpp \
|
||||
$$PWD/model/qmltimelinemutator.cpp \
|
||||
$$PWD/model/qmltimelinekeyframes.cpp
|
||||
|
||||
HEADERS += $$PWD/include/qmldesignercorelib_global.h \
|
||||
$$PWD/include/abstractview.h \
|
||||
@@ -152,7 +154,9 @@ HEADERS += $$PWD/include/qmldesignercorelib_global.h \
|
||||
$$PWD/include/signalhandlerproperty.h \
|
||||
$$PWD/model/internalsignalhandlerproperty.h \
|
||||
$$PWD/include/anchorline.h \
|
||||
$$PWD/instances/puppetdialog.h
|
||||
$$PWD/instances/puppetdialog.h \
|
||||
$$PWD/include/qmltimelinemutator.h \
|
||||
$$PWD/include/qmltimelinekeyframes.h \
|
||||
|
||||
FORMS += \
|
||||
$$PWD/instances/puppetdialog.ui
|
||||
|
@@ -55,6 +55,7 @@ namespace QmlDesigner {
|
||||
class NodeInstanceView;
|
||||
class RewriterView;
|
||||
class QmlModelState;
|
||||
class QmlTimelineMutator;
|
||||
|
||||
enum DesignerWidgetFlags {
|
||||
DisableOnError,
|
||||
@@ -232,6 +233,8 @@ public:
|
||||
|
||||
virtual void documentMessagesChanged(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings);
|
||||
|
||||
virtual void currentTimelineChanged(const ModelNode &node);
|
||||
|
||||
void changeRootNodeType(const TypeName &type, int majorVersion, int minorVersion);
|
||||
|
||||
NodeInstanceView *nodeInstanceView() const;
|
||||
@@ -240,6 +243,7 @@ public:
|
||||
void setCurrentStateNode(const ModelNode &node);
|
||||
ModelNode currentStateNode() const;
|
||||
QmlModelState currentState() const;
|
||||
QmlTimelineMutator currentTimeline() const;
|
||||
|
||||
int majorQtQuickVersion() const;
|
||||
int minorQtQuickVersion() const;
|
||||
@@ -253,6 +257,9 @@ public:
|
||||
|
||||
virtual QString contextHelpId() const;
|
||||
|
||||
void activateTimelineRecording(const ModelNode &mutator);
|
||||
void deactivateTimelineRecording();
|
||||
|
||||
protected:
|
||||
void setModel(Model * model);
|
||||
void removeModel();
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include "qmlmodelnodefacade.h"
|
||||
#include "qmlstate.h"
|
||||
#include "qmltimelinemutator.h"
|
||||
#include "qmlchangeset.h"
|
||||
|
||||
#include <nodeinstance.h>
|
||||
@@ -63,6 +64,7 @@ public:
|
||||
QString validId();
|
||||
|
||||
QmlModelState currentState() const;
|
||||
QmlTimelineMutator currentTimeline() const;
|
||||
void setVariantProperty(const PropertyName &name, const QVariant &value);
|
||||
void setBindingProperty(const PropertyName &name, const QString &expression);
|
||||
NodeAbstractProperty nodeAbstractProperty(const PropertyName &name) const;
|
||||
@@ -83,6 +85,7 @@ public:
|
||||
QString stripedTranslatableText(const PropertyName &name) const;
|
||||
QString expression(const PropertyName &name) const;
|
||||
bool isInBaseState() const;
|
||||
bool timelineIsActive() const;
|
||||
QmlPropertyChanges propertyChangeForCurrentState() const;
|
||||
|
||||
virtual bool instanceCanReparent() const;
|
||||
|
@@ -72,7 +72,6 @@ public:
|
||||
protected:
|
||||
void addChangeSetIfNotExists(const ModelNode &node);
|
||||
static QmlModelState createBaseState(const AbstractView *view);
|
||||
|
||||
};
|
||||
|
||||
} //QmlDesigner
|
||||
|
@@ -23,33 +23,43 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "translationunitdoesnotexistmessage.h"
|
||||
#pragma once
|
||||
|
||||
#include <QDebug>
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include "qmlmodelnodefacade.h"
|
||||
#include "qmlchangeset.h"
|
||||
|
||||
#include <ostream>
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace ClangBackEnd {
|
||||
class AbstractViewAbstractVieweGroup;
|
||||
class QmlObjectNode;
|
||||
|
||||
QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message)
|
||||
class QMLDESIGNERCORE_EXPORT QmlTimelineFrames : public QmlModelNodeFacade
|
||||
{
|
||||
debug.nospace() << "TranslationUnitDoesNotExistMessage(";
|
||||
|
||||
debug.nospace() << message.fileContainer();
|
||||
public:
|
||||
QmlTimelineFrames();
|
||||
QmlTimelineFrames(const ModelNode &modelNode);
|
||||
|
||||
debug.nospace() << ")";
|
||||
bool isValid() const;
|
||||
static bool isValidQmlTimelineFrames(const ModelNode &modelNode);
|
||||
void destroy();
|
||||
|
||||
return debug;
|
||||
}
|
||||
ModelNode target() const;
|
||||
void setTarget(const ModelNode &target);
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const TranslationUnitDoesNotExistMessage &message)
|
||||
{
|
||||
os << "("
|
||||
<< message.fileContainer()
|
||||
<< ")";
|
||||
PropertyName propertyName() const;
|
||||
void setPropertyName(const PropertyName &propertyName);
|
||||
|
||||
return os;
|
||||
}
|
||||
void setValue(const QVariant &value, qreal frame);
|
||||
QVariant value(qreal frame) const;
|
||||
|
||||
} // namespace ClangBackEnd
|
||||
qreal currentFrame() const;
|
||||
|
||||
bool hasKeyframe(qreal frame);
|
||||
|
||||
static bool isValidKeyframe(const ModelNode &node);
|
||||
static QmlTimelineFrames keyframesForKeyframe(const ModelNode &node);
|
||||
};
|
||||
|
||||
} //QmlDesigner
|
@@ -0,0 +1,62 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 <qmldesignercorelib_global.h>
|
||||
#include "qmlmodelnodefacade.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class AbstractViewAbstractVieweGroup;
|
||||
class QmlObjectNode;
|
||||
class QmlModelStateGroup;
|
||||
class QmlTimelineFrames;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT QmlTimelineMutator : public QmlModelNodeFacade
|
||||
{
|
||||
|
||||
public:
|
||||
QmlTimelineMutator();
|
||||
QmlTimelineMutator(const ModelNode &modelNode);
|
||||
|
||||
bool isValid() const;
|
||||
static bool isValidQmlTimelineMutator(const ModelNode &modelNode);
|
||||
void destroy();
|
||||
|
||||
QmlTimelineFrames timelineFrames(const ModelNode &modelNode, const PropertyName &propertyName);
|
||||
bool hasTimeline(const ModelNode &modelNode, const PropertyName &propertyName);
|
||||
|
||||
qreal startFrame() const;
|
||||
qreal endFrame() const;
|
||||
qreal currentFrame() const;
|
||||
|
||||
private:
|
||||
void addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName);
|
||||
bool hasFrames(const ModelNode &node, const PropertyName &propertyName) const;
|
||||
QList<QmlTimelineFrames> frames() const;
|
||||
};
|
||||
|
||||
} //QmlDesigner
|
@@ -43,6 +43,9 @@
|
||||
#include "nodelistproperty.h"
|
||||
#include "nodeproperty.h"
|
||||
#include "qmlchangeset.h"
|
||||
#include "qmlstate.h"
|
||||
#include "qmltimelinemutator.h"
|
||||
#include "qmltimelinekeyframes.h"
|
||||
|
||||
#include "createscenecommand.h"
|
||||
#include "createinstancescommand.h"
|
||||
@@ -651,13 +654,13 @@ void NodeInstanceView::updateChildren(const NodeAbstractProperty &newPropertyPar
|
||||
void setXValue(NodeInstance &instance, const VariantProperty &variantProperty, QMultiHash<ModelNode, InformationName> &informationChangeHash)
|
||||
{
|
||||
instance.setX(variantProperty.value().toDouble());
|
||||
informationChangeHash.insert(variantProperty.parentModelNode(), Transform);
|
||||
informationChangeHash.insert(instance.modelNode(), Transform);
|
||||
}
|
||||
|
||||
void setYValue(NodeInstance &instance, const VariantProperty &variantProperty, QMultiHash<ModelNode, InformationName> &informationChangeHash)
|
||||
{
|
||||
instance.setY(variantProperty.value().toDouble());
|
||||
informationChangeHash.insert(variantProperty.parentModelNode(), Transform);
|
||||
informationChangeHash.insert(instance.modelNode(), Transform);
|
||||
}
|
||||
|
||||
|
||||
@@ -668,7 +671,7 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
|
||||
foreach (const VariantProperty &variantProperty, propertyList) {
|
||||
if (variantProperty.name() == "x") {
|
||||
const ModelNode modelNode = variantProperty.parentModelNode();
|
||||
if (QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
|
||||
if (!currentState().isBaseState() && QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
|
||||
ModelNode targetModelNode = QmlPropertyChanges(modelNode).target();
|
||||
if (targetModelNode.isValid()) {
|
||||
NodeInstance instance = instanceForModelNode(targetModelNode);
|
||||
@@ -680,7 +683,7 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
|
||||
}
|
||||
} else if (variantProperty.name() == "y") {
|
||||
const ModelNode modelNode = variantProperty.parentModelNode();
|
||||
if (QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
|
||||
if (!currentState().isBaseState() && QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
|
||||
ModelNode targetModelNode = QmlPropertyChanges(modelNode).target();
|
||||
if (targetModelNode.isValid()) {
|
||||
NodeInstance instance = instanceForModelNode(targetModelNode);
|
||||
@@ -690,6 +693,21 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
|
||||
NodeInstance instance = instanceForModelNode(modelNode);
|
||||
setYValue(instance, variantProperty, informationChangeHash);
|
||||
}
|
||||
} else if (currentTimeline().isValid()
|
||||
&& variantProperty.name() == "value"
|
||||
&& QmlTimelineFrames::isValidKeyframe(variantProperty.parentModelNode())) {
|
||||
|
||||
QmlTimelineFrames frames = QmlTimelineFrames::keyframesForKeyframe(variantProperty.parentModelNode());
|
||||
|
||||
if (frames.isValid() && frames.propertyName() == "x" && frames.target().isValid()) {
|
||||
|
||||
NodeInstance instance = instanceForModelNode(frames.target());
|
||||
setXValue(instance, variantProperty, informationChangeHash);
|
||||
} else if (frames.isValid() && frames.propertyName() == "y" && frames.target().isValid()) {
|
||||
NodeInstance instance = instanceForModelNode(frames.target());
|
||||
setYValue(instance, variantProperty, informationChangeHash);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "internalnode_p.h"
|
||||
#include "nodeinstanceview.h"
|
||||
#include <qmlstate.h>
|
||||
#include <qmltimelinemutator.h>
|
||||
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
#include <qmldesignerplugin.h>
|
||||
@@ -359,6 +360,11 @@ void AbstractView::documentMessagesChanged(const QList<DocumentMessage> &/*error
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractView::currentTimelineChanged(const ModelNode & /*node*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QList<ModelNode> AbstractView::toModelNodeList(const QList<Internal::InternalNode::Pointer> &nodeList) const
|
||||
{
|
||||
return QmlDesigner::toModelNodeList(nodeList, const_cast<AbstractView*>(this));
|
||||
@@ -565,6 +571,21 @@ QString AbstractView::contextHelpId() const
|
||||
return helpId;
|
||||
}
|
||||
|
||||
void AbstractView::activateTimelineRecording(const ModelNode &mutator)
|
||||
{
|
||||
Internal::WriteLocker locker(m_model.data());
|
||||
if (model())
|
||||
model()->d->notifyCurrentTimelineChanged(mutator);
|
||||
|
||||
}
|
||||
|
||||
void AbstractView::deactivateTimelineRecording()
|
||||
{
|
||||
Internal::WriteLocker locker(m_model.data());
|
||||
if (model())
|
||||
model()->d->notifyCurrentTimelineChanged(ModelNode());
|
||||
}
|
||||
|
||||
QList<ModelNode> AbstractView::allModelNodes() const
|
||||
{
|
||||
return toModelNodeList(model()->d->allNodes());
|
||||
@@ -688,6 +709,16 @@ QmlModelState AbstractView::currentState() const
|
||||
return QmlModelState(currentStateNode());
|
||||
}
|
||||
|
||||
QmlTimelineMutator AbstractView::currentTimeline() const
|
||||
{
|
||||
if (model())
|
||||
return QmlTimelineMutator(ModelNode(m_model.data()->d->currentTimelineNode(),
|
||||
m_model.data(),
|
||||
const_cast<AbstractView*>(this)));
|
||||
|
||||
return QmlTimelineMutator();
|
||||
}
|
||||
|
||||
static int getMinorVersionFromImport(const Model *model)
|
||||
{
|
||||
foreach (const Import &import, model->imports()) {
|
||||
|
@@ -85,6 +85,7 @@ ModelPrivate::ModelPrivate(Model *model) :
|
||||
{
|
||||
m_rootInternalNode = createNode("QtQuick.Item", 1, 0, PropertyListType(), PropertyListType(), QString(), ModelNode::NodeWithoutSource,true);
|
||||
m_currentStateNode = m_rootInternalNode;
|
||||
m_currentTimelineMutatorNode = m_rootInternalNode;
|
||||
}
|
||||
|
||||
ModelPrivate::~ModelPrivate()
|
||||
@@ -641,6 +642,33 @@ void ModelPrivate::notifyCurrentStateChanged(const ModelNode &node)
|
||||
resetModelByRewriter(description);
|
||||
}
|
||||
|
||||
void ModelPrivate::notifyCurrentTimelineChanged(const ModelNode &node)
|
||||
{
|
||||
bool resetModel = false;
|
||||
QString description;
|
||||
|
||||
m_currentTimelineMutatorNode = node.internalNode();
|
||||
|
||||
try {
|
||||
if (rewriterView())
|
||||
rewriterView()->currentTimelineChanged(ModelNode(node.internalNode(), model(), rewriterView()));
|
||||
} catch (const RewritingException &e) {
|
||||
description = e.description();
|
||||
resetModel = true;
|
||||
}
|
||||
|
||||
for (const QPointer<AbstractView> &view : m_viewList) {
|
||||
Q_ASSERT(view != 0);
|
||||
view->currentTimelineChanged(ModelNode(node.internalNode(), model(), view.data()));
|
||||
}
|
||||
|
||||
if (nodeInstanceView())
|
||||
nodeInstanceView()->currentTimelineChanged(ModelNode(node.internalNode(), model(), nodeInstanceView()));
|
||||
|
||||
if (resetModel)
|
||||
resetModelByRewriter(description);
|
||||
}
|
||||
|
||||
void ModelPrivate::notifyRewriterBeginTransaction()
|
||||
{
|
||||
bool resetModel = false;
|
||||
@@ -1707,6 +1735,11 @@ NodeInstanceView *ModelPrivate::nodeInstanceView() const
|
||||
return m_nodeInstanceView.data();
|
||||
}
|
||||
|
||||
InternalNodePointer ModelPrivate::currentTimelineNode() const
|
||||
{
|
||||
return m_currentTimelineMutatorNode;
|
||||
}
|
||||
|
||||
InternalNodePointer ModelPrivate::nodeForId(const QString &id) const
|
||||
{
|
||||
return m_idNodeHash.value(id);
|
||||
|
@@ -157,6 +157,7 @@ public:
|
||||
void notifyInstanceToken(const QString &token, int number, const QVector<ModelNode> &nodeVector);
|
||||
|
||||
void notifyCurrentStateChanged(const ModelNode &node);
|
||||
void notifyCurrentTimelineChanged(const ModelNode &node);
|
||||
|
||||
void setDocumentMessages(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings);
|
||||
|
||||
@@ -226,6 +227,7 @@ public:
|
||||
NodeInstanceView *nodeInstanceView() const;
|
||||
|
||||
InternalNodePointer currentStateNode() const;
|
||||
InternalNodePointer currentTimelineNode() const;
|
||||
|
||||
private: //functions
|
||||
void removePropertyWithoutNotification(const InternalPropertyPointer &property);
|
||||
@@ -249,6 +251,7 @@ private:
|
||||
QSet<InternalNodePointer> m_nodeSet;
|
||||
InternalNodePointer m_currentStateNode;
|
||||
InternalNodePointer m_rootInternalNode;
|
||||
InternalNodePointer m_currentTimelineMutatorNode;
|
||||
QUrl m_fileUrl;
|
||||
QPointer<RewriterView> m_rewriterView;
|
||||
QPointer<NodeInstanceView> m_nodeInstanceView;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "qmlobjectnode.h"
|
||||
#include "qmlitemnode.h"
|
||||
#include "qmlstate.h"
|
||||
#include "qmltimelinekeyframes.h"
|
||||
#include "variantproperty.h"
|
||||
#include "nodeproperty.h"
|
||||
#include <invalidmodelnodeexception.h>
|
||||
@@ -48,6 +49,19 @@ void QmlObjectNode::setVariantProperty(const PropertyName &name, const QVariant
|
||||
if (!isValid())
|
||||
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
|
||||
|
||||
if (timelineIsActive()) {
|
||||
modelNode().validId();
|
||||
|
||||
QmlTimelineFrames timelineFrames(currentTimeline().timelineFrames(modelNode(), name));
|
||||
|
||||
Q_ASSERT(timelineFrames.isValid());
|
||||
|
||||
qreal frame = currentTimeline().modelNode().auxiliaryData("currentFrame@NodeInstance").toReal();
|
||||
timelineFrames.setValue(value, frame);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (isInBaseState()) {
|
||||
modelNode().variantProperty(name).setValue(value); //basestate
|
||||
} else {
|
||||
@@ -83,6 +97,14 @@ QmlModelState QmlObjectNode::currentState() const
|
||||
return QmlModelState();
|
||||
}
|
||||
|
||||
QmlTimelineMutator QmlObjectNode::currentTimeline() const
|
||||
{
|
||||
if (isValid())
|
||||
return view()->currentTimeline();
|
||||
else
|
||||
return QmlTimelineMutator();
|
||||
}
|
||||
|
||||
bool QmlObjectNode::isRootModelNode() const
|
||||
{
|
||||
return modelNode().isRootNode();
|
||||
@@ -161,6 +183,9 @@ bool QmlObjectNode::propertyAffectedByCurrentState(const PropertyName &name) con
|
||||
if (currentState().isBaseState())
|
||||
return modelNode().hasProperty(name);
|
||||
|
||||
if (timelineIsActive() && currentTimeline().hasTimeline(modelNode(), name))
|
||||
return true;
|
||||
|
||||
if (!currentState().hasPropertyChanges(modelNode()))
|
||||
return false;
|
||||
|
||||
@@ -172,6 +197,21 @@ QVariant QmlObjectNode::modelValue(const PropertyName &name) const
|
||||
if (!isValid())
|
||||
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
|
||||
|
||||
if (timelineIsActive() && currentTimeline().hasTimeline(modelNode(), name)) {
|
||||
QmlTimelineFrames timelineFrames(currentTimeline().timelineFrames(modelNode(), name));
|
||||
|
||||
Q_ASSERT(timelineFrames.isValid());
|
||||
|
||||
qreal frame = currentTimeline().modelNode().auxiliaryData("currentFrame@NodeInstance").toReal();
|
||||
|
||||
QVariant value = timelineFrames.value(frame);
|
||||
|
||||
if (!value.isValid()) //interpolation is not done in the model
|
||||
value = instanceValue(name);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if (currentState().isBaseState())
|
||||
return modelNode().variantProperty(name).value();
|
||||
|
||||
@@ -239,6 +279,11 @@ bool QmlObjectNode::isInBaseState() const
|
||||
return currentState().isBaseState();
|
||||
}
|
||||
|
||||
bool QmlObjectNode::timelineIsActive() const
|
||||
{
|
||||
return currentTimeline().isValid();
|
||||
}
|
||||
|
||||
bool QmlObjectNode::instanceCanReparent() const
|
||||
{
|
||||
return isInBaseState();
|
||||
|
@@ -0,0 +1,147 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qmltimelinekeyframes.h"
|
||||
#include "abstractview.h"
|
||||
#include <nodelistproperty.h>
|
||||
#include <variantproperty.h>
|
||||
#include <metainfo.h>
|
||||
#include <invalidmodelnodeexception.h>
|
||||
#include "bindingproperty.h"
|
||||
#include "qmlitemnode.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
QmlTimelineFrames::QmlTimelineFrames()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QmlTimelineFrames::QmlTimelineFrames(const ModelNode &modelNode) : QmlModelNodeFacade(modelNode)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool QmlTimelineFrames::isValid() const
|
||||
{
|
||||
return isValidQmlTimelineFrames(modelNode());
|
||||
}
|
||||
|
||||
bool QmlTimelineFrames::isValidQmlTimelineFrames(const ModelNode &modelNode)
|
||||
{
|
||||
return isValidQmlModelNodeFacade(modelNode)
|
||||
&& modelNode.metaInfo().isValid()
|
||||
&& modelNode.metaInfo().isSubclassOf("QtQuick.Timeline.Keyframes");
|
||||
}
|
||||
|
||||
void QmlTimelineFrames::destroy()
|
||||
{
|
||||
Q_ASSERT(isValid());
|
||||
modelNode().destroy();
|
||||
}
|
||||
|
||||
ModelNode QmlTimelineFrames::target() const
|
||||
{
|
||||
if (modelNode().property("target").isBindingProperty())
|
||||
return modelNode().bindingProperty("target").resolveToModelNode();
|
||||
else
|
||||
return ModelNode(); //exception?
|
||||
}
|
||||
|
||||
void QmlTimelineFrames::setTarget(const ModelNode &target)
|
||||
{
|
||||
modelNode().bindingProperty("target").setExpression(target.id());
|
||||
}
|
||||
|
||||
|
||||
PropertyName QmlTimelineFrames::propertyName() const
|
||||
{
|
||||
return modelNode().variantProperty("property").value().toString().toUtf8();
|
||||
}
|
||||
|
||||
void QmlTimelineFrames::setPropertyName(const PropertyName &propertyName)
|
||||
{
|
||||
modelNode().variantProperty("property").setValue(QString::fromUtf8(propertyName));
|
||||
}
|
||||
|
||||
void QmlTimelineFrames::setValue(const QVariant &value, qreal currentFrame)
|
||||
{
|
||||
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (qFuzzyCompare(childNode.variantProperty("frame").value().toReal(), currentFrame)) {
|
||||
childNode.variantProperty("value").setValue(value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const QList<QPair<PropertyName, QVariant> > propertyPairList{{PropertyName("frame"), QVariant(currentFrame)},
|
||||
{PropertyName("value"), value}};
|
||||
|
||||
ModelNode frame = modelNode().view()->createModelNode("QtQuick.Timeline.Keyframe", 1, 0, propertyPairList);
|
||||
modelNode().defaultNodeListProperty().reparentHere(frame);
|
||||
}
|
||||
|
||||
QVariant QmlTimelineFrames::value(qreal frame) const
|
||||
{
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (qFuzzyCompare(childNode.variantProperty("frame").value().toReal(), frame)) {
|
||||
return childNode.variantProperty("value").value();
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
bool QmlTimelineFrames::hasKeyframe(qreal frame)
|
||||
{
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (qFuzzyCompare(childNode.variantProperty("frame").value().toReal(), frame))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QmlTimelineFrames::isValidKeyframe(const ModelNode &node)
|
||||
{
|
||||
return isValidQmlModelNodeFacade(node)
|
||||
&& node.metaInfo().isValid()
|
||||
&& node.metaInfo().isSubclassOf("QtQuick.Timeline.Keyframe");
|
||||
}
|
||||
|
||||
QmlTimelineFrames QmlTimelineFrames::keyframesForKeyframe(const ModelNode &node)
|
||||
{
|
||||
if (isValidKeyframe(node) && node.hasParentProperty()) {
|
||||
const QmlTimelineFrames timeline(node.parentProperty().parentModelNode());
|
||||
if (timeline.isValid())
|
||||
return timeline;
|
||||
}
|
||||
|
||||
return QmlTimelineFrames();
|
||||
}
|
||||
|
||||
} // QmlDesigner
|
@@ -0,0 +1,167 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qmltimelinemutator.h"
|
||||
#include "qmltimelinekeyframes.h"
|
||||
#include "abstractview.h"
|
||||
#include <nodelistproperty.h>
|
||||
#include <variantproperty.h>
|
||||
#include <nodelistproperty.h>
|
||||
#include <metainfo.h>
|
||||
#include <invalidmodelnodeexception.h>
|
||||
#include "bindingproperty.h"
|
||||
#include "qmlitemnode.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
QmlTimelineMutator::QmlTimelineMutator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QmlTimelineMutator::QmlTimelineMutator(const ModelNode &modelNode) : QmlModelNodeFacade(modelNode)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool QmlTimelineMutator::isValid() const
|
||||
{
|
||||
return isValidQmlTimelineMutator(modelNode());
|
||||
}
|
||||
|
||||
bool QmlTimelineMutator::isValidQmlTimelineMutator(const ModelNode &modelNode)
|
||||
{
|
||||
return isValidQmlModelNodeFacade(modelNode)
|
||||
&& modelNode.metaInfo().isValid()
|
||||
&& modelNode.metaInfo().isSubclassOf("QtQuick.Timeline.KeyframeMutator");
|
||||
}
|
||||
|
||||
void QmlTimelineMutator::destroy()
|
||||
{
|
||||
Q_ASSERT(isValid());
|
||||
modelNode().destroy();
|
||||
}
|
||||
|
||||
QmlTimelineFrames QmlTimelineMutator::timelineFrames(const ModelNode &node, const PropertyName &propertyName)
|
||||
{
|
||||
if (isValid()) {
|
||||
addFramesIfNotExists(node, propertyName);
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) {
|
||||
const QmlTimelineFrames frames(childNode);
|
||||
|
||||
if (frames.target().isValid()
|
||||
&& frames.target() == node
|
||||
&& frames.propertyName() == propertyName)
|
||||
return frames;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QmlTimelineFrames(); //not found
|
||||
}
|
||||
|
||||
bool QmlTimelineMutator::hasTimeline(const ModelNode &node, const PropertyName &propertyName)
|
||||
{
|
||||
if (isValid()) {
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) {
|
||||
const QmlTimelineFrames frames(childNode);
|
||||
|
||||
if (frames.target().isValid()
|
||||
&& frames.target() == node
|
||||
&& frames.propertyName() == propertyName)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
qreal QmlTimelineMutator::startFrame() const
|
||||
{
|
||||
if (isValid())
|
||||
return QmlObjectNode(modelNode()).instanceValue("startFrame").toReal();
|
||||
return 0;
|
||||
}
|
||||
|
||||
qreal QmlTimelineMutator::endFrame() const
|
||||
{
|
||||
if (isValid())
|
||||
return QmlObjectNode(modelNode()).instanceValue("endFrame").toReal();
|
||||
return 0;
|
||||
}
|
||||
|
||||
qreal QmlTimelineMutator::currentFrame() const
|
||||
{
|
||||
if (isValid())
|
||||
return QmlObjectNode(modelNode()).instanceValue("currentFrame").toReal();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QmlTimelineMutator::addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName)
|
||||
{
|
||||
if (!isValid())
|
||||
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
|
||||
|
||||
if (!hasFrames(node, propertyName)) {
|
||||
ModelNode frames = modelNode().view()->createModelNode("QtQuick.Timeline.Keyframes", 1, 0);
|
||||
modelNode().defaultNodeListProperty().reparentHere(frames);
|
||||
|
||||
QmlTimelineFrames(frames).setTarget(node);
|
||||
QmlTimelineFrames(frames).setPropertyName(propertyName);
|
||||
|
||||
Q_ASSERT(QmlTimelineFrames::isValidQmlTimelineFrames(frames));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool QmlTimelineMutator::hasFrames(const ModelNode &node, const PropertyName &propertyName) const
|
||||
{
|
||||
for (const QmlTimelineFrames &frames : frames()) {
|
||||
if (frames.target().isValid()
|
||||
&& frames.target() == node
|
||||
&& frames.propertyName() == propertyName)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QList<QmlTimelineFrames> QmlTimelineMutator::frames() const
|
||||
{
|
||||
QList<QmlTimelineFrames> returnList;
|
||||
|
||||
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
|
||||
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode))
|
||||
returnList.append(QmlTimelineFrames(childNode));
|
||||
}
|
||||
|
||||
return returnList;
|
||||
}
|
||||
|
||||
} // QmlDesigner
|
@@ -181,6 +181,8 @@ bool ChangePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNode
|
||||
{
|
||||
if (m_sheduledInHierarchy) {
|
||||
const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode());
|
||||
if (nodeLocation < 0)
|
||||
return true;
|
||||
bool result = false;
|
||||
|
||||
if (m_property.isDefaultProperty()) {
|
||||
|
@@ -280,6 +280,8 @@ Project {
|
||||
"include/subcomponentmanager.h",
|
||||
"include/textmodifier.h",
|
||||
"include/variantproperty.h",
|
||||
"include/qmltimelinekeyframes.h",
|
||||
"include/qmltimelinemutator.h",
|
||||
"instances/nodeinstance.cpp",
|
||||
"instances/nodeinstanceserverproxy.cpp",
|
||||
"instances/nodeinstanceserverproxy.h",
|
||||
@@ -357,6 +359,8 @@ Project {
|
||||
"model/texttomodelmerger.h",
|
||||
"model/variantproperty.cpp",
|
||||
"model/viewmanager.cpp",
|
||||
"model/qmltimelinekeyframes.cpp",
|
||||
"model/qmltimelinemutator.cpp",
|
||||
"pluginmanager/widgetpluginmanager.cpp",
|
||||
"pluginmanager/widgetpluginmanager.h",
|
||||
"pluginmanager/widgetpluginpath.cpp",
|
||||
|
@@ -959,7 +959,9 @@ void FindReferences::displayResults(int first, int last)
|
||||
this, &FindReferences::onReplaceButtonClicked);
|
||||
}
|
||||
connect(m_currentSearch.data(), &SearchResult::activated,
|
||||
this, &FindReferences::openEditor);
|
||||
[](const Core::SearchResultItem& item) {
|
||||
Core::EditorManager::openEditorAtSearchResult(item);
|
||||
});
|
||||
connect(m_currentSearch.data(), &SearchResult::cancelled, this, &FindReferences::cancel);
|
||||
connect(m_currentSearch.data(), &SearchResult::paused, this, &FindReferences::setPaused);
|
||||
SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
|
||||
@@ -1005,17 +1007,6 @@ void FindReferences::setPaused(bool paused)
|
||||
m_watcher.setPaused(paused);
|
||||
}
|
||||
|
||||
void FindReferences::openEditor(const SearchResultItem &item)
|
||||
{
|
||||
if (item.path.size() > 0) {
|
||||
EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
|
||||
item.mainRange.begin.line,
|
||||
item.mainRange.begin.column);
|
||||
} else {
|
||||
EditorManager::openEditor(QDir::fromNativeSeparators(item.text));
|
||||
}
|
||||
}
|
||||
|
||||
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<SearchResultItem> &items, bool preserveCase)
|
||||
{
|
||||
const QStringList fileNames = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase);
|
||||
|
@@ -82,7 +82,6 @@ private:
|
||||
void searchFinished();
|
||||
void cancel();
|
||||
void setPaused(bool paused);
|
||||
void openEditor(const Core::SearchResultItem &item);
|
||||
void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase);
|
||||
|
||||
QPointer<Core::SearchResult> m_currentSearch;
|
||||
|
@@ -448,16 +448,8 @@ void BaseFileFind::openEditor(const SearchResultItem &item)
|
||||
FileFindParameters parameters = result->userData().value<FileFindParameters>();
|
||||
IEditor *openedEditor =
|
||||
d->m_searchEngines[parameters.searchEngineIndex]->openEditor(item, parameters);
|
||||
if (!openedEditor) {
|
||||
if (item.path.size() > 0) {
|
||||
openedEditor = EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
|
||||
item.mainRange.begin.line,
|
||||
item.mainRange.begin.column, Id(),
|
||||
EditorManager::DoNotSwitchToDesignMode);
|
||||
} else {
|
||||
openedEditor = EditorManager::openEditor(QDir::fromNativeSeparators(item.text));
|
||||
}
|
||||
}
|
||||
if (!openedEditor)
|
||||
EditorManager::openEditorAtSearchResult(item, EditorManager::DoNotSwitchToDesignMode);
|
||||
if (d->m_currentFindSupport)
|
||||
d->m_currentFindSupport->clearHighlights();
|
||||
d->m_currentFindSupport = 0;
|
||||
|
@@ -3,10 +3,11 @@ LLVM_INSTALL_DIR = $$clean_path($$LLVM_INSTALL_DIR)
|
||||
isEmpty(LLVM_INSTALL_DIR): error("No LLVM_INSTALL_DIR provided")
|
||||
!exists($$LLVM_INSTALL_DIR): error("LLVM_INSTALL_DIR does not exist: $$LLVM_INSTALL_DIR")
|
||||
|
||||
defineReplace(extractVersion) { return($$replace(1, ^(\\d+\\.\\d+\\.\\d+)\\w*$, \\1)) }
|
||||
defineReplace(extractMajorVersion) { return($$replace(1, ^(\\d+)\\.\\d+\\.\\d+\\w*$, \\1)) }
|
||||
defineReplace(extractMinorVersion) { return($$replace(1, ^\\d+\\.(\\d+)\\.\\d+\\w*$, \\1)) }
|
||||
defineReplace(extractPatchVersion) { return($$replace(1, ^\\d+\\.\\d+\\.(\\d+)\\w*$, \\1)) }
|
||||
# Expected input: "3.9.1", "5.0.0svn", "5.0.1git-81029f14223"
|
||||
defineReplace(extractVersion) { return($$replace(1, ^(\\d+\\.\\d+\\.\\d+).*$, \\1)) }
|
||||
defineReplace(extractMajorVersion) { return($$replace(1, ^(\\d+)\\.\\d+\\.\\d+.*$, \\1)) }
|
||||
defineReplace(extractMinorVersion) { return($$replace(1, ^\\d+\\.(\\d+)\\.\\d+.*$, \\1)) }
|
||||
defineReplace(extractPatchVersion) { return($$replace(1, ^\\d+\\.\\d+\\.(\\d+).*$, \\1)) }
|
||||
|
||||
defineTest(versionIsAtLeast) {
|
||||
actual_major_version = $$extractMajorVersion($$1)
|
||||
|
@@ -41,7 +41,7 @@ IAsyncJob::AsyncPrepareResult CreateInitialDocumentPreambleJob::prepareAsyncRun(
|
||||
const TranslationUnitUpdateInput updateInput = m_pinnedDocument.createUpdateInput();
|
||||
setRunner([translationUnit, updateInput]() {
|
||||
TIME_SCOPE_DURATION("CreateInitialDocumentPreambleJobRunner");
|
||||
return translationUnit.reparse(updateInput);
|
||||
translationUnit.reparse(updateInput);
|
||||
});
|
||||
|
||||
return AsyncPrepareResult{translationUnit.id()};
|
||||
|
@@ -35,7 +35,7 @@ def main():
|
||||
createNewQtQuickApplication(tempDir(), "SampleApp")
|
||||
# create syntax error in qml file
|
||||
openDocument("SampleApp.Resources.qml\.qrc./.main\\.qml")
|
||||
if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "TextEdit {", "SyntaxError"):
|
||||
if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "Window {", "SyntaxError"):
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
# save all to invoke qml parsing
|
||||
|
@@ -20,7 +20,7 @@ win32 {
|
||||
LIBS += $$LIBTOOLING_LIBS $$LIBCLANG_LIBS
|
||||
QMAKE_RPATHDIR += $$LLVM_LIBDIR
|
||||
|
||||
LLVM_CXXFLAGS ~= s,-g,
|
||||
LLVM_CXXFLAGS ~= s,-g\d?,
|
||||
QMAKE_CXXFLAGS += $$LLVM_CXXFLAGS
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,6 @@
|
||||
|
||||
#include <clangcodemodelclientproxy.h>
|
||||
#include <clangcodemodelserverproxy.h>
|
||||
#include <projectpartsdonotexistmessage.h>
|
||||
|
||||
#include <clangcodemodelservermessages.h>
|
||||
|
||||
@@ -226,29 +225,6 @@ TEST_F(ClientServerInProcess, UpdateVisibleTranslationUnitsMessage)
|
||||
scheduleServerMessages();
|
||||
}
|
||||
|
||||
TEST_F(ClientServerInProcess, SendTranslationUnitDoesNotExistMessage)
|
||||
{
|
||||
ClangBackEnd::TranslationUnitDoesNotExistMessage message(fileContainer);
|
||||
|
||||
EXPECT_CALL(mockClangCodeModelClient, translationUnitDoesNotExist(message))
|
||||
.Times(1);
|
||||
|
||||
clientProxy.translationUnitDoesNotExist(message);
|
||||
scheduleClientMessages();
|
||||
}
|
||||
|
||||
|
||||
TEST_F(ClientServerInProcess, SendProjectPartDoesNotExistMessage)
|
||||
{
|
||||
ClangBackEnd::ProjectPartsDoNotExistMessage message({Utf8StringLiteral("projectId")});
|
||||
|
||||
EXPECT_CALL(mockClangCodeModelClient, projectPartsDoNotExist(message))
|
||||
.Times(1);
|
||||
|
||||
clientProxy.projectPartsDoNotExist(message);
|
||||
scheduleClientMessages();
|
||||
}
|
||||
|
||||
TEST_F(ClientServerInProcess, SendDocumentAnnotationsChangedMessage)
|
||||
{
|
||||
ClangBackEnd::HighlightingMarkContainer highlightingMark(1, 1, 1, ClangBackEnd::HighlightingType::Keyword);
|
||||
|
@@ -35,8 +35,6 @@ public:
|
||||
void alive() override {}
|
||||
void echo(const ClangBackEnd::EchoMessage &) override {}
|
||||
void codeCompleted(const ClangBackEnd::CodeCompletedMessage &) override {}
|
||||
void translationUnitDoesNotExist(const ClangBackEnd::TranslationUnitDoesNotExistMessage &) override {}
|
||||
void projectPartsDoNotExist(const ClangBackEnd::ProjectPartsDoNotExistMessage &) override {}
|
||||
void documentAnnotationsChanged(const ClangBackEnd::DocumentAnnotationsChangedMessage &) override {}
|
||||
void references(const ClangBackEnd::ReferencesMessage &) override {}
|
||||
void followSymbol(const ClangBackEnd::FollowSymbolMessage &) override {}
|
||||
|
@@ -39,10 +39,6 @@ public:
|
||||
void(const ClangBackEnd::EchoMessage &message));
|
||||
MOCK_METHOD1(codeCompleted,
|
||||
void(const ClangBackEnd::CodeCompletedMessage &message));
|
||||
MOCK_METHOD1(translationUnitDoesNotExist,
|
||||
void(const ClangBackEnd::TranslationUnitDoesNotExistMessage &message));
|
||||
MOCK_METHOD1(projectPartsDoNotExist,
|
||||
void(const ClangBackEnd::ProjectPartsDoNotExistMessage &message));
|
||||
MOCK_METHOD1(documentAnnotationsChanged,
|
||||
void(const ClangBackEnd::DocumentAnnotationsChangedMessage &message));
|
||||
MOCK_METHOD1(references,
|
||||
|
Reference in New Issue
Block a user