TextEditor: Rename BaseTextEditorWidget to TextEditorWidget

... and some of the related implementation details

Change-Id: I1f03aa5acf2d3fb2cfc2a6a7845f3d3578b0408d
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
hjk
2014-09-26 11:37:54 +02:00
committed by David Schulz
parent cfaa30d0b9
commit 10c8d5f0ca
137 changed files with 825 additions and 827 deletions

View File

@@ -352,7 +352,7 @@ bool QmlJSAssistProposalItem::prematurelyApplies(const QChar &c) const
|| (text().endsWith(QLatin1Char('.')) && c == QLatin1Char('.'));
}
void QmlJSAssistProposalItem::applyContextualContent(BaseTextEditorWidget *editorWidget,
void QmlJSAssistProposalItem::applyContextualContent(TextEditorWidget *editorWidget,
int basePosition) const
{
const int currentPosition = editorWidget->position();

View File

@@ -56,7 +56,7 @@ class QmlJSAssistProposalItem : public TextEditor::AssistProposalItem
{
public:
bool prematurelyApplies(const QChar &c) const Q_DECL_OVERRIDE;
void applyContextualContent(TextEditor::BaseTextEditorWidget *editorWidget,
void applyContextualContent(TextEditor::TextEditorWidget *editorWidget,
int basePosition) const Q_DECL_OVERRIDE;
};

View File

@@ -487,7 +487,7 @@ void QmlJSEditorWidget::setSelectedElements()
void QmlJSEditorWidget::applyFontSettings()
{
BaseTextEditorWidget::applyFontSettings();
TextEditorWidget::applyFontSettings();
if (!m_qmlJsEditorDocument->isSemanticInfoOutdated())
updateUses();
}
@@ -553,10 +553,10 @@ void QmlJSEditorWidget::createToolBar()
connect(this, &QmlJSEditorWidget::cursorPositionChanged,
&m_updateOutlineIndexTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
insertExtraToolBarWidget(BaseTextEditorWidget::Left, m_outlineCombo);
insertExtraToolBarWidget(TextEditorWidget::Left, m_outlineCombo);
}
BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor,
TextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &cursor,
bool /*resolveTarget*/,
bool /*inNextSplit*/)
{
@@ -573,7 +573,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs
// if it's a file import, link to the file
foreach (const ImportInfo &import, semanticInfo.document->bind()->imports()) {
if (import.ast() == importAst && import.type() == ImportType::File) {
BaseTextEditorWidget::Link link(import.path());
TextEditorWidget::Link link(import.path());
link.linkTextStart = importAst->firstSourceLocation().begin();
link.linkTextEnd = importAst->lastSourceLocation().end();
return link;
@@ -585,7 +585,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs
// string literals that could refer to a file link to them
if (StringLiteral *literal = cast<StringLiteral *>(node)) {
const QString &text = literal->value.toString();
BaseTextEditorWidget::Link link;
TextEditorWidget::Link link;
link.linkTextStart = literal->literalToken.begin();
link.linkTextEnd = literal->literalToken.end();
if (semanticInfo.snapshot.document(text)) {
@@ -611,7 +611,7 @@ BaseTextEditorWidget::Link QmlJSEditorWidget::findLinkAt(const QTextCursor &curs
if (! (value && value->getSourceLocation(&fileName, &line, &column)))
return Link();
BaseTextEditorWidget::Link link;
TextEditorWidget::Link link;
link.targetFileName = fileName;
link.targetLine = line;
link.targetColumn = column - 1; // adjust the column
@@ -738,7 +738,7 @@ bool QmlJSEditorWidget::event(QEvent *e)
break;
}
return BaseTextEditorWidget::event(e);
return TextEditorWidget::event(e);
}
@@ -748,7 +748,7 @@ void QmlJSEditorWidget::wheelEvent(QWheelEvent *event)
if (m_contextPane && m_contextPane->widget()->isVisible())
visible = true;
BaseTextEditorWidget::wheelEvent(event);
TextEditorWidget::wheelEvent(event);
if (visible)
m_contextPane->apply(this, m_qmlJsEditorDocument->semanticInfo().document, 0,
@@ -758,13 +758,13 @@ void QmlJSEditorWidget::wheelEvent(QWheelEvent *event)
void QmlJSEditorWidget::resizeEvent(QResizeEvent *event)
{
BaseTextEditorWidget::resizeEvent(event);
TextEditorWidget::resizeEvent(event);
hideContextPane();
}
void QmlJSEditorWidget::scrollContentsBy(int dx, int dy)
{
BaseTextEditorWidget::scrollContentsBy(dx, dy);
TextEditorWidget::scrollContentsBy(dx, dy);
hideContextPane();
}
@@ -858,7 +858,7 @@ QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const
return QLatin1String("id: ") + objectId + QLatin1String("...");
}
return TextEditor::BaseTextEditorWidget::foldReplacementText(block);
return TextEditor::TextEditorWidget::foldReplacementText(block);
}

View File

@@ -59,7 +59,7 @@ class FindReferences;
namespace Internal {
class QmlJSEditorWidget : public TextEditor::BaseTextEditorWidget
class QmlJSEditorWidget : public TextEditor::TextEditorWidget
{
Q_OBJECT
@@ -106,7 +106,7 @@ protected:
void scrollContentsBy(int dx, int dy);
void applyFontSettings();
void createToolBar();
TextEditor::BaseTextEditorWidget::Link findLinkAt(const QTextCursor &cursor,
TextEditor::TextEditorWidget::Link findLinkAt(const QTextCursor &cursor,
bool resolveTarget = true,
bool inNextSplit = false);
QString foldReplacementText(const QTextBlock &block) const;
@@ -148,7 +148,7 @@ public:
bool isDesignModePreferred() const;
};
class QmlJSEditorFactory : public TextEditor::BaseTextEditorFactory
class QmlJSEditorFactory : public TextEditor::TextEditorFactory
{
Q_OBJECT

View File

@@ -180,7 +180,7 @@ bool QmlJSHoverHandler::setQmlTypeHelp(const ScopeChain &scopeChain, const Docum
return true;
}
void QmlJSHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int pos)
void QmlJSHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos)
{
reset();
@@ -256,7 +256,7 @@ void QmlJSHoverHandler::identifyMatch(BaseTextEditorWidget *editorWidget, int po
bool QmlJSHoverHandler::matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos)
{
foreach (const QTextEdit::ExtraSelection &sel,
qmlEditor->extraSelections(BaseTextEditorWidget::CodeWarningsSelection)) {
qmlEditor->extraSelections(TextEditorWidget::CodeWarningsSelection)) {
if (pos >= sel.cursor.selectionStart() && pos <= sel.cursor.selectionEnd()) {
setToolTip(sel.format.toolTip());
return true;
@@ -372,7 +372,7 @@ void QmlJSHoverHandler::reset()
m_colorTip = QColor();
}
void QmlJSHoverHandler::operateTooltip(BaseTextEditorWidget *editorWidget, const QPoint &point)
void QmlJSHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point)
{
if (toolTip().isEmpty())
Utils::ToolTip::hide();

View File

@@ -66,8 +66,8 @@ private:
void reset();
bool acceptEditor(Core::IEditor *editor);
void identifyMatch(TextEditor::BaseTextEditorWidget *editorWidget, int pos);
void operateTooltip(TextEditor::BaseTextEditorWidget *editorWidget, const QPoint &point);
void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos);
void operateTooltip(TextEditor::TextEditorWidget *editorWidget, const QPoint &point);
bool matchDiagnosticMessage(QmlJSEditorWidget *qmlEditor, int pos);
bool matchColorItem(const QmlJS::ScopeChain &lookupContext,

View File

@@ -115,7 +115,7 @@ QuickToolBar::~QuickToolBar()
m_widget = 0;
}
void QuickToolBar::apply(TextEditor::BaseTextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force)
void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force)
{
if (!QuickToolBarSettings::get().enableContextPane && !force && !update) {
contextWidget()->hide();
@@ -245,7 +245,7 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorWidget *editorWidget, Documen
}
bool QuickToolBar::isAvailable(TextEditor::BaseTextEditorWidget *, Document::Ptr document, AST::Node *node)
bool QuickToolBar::isAvailable(TextEditor::TextEditorWidget *, Document::Ptr document, AST::Node *node)
{
if (document.isNull())
return false;

View File

@@ -45,8 +45,8 @@ class QuickToolBar : public QmlJS::IContextPane
public:
QuickToolBar(QObject *parent = 0);
~QuickToolBar();
void apply(TextEditor::BaseTextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false);
bool isAvailable(TextEditor::BaseTextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node);
void apply(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, const QmlJS::ScopeChain *scopeChain, QmlJS::AST::Node *node, bool update, bool force = false);
bool isAvailable(TextEditor::TextEditorWidget *widget, QmlJS::Document::Ptr document, QmlJS::AST::Node *node);
void setProperty(const QString &propertyName, const QVariant &value);
void removeProperty(const QString &propertyName);
void setEnabled(bool);
@@ -66,7 +66,7 @@ private:
QPointer<QmlEditorWidgets::ContextPaneWidget> m_widget;
QmlJS::Document::Ptr m_doc;
QmlJS::AST::Node *m_node;
TextEditor::BaseTextEditorWidget *m_editorWidget;
TextEditor::TextEditorWidget *m_editorWidget;
bool m_blockWriting;
QStringList m_propertyOrder;
QStringList m_prototypes;