forked from qt-creator/qt-creator
C++: Set property on CppEditorWidget when in function link.
To allow FakeVim to pick up on the state and pass through Enter/Return. Change-Id: Ia203a1b3fa8877d90cbaf4b46183bb01a6de1362 Reviewed-on: http://codereview.qt.nokia.com/3856 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -2207,6 +2207,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
|
|||||||
{
|
{
|
||||||
abortDeclDefLink();
|
abortDeclDefLink();
|
||||||
m_declDefLink = link;
|
m_declDefLink = link;
|
||||||
|
setProperty(Constants::FUNCTION_DECL_DEF_LINK_PROPERTY_NAME, true);
|
||||||
|
|
||||||
// disable the link if content of the target editor changes
|
// disable the link if content of the target editor changes
|
||||||
TextEditor::BaseTextEditorWidget *targetEditor =
|
TextEditor::BaseTextEditorWidget *targetEditor =
|
||||||
@@ -2222,7 +2223,7 @@ void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
|||||||
if (!m_declDefLink)
|
if (!m_declDefLink)
|
||||||
return;
|
return;
|
||||||
m_declDefLink->apply(this, jumpToMatch);
|
m_declDefLink->apply(this, jumpToMatch);
|
||||||
m_declDefLink.clear();
|
abortDeclDefLink();
|
||||||
updateFunctionDeclDefLink();
|
updateFunctionDeclDefLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2239,6 +2240,7 @@ void CPPEditorWidget::abortDeclDefLink()
|
|||||||
this, SLOT(abortDeclDefLink()));
|
this, SLOT(abortDeclDefLink()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setProperty(Constants::FUNCTION_DECL_DEF_LINK_PROPERTY_NAME, false);
|
||||||
m_declDefLink->hideMarker(this);
|
m_declDefLink->hideMarker(this);
|
||||||
m_declDefLink.clear();
|
m_declDefLink.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ const char * const WIZARD_TR_CATEGORY = QT_TRANSLATE_NOOP("CppEditor", "C++");
|
|||||||
|
|
||||||
const char * const CPP_SNIPPETS_GROUP_ID = "C++";
|
const char * const CPP_SNIPPETS_GROUP_ID = "C++";
|
||||||
|
|
||||||
|
const char * const FUNCTION_DECL_DEF_LINK_PROPERTY_NAME = "inCppFunctionDeclDefLink";
|
||||||
|
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
} // namespace CppEditor
|
} // namespace CppEditor
|
||||||
|
|
||||||
|
|||||||
@@ -308,8 +308,6 @@ void FunctionDeclDefLink::apply(CPPEditorWidget *editor, bool jumpToMatch)
|
|||||||
TextEditor::TextContent(
|
TextEditor::TextContent(
|
||||||
tr("Target file was changed, could not apply changes")));
|
tr("Target file was changed, could not apply changes")));
|
||||||
}
|
}
|
||||||
|
|
||||||
hideMarker(editor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|||||||
Reference in New Issue
Block a user