forked from qt-creator/qt-creator
Revert "QmlDesigner: Keep possible imports updated"
This reverts commit a9619b53f3
Reason for revert: broke stop puppet debugging feature
Change-Id: I88cf4ca7503a6bd7c3d8309cd7c3220428d07a20
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -190,7 +190,6 @@ protected: // functions
|
|||||||
private: //variables
|
private: //variables
|
||||||
ModelNode nodeAtTextCursorPositionHelper(const ModelNode &root, int cursorPosition) const;
|
ModelNode nodeAtTextCursorPositionHelper(const ModelNode &root, int cursorPosition) const;
|
||||||
void setupCanonicalHashes() const;
|
void setupCanonicalHashes() const;
|
||||||
void handleLibraryInfoUpdate();
|
|
||||||
|
|
||||||
TextModifier *m_textModifier = nullptr;
|
TextModifier *m_textModifier = nullptr;
|
||||||
int transactionLevel = 0;
|
int transactionLevel = 0;
|
||||||
@@ -211,7 +210,6 @@ private: //variables
|
|||||||
std::function<void(bool)> m_setWidgetStatusCallback;
|
std::function<void(bool)> m_setWidgetStatusCallback;
|
||||||
bool m_hasIncompleteTypeInformation = false;
|
bool m_hasIncompleteTypeInformation = false;
|
||||||
bool m_restoringAuxData = false;
|
bool m_restoringAuxData = false;
|
||||||
bool m_modelAttachPending = false;
|
|
||||||
|
|
||||||
mutable QHash<int, ModelNode> m_canonicalIntModelNode;
|
mutable QHash<int, ModelNode> m_canonicalIntModelNode;
|
||||||
mutable QHash<ModelNode, int> m_canonicalModelNodeInt;
|
mutable QHash<ModelNode, int> m_canonicalModelNodeInt;
|
||||||
|
@@ -72,12 +72,7 @@ RewriterView::RewriterView(DifferenceHandling differenceHandling, QObject *paren
|
|||||||
m_textToModelMerger(new Internal::TextToModelMerger(this))
|
m_textToModelMerger(new Internal::TextToModelMerger(this))
|
||||||
{
|
{
|
||||||
m_amendTimer.setSingleShot(true);
|
m_amendTimer.setSingleShot(true);
|
||||||
m_amendTimer.setInterval(400);
|
|
||||||
connect(&m_amendTimer, &QTimer::timeout, this, &RewriterView::amendQmlText);
|
connect(&m_amendTimer, &QTimer::timeout, this, &RewriterView::amendQmlText);
|
||||||
|
|
||||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
|
||||||
connect(modelManager, &QmlJS::ModelManagerInterface::libraryInfoUpdated,
|
|
||||||
this, &RewriterView::handleLibraryInfoUpdate, Qt::QueuedConnection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RewriterView::~RewriterView() = default;
|
RewriterView::~RewriterView() = default;
|
||||||
@@ -94,8 +89,6 @@ Internal::TextToModelMerger *RewriterView::textToModelMerger() const
|
|||||||
|
|
||||||
void RewriterView::modelAttached(Model *model)
|
void RewriterView::modelAttached(Model *model)
|
||||||
{
|
{
|
||||||
m_modelAttachPending = false;
|
|
||||||
|
|
||||||
if (model && model->textModifier())
|
if (model && model->textModifier())
|
||||||
setTextModifier(model->textModifier());
|
setTextModifier(model->textModifier());
|
||||||
|
|
||||||
@@ -109,12 +102,10 @@ void RewriterView::modelAttached(Model *model)
|
|||||||
if (!(m_errors.isEmpty() && m_warnings.isEmpty()))
|
if (!(m_errors.isEmpty() && m_warnings.isEmpty()))
|
||||||
notifyErrorsAndWarnings(m_errors);
|
notifyErrorsAndWarnings(m_errors);
|
||||||
|
|
||||||
if (hasIncompleteTypeInformation()) {
|
if (hasIncompleteTypeInformation())
|
||||||
m_modelAttachPending = true;
|
|
||||||
QTimer::singleShot(1000, this, [this, model](){
|
QTimer::singleShot(1000, this, [this, model](){
|
||||||
modelAttached(model);
|
modelAttached(model);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RewriterView::modelAboutToBeDetached(Model * /*model*/)
|
void RewriterView::modelAboutToBeDetached(Model * /*model*/)
|
||||||
@@ -812,13 +803,6 @@ void RewriterView::setupCanonicalHashes() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RewriterView::handleLibraryInfoUpdate()
|
|
||||||
{
|
|
||||||
// Trigger dummy amend to reload document when library info changes
|
|
||||||
if (isAttached() && !m_modelAttachPending)
|
|
||||||
m_amendTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
ModelNode RewriterView::nodeAtTextCursorPosition(int cursorPosition) const
|
ModelNode RewriterView::nodeAtTextCursorPosition(int cursorPosition) const
|
||||||
{
|
{
|
||||||
return nodeAtTextCursorPositionHelper(rootModelNode(), cursorPosition);
|
return nodeAtTextCursorPositionHelper(rootModelNode(), cursorPosition);
|
||||||
@@ -1021,7 +1005,7 @@ void RewriterView::qmlTextChanged()
|
|||||||
auto &viewManager = QmlDesignerPlugin::instance()->viewManager();
|
auto &viewManager = QmlDesignerPlugin::instance()->viewManager();
|
||||||
if (viewManager.usesRewriterView(this)) {
|
if (viewManager.usesRewriterView(this)) {
|
||||||
QmlDesignerPlugin::instance()->viewManager().disableWidgets();
|
QmlDesignerPlugin::instance()->viewManager().disableWidgets();
|
||||||
m_amendTimer.start();
|
m_amendTimer.start(400);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/*Keep test synchronous*/
|
/*Keep test synchronous*/
|
||||||
|
Reference in New Issue
Block a user