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:
Christian Kamm
2011-08-30 10:05:09 +02:00
committed by hjk
parent 9c1cb774a1
commit 13a2e49dda
3 changed files with 5 additions and 3 deletions

View File

@@ -2207,6 +2207,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
{
abortDeclDefLink();
m_declDefLink = link;
setProperty(Constants::FUNCTION_DECL_DEF_LINK_PROPERTY_NAME, true);
// disable the link if content of the target editor changes
TextEditor::BaseTextEditorWidget *targetEditor =
@@ -2222,7 +2223,7 @@ void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
if (!m_declDefLink)
return;
m_declDefLink->apply(this, jumpToMatch);
m_declDefLink.clear();
abortDeclDefLink();
updateFunctionDeclDefLink();
}
@@ -2239,6 +2240,7 @@ void CPPEditorWidget::abortDeclDefLink()
this, SLOT(abortDeclDefLink()));
}
setProperty(Constants::FUNCTION_DECL_DEF_LINK_PROPERTY_NAME, false);
m_declDefLink->hideMarker(this);
m_declDefLink.clear();
}

View File

@@ -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 FUNCTION_DECL_DEF_LINK_PROPERTY_NAME = "inCppFunctionDeclDefLink";
} // namespace Constants
} // namespace CppEditor

View File

@@ -308,8 +308,6 @@ void FunctionDeclDefLink::apply(CPPEditorWidget *editor, bool jumpToMatch)
TextEditor::TextContent(
tr("Target file was changed, could not apply changes")));
}
hideMarker(editor);
}
template <class T>