forked from qt-creator/qt-creator
Editors: Some renamings to enhance consistency
The base pattern is FooEditor for BaseTextEditor derived classes and FooEditorWidget for BaseTextEditorWidget derived classes. So: CPPEditorWidget -> CppEditorWidget CPPEditorWidgetPrivate -> CppEditorWidgetPrivate ...::EditorWidget -> PythonEditorWidget GLSLTextEditorWidget -> GlslEditorWidget GLSLEditorEditable -> GlslEditor Change-Id: I76d34a3694c2fb35491982d86e83f7e4774c0be6 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -41,7 +41,7 @@ using namespace CPlusPlus;
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
CanonicalSymbol::CanonicalSymbol(CPPEditorWidget *editor,
|
||||
CanonicalSymbol::CanonicalSymbol(CppEditorWidget *editor,
|
||||
const Document::Ptr &document,
|
||||
const Snapshot &snapshot)
|
||||
: m_editorWidget(editor),
|
||||
|
@@ -39,12 +39,12 @@ QT_FORWARD_DECLARE_CLASS(QTextCursor)
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
|
||||
class CanonicalSymbol
|
||||
{
|
||||
public:
|
||||
CanonicalSymbol(CPPEditorWidget *editorWidget,
|
||||
CanonicalSymbol(CppEditorWidget *editorWidget,
|
||||
const CPlusPlus::Document::Ptr &document,
|
||||
const CPlusPlus::Snapshot &snapshot);
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
CPlusPlus::TypeOfExpression &typeOfExpression);
|
||||
|
||||
private:
|
||||
CPPEditorWidget *m_editorWidget;
|
||||
CppEditorWidget *m_editorWidget;
|
||||
|
||||
CPlusPlus::Document::Ptr m_document;
|
||||
CPlusPlus::Snapshot m_snapshot;
|
||||
|
@@ -1369,8 +1369,8 @@ void CppCodeModelInspectorDialog::refresh()
|
||||
dumper.dumpSnapshot(editorSnapshot, editorSnapshotTitle);
|
||||
m_ui->snapshotSelector->addItem(editorSnapshotTitle);
|
||||
}
|
||||
CppEditor::Internal::CPPEditorWidget *cppEditorWidget
|
||||
= qobject_cast<CppEditor::Internal::CPPEditorWidget *>(editor->editorWidget());
|
||||
CppEditor::Internal::CppEditorWidget *cppEditorWidget
|
||||
= qobject_cast<CppEditor::Internal::CppEditorWidget *>(editor->editorWidget());
|
||||
if (cppEditorWidget) {
|
||||
SemanticInfo semanticInfo = cppEditorWidget->semanticInfo();
|
||||
CPlusPlus::Snapshot snapshot;
|
||||
|
@@ -106,7 +106,7 @@ QTimer *newSingleShotTimer(QObject *parent, int msecInterval)
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
CPPEditor::CPPEditor(CPPEditorWidget *editor)
|
||||
CPPEditor::CPPEditor(CppEditorWidget *editor)
|
||||
: BaseTextEditor(editor)
|
||||
{
|
||||
m_context.add(CppEditor::Constants::C_CPPEDITOR);
|
||||
@@ -118,13 +118,13 @@ CPPEditor::CPPEditor(CPPEditorWidget *editor)
|
||||
|
||||
Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder)
|
||||
|
||||
class CPPEditorWidgetPrivate
|
||||
class CppEditorWidgetPrivate
|
||||
{
|
||||
public:
|
||||
CPPEditorWidgetPrivate(CPPEditorWidget *q);
|
||||
CppEditorWidgetPrivate(CppEditorWidget *q);
|
||||
|
||||
public:
|
||||
CPPEditorWidget *q;
|
||||
CppEditorWidget *q;
|
||||
|
||||
QPointer<CppTools::CppModelManagerInterface> m_modelManager;
|
||||
|
||||
@@ -156,7 +156,7 @@ public:
|
||||
QToolButton *m_preprocessorButton;
|
||||
};
|
||||
|
||||
CPPEditorWidgetPrivate::CPPEditorWidgetPrivate(CPPEditorWidget *q)
|
||||
CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
|
||||
: q(q)
|
||||
, m_modelManager(CppModelManagerInterface::instance())
|
||||
, m_cppEditorDocument(qobject_cast<CPPEditorDocument *>(q->baseTextDocument()))
|
||||
@@ -172,22 +172,22 @@ CPPEditorWidgetPrivate::CPPEditorWidgetPrivate(CPPEditorWidget *q)
|
||||
{
|
||||
}
|
||||
|
||||
CPPEditorWidget::CPPEditorWidget(QWidget *parent)
|
||||
CppEditorWidget::CppEditorWidget(QWidget *parent)
|
||||
: TextEditor::BaseTextEditorWidget(new CPPEditorDocument(), parent)
|
||||
{
|
||||
baseTextDocument()->setIndenter(new CppTools::CppQtStyleIndenter);
|
||||
ctor();
|
||||
}
|
||||
|
||||
CPPEditorWidget::CPPEditorWidget(CPPEditorWidget *other)
|
||||
CppEditorWidget::CppEditorWidget(CppEditorWidget *other)
|
||||
: TextEditor::BaseTextEditorWidget(other)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::ctor()
|
||||
void CppEditorWidget::ctor()
|
||||
{
|
||||
d.reset(new CPPEditorWidgetPrivate(this));
|
||||
d.reset(new CppEditorWidgetPrivate(this));
|
||||
|
||||
qRegisterMetaType<SemanticInfo>("CppTools::SemanticInfo");
|
||||
|
||||
@@ -221,30 +221,30 @@ void CPPEditorWidget::ctor()
|
||||
this, SLOT(onLocalRenamingProcessKeyPressNormally(QKeyEvent*)));
|
||||
}
|
||||
|
||||
CPPEditorWidget::~CPPEditorWidget()
|
||||
CppEditorWidget::~CppEditorWidget()
|
||||
{
|
||||
if (d->m_modelManager)
|
||||
d->m_modelManager->deleteCppEditorSupport(editor());
|
||||
}
|
||||
|
||||
CPPEditorDocument *CPPEditorWidget::cppEditorDocument() const
|
||||
CPPEditorDocument *CppEditorWidget::cppEditorDocument() const
|
||||
{
|
||||
return d->m_cppEditorDocument;
|
||||
}
|
||||
|
||||
CppEditorOutline *CPPEditorWidget::outline() const
|
||||
CppEditorOutline *CppEditorWidget::outline() const
|
||||
{
|
||||
return d->m_cppEditorOutline;
|
||||
}
|
||||
|
||||
TextEditor::BaseTextEditor *CPPEditorWidget::createEditor()
|
||||
TextEditor::BaseTextEditor *CppEditorWidget::createEditor()
|
||||
{
|
||||
CPPEditor *editable = new CPPEditor(this);
|
||||
createToolBar(editable);
|
||||
return editable;
|
||||
}
|
||||
|
||||
void CPPEditorWidget::createToolBar(CPPEditor *editor)
|
||||
void CppEditorWidget::createToolBar(CPPEditor *editor)
|
||||
{
|
||||
d->m_updateUsesTimer = newSingleShotTimer(this, UPDATE_USES_INTERVAL);
|
||||
connect(d->m_updateUsesTimer, SIGNAL(timeout()), this, SLOT(updateUsesNow()));
|
||||
@@ -278,7 +278,7 @@ void CPPEditorWidget::createToolBar(CPPEditor *editor)
|
||||
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, d->m_cppEditorOutline->widget());
|
||||
}
|
||||
|
||||
void CPPEditorWidget::paste()
|
||||
void CppEditorWidget::paste()
|
||||
{
|
||||
if (d->m_localRenaming.handlePaste())
|
||||
return;
|
||||
@@ -286,7 +286,7 @@ void CPPEditorWidget::paste()
|
||||
BaseTextEditorWidget::paste();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::cut()
|
||||
void CppEditorWidget::cut()
|
||||
{
|
||||
if (d->m_localRenaming.handlePaste())
|
||||
return;
|
||||
@@ -294,7 +294,7 @@ void CPPEditorWidget::cut()
|
||||
BaseTextEditorWidget::cut();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::selectAll()
|
||||
void CppEditorWidget::selectAll()
|
||||
{
|
||||
if (d->m_localRenaming.handleSelectAll())
|
||||
return;
|
||||
@@ -304,12 +304,12 @@ void CPPEditorWidget::selectAll()
|
||||
|
||||
/// \brief Called by \c CppEditorSupport when the document corresponding to the
|
||||
/// file in this editor is updated.
|
||||
void CPPEditorWidget::onDocumentUpdated()
|
||||
void CppEditorWidget::onDocumentUpdated()
|
||||
{
|
||||
d->m_cppEditorOutline->update();
|
||||
}
|
||||
|
||||
const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Document::Ptr doc) const
|
||||
const Macro *CppEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Document::Ptr doc) const
|
||||
{
|
||||
if (!doc)
|
||||
return 0;
|
||||
@@ -329,7 +329,7 @@ const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Docu
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CPPEditorWidget::findUsages()
|
||||
void CppEditorWidget::findUsages()
|
||||
{
|
||||
if (!d->m_modelManager)
|
||||
return;
|
||||
@@ -348,7 +348,7 @@ void CPPEditorWidget::findUsages()
|
||||
}
|
||||
}
|
||||
|
||||
void CPPEditorWidget::renameUsages(const QString &replacement)
|
||||
void CppEditorWidget::renameUsages(const QString &replacement)
|
||||
{
|
||||
if (!d->m_modelManager)
|
||||
return;
|
||||
@@ -367,7 +367,7 @@ void CPPEditorWidget::renameUsages(const QString &replacement)
|
||||
}
|
||||
}
|
||||
|
||||
void CPPEditorWidget::markSymbolsNow()
|
||||
void CppEditorWidget::markSymbolsNow()
|
||||
{
|
||||
QTC_ASSERT(d->m_referencesWatcher, return);
|
||||
if (!d->m_referencesWatcher->isCanceled()
|
||||
@@ -417,7 +417,7 @@ static QList<int> lazyFindReferences(Scope *scope, QString code, Document::Ptr d
|
||||
return QList<int>();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &info)
|
||||
void CppEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &info)
|
||||
{
|
||||
d->m_localRenaming.stop();
|
||||
|
||||
@@ -482,7 +482,7 @@ void CPPEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &inf
|
||||
}
|
||||
}
|
||||
|
||||
void CPPEditorWidget::renameSymbolUnderCursor()
|
||||
void CppEditorWidget::renameSymbolUnderCursor()
|
||||
{
|
||||
if (!d->m_modelManager)
|
||||
return;
|
||||
@@ -494,7 +494,7 @@ void CPPEditorWidget::renameSymbolUnderCursor()
|
||||
renameUsages(); // Rename non-local symbol or macro
|
||||
}
|
||||
|
||||
void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int charsAdded)
|
||||
void CppEditorWidget::onContentsChanged(int position, int charsRemoved, int charsAdded)
|
||||
{
|
||||
Q_UNUSED(position)
|
||||
Q_UNUSED(charsAdded)
|
||||
@@ -503,7 +503,7 @@ void CPPEditorWidget::onContentsChanged(int position, int charsRemoved, int char
|
||||
updateUses();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::updatePreprocessorButtonTooltip()
|
||||
void CppEditorWidget::updatePreprocessorButtonTooltip()
|
||||
{
|
||||
QTC_ASSERT(d->m_preprocessorButton, return);
|
||||
Core::Command *cmd = Core::ActionManager::command(Constants::OPEN_PREPROCESSOR_DIALOG);
|
||||
@@ -511,7 +511,7 @@ void CPPEditorWidget::updatePreprocessorButtonTooltip()
|
||||
d->m_preprocessorButton->setToolTip(cmd->action()->toolTip());
|
||||
}
|
||||
|
||||
QList<QTextEdit::ExtraSelection> CPPEditorWidget::createSelectionsFromUses(
|
||||
QList<QTextEdit::ExtraSelection> CppEditorWidget::createSelectionsFromUses(
|
||||
const QList<SemanticInfo::Use> &uses)
|
||||
{
|
||||
QList<QTextEdit::ExtraSelection> result;
|
||||
@@ -540,14 +540,14 @@ QList<QTextEdit::ExtraSelection> CPPEditorWidget::createSelectionsFromUses(
|
||||
return result;
|
||||
}
|
||||
|
||||
void CPPEditorWidget::updateUses()
|
||||
void CppEditorWidget::updateUses()
|
||||
{
|
||||
// Block premature semantic info calculation when editor is created.
|
||||
if (d->m_modelManager && d->m_modelManager->cppEditorSupport(editor())->initialized())
|
||||
d->m_updateUsesTimer->start();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::updateUsesNow()
|
||||
void CppEditorWidget::updateUsesNow()
|
||||
{
|
||||
if (d->m_localRenaming.isActive())
|
||||
return;
|
||||
@@ -555,7 +555,7 @@ void CPPEditorWidget::updateUsesNow()
|
||||
semanticRehighlight();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::highlightSymbolUsages(int from, int to)
|
||||
void CppEditorWidget::highlightSymbolUsages(int from, int to)
|
||||
{
|
||||
if (editorRevision() != d->m_highlightRevision)
|
||||
return; // outdated
|
||||
@@ -570,7 +570,7 @@ void CPPEditorWidget::highlightSymbolUsages(int from, int to)
|
||||
highlighter, d->m_highlightWatcher->future(), from, to, d->m_semanticHighlightFormatMap);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::finishHighlightSymbolUsages()
|
||||
void CppEditorWidget::finishHighlightSymbolUsages()
|
||||
{
|
||||
QTC_ASSERT(d->m_highlightWatcher, return);
|
||||
if (!d->m_highlightWatcher->isCanceled()
|
||||
@@ -585,7 +585,7 @@ void CPPEditorWidget::finishHighlightSymbolUsages()
|
||||
d->m_highlightWatcher.reset();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
||||
void CppEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
||||
{
|
||||
if (!d->m_modelManager)
|
||||
return;
|
||||
@@ -618,7 +618,7 @@ void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
||||
}
|
||||
|
||||
// Link to function definition/declaration
|
||||
CPPEditorWidget::Link symbolLink;
|
||||
CppEditorWidget::Link symbolLink;
|
||||
if (functionDeclarationSymbol) {
|
||||
symbolLink = linkToSymbol(symbolFinder()
|
||||
->findMatchingDefinition(functionDeclarationSymbol, d->m_modelManager->snapshot()));
|
||||
@@ -653,14 +653,14 @@ void CPPEditorWidget::switchDeclarationDefinition(bool inNextSplit)
|
||||
openCppEditorAt(symbolLink, inNextSplit != alwaysOpenLinksInNextSplit());
|
||||
}
|
||||
|
||||
QString CPPEditorWidget::identifierUnderCursor(QTextCursor *macroCursor)
|
||||
QString CppEditorWidget::identifierUnderCursor(QTextCursor *macroCursor)
|
||||
{
|
||||
macroCursor->movePosition(QTextCursor::StartOfWord);
|
||||
macroCursor->movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
|
||||
return macroCursor->selectedText();
|
||||
}
|
||||
|
||||
CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, bool resolveTarget,
|
||||
CppEditorWidget::Link CppEditorWidget::findLinkAt(const QTextCursor &cursor, bool resolveTarget,
|
||||
bool inNextSplit)
|
||||
{
|
||||
if (!d->m_modelManager)
|
||||
@@ -673,12 +673,12 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
|
||||
inNextSplit);
|
||||
}
|
||||
|
||||
unsigned CPPEditorWidget::editorRevision() const
|
||||
unsigned CppEditorWidget::editorRevision() const
|
||||
{
|
||||
return document()->revision();
|
||||
}
|
||||
|
||||
bool CPPEditorWidget::isOutdated() const
|
||||
bool CppEditorWidget::isOutdated() const
|
||||
{
|
||||
if (d->m_lastSemanticInfo.revision != editorRevision())
|
||||
return true;
|
||||
@@ -686,12 +686,12 @@ bool CPPEditorWidget::isOutdated() const
|
||||
return false;
|
||||
}
|
||||
|
||||
SemanticInfo CPPEditorWidget::semanticInfo() const
|
||||
SemanticInfo CppEditorWidget::semanticInfo() const
|
||||
{
|
||||
return d->m_lastSemanticInfo;
|
||||
}
|
||||
|
||||
bool CPPEditorWidget::event(QEvent *e)
|
||||
bool CppEditorWidget::event(QEvent *e)
|
||||
{
|
||||
switch (e->type()) {
|
||||
case QEvent::ShortcutOverride:
|
||||
@@ -708,13 +708,13 @@ bool CPPEditorWidget::event(QEvent *e)
|
||||
return BaseTextEditorWidget::event(e);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::performQuickFix(int index)
|
||||
void CppEditorWidget::performQuickFix(int index)
|
||||
{
|
||||
TextEditor::QuickFixOperation::Ptr op = d->m_quickFixes.at(index);
|
||||
op->perform();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
void CppEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
// ### enable
|
||||
// updateSemanticInfo(m_semanticHighlighter->semanticInfo(currentSource()));
|
||||
@@ -770,7 +770,7 @@ void CPPEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
delete menu;
|
||||
}
|
||||
|
||||
void CPPEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
void CppEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
{
|
||||
if (d->m_localRenaming.handleKeyPressEvent(e))
|
||||
return;
|
||||
@@ -783,8 +783,8 @@ void CPPEditorWidget::keyPressEvent(QKeyEvent *e)
|
||||
|
||||
Core::IEditor *CPPEditor::duplicate()
|
||||
{
|
||||
CPPEditorWidget *newEditor = new CPPEditorWidget(
|
||||
qobject_cast<CPPEditorWidget *>(editorWidget()));
|
||||
CppEditorWidget *newEditor = new CppEditorWidget(
|
||||
qobject_cast<CppEditorWidget *>(editorWidget()));
|
||||
CppEditorPlugin::instance()->initializeEditor(newEditor);
|
||||
return newEditor->editor();
|
||||
}
|
||||
@@ -802,7 +802,7 @@ TextEditor::CompletionAssistProvider *CPPEditor::completionAssistProvider()
|
||||
return CppModelManagerInterface::instance()->cppEditorSupport(this)->completionAssistProvider();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::applyFontSettings()
|
||||
void CppEditorWidget::applyFontSettings()
|
||||
{
|
||||
const TextEditor::FontSettings &fs = baseTextDocument()->fontSettings();
|
||||
|
||||
@@ -832,13 +832,13 @@ void CPPEditorWidget::applyFontSettings()
|
||||
semanticRehighlight(true);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
|
||||
void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
|
||||
{
|
||||
CppTools::QtStyleCodeFormatter formatter;
|
||||
formatter.invalidateCache(document());
|
||||
}
|
||||
|
||||
CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
||||
CppEditorWidget::Link CppEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
||||
{
|
||||
if (!symbol)
|
||||
return Link();
|
||||
@@ -858,7 +858,7 @@ CPPEditorWidget::Link CPPEditorWidget::linkToSymbol(CPlusPlus::Symbol *symbol)
|
||||
return Link(filename, line, column);
|
||||
}
|
||||
|
||||
bool CPPEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
|
||||
bool CppEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
|
||||
{
|
||||
if (!link.hasValidTarget())
|
||||
return false;
|
||||
@@ -873,7 +873,7 @@ bool CPPEditorWidget::openCppEditorAt(const Link &link, bool inNextSplit)
|
||||
flags);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::semanticRehighlight(bool force)
|
||||
void CppEditorWidget::semanticRehighlight(bool force)
|
||||
{
|
||||
if (d->m_modelManager) {
|
||||
const CppEditorSupport::ForceReason forceReason = force
|
||||
@@ -883,7 +883,7 @@ void CPPEditorWidget::semanticRehighlight(bool force)
|
||||
}
|
||||
}
|
||||
|
||||
void CPPEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult> *highlighter,
|
||||
void CppEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult> *highlighter,
|
||||
unsigned revision)
|
||||
{
|
||||
d->m_highlightRevision = revision;
|
||||
@@ -897,7 +897,7 @@ void CPPEditorWidget::highlighterStarted(QFuture<TextEditor::HighlightingResult>
|
||||
d->m_highlightWatcher->setFuture(QFuture<TextEditor::HighlightingResult>(*highlighter));
|
||||
}
|
||||
|
||||
void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
void CppEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
{
|
||||
if (semanticInfo.revision != editorRevision()) {
|
||||
// got outdated semantic info
|
||||
@@ -956,7 +956,7 @@ void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
updateFunctionDeclDefLink();
|
||||
}
|
||||
|
||||
TextEditor::IAssistInterface *CPPEditorWidget::createAssistInterface(
|
||||
TextEditor::IAssistInterface *CppEditorWidget::createAssistInterface(
|
||||
TextEditor::AssistKind kind,
|
||||
TextEditor::AssistReason reason) const
|
||||
{
|
||||
@@ -972,25 +972,25 @@ TextEditor::IAssistInterface *CPPEditorWidget::createAssistInterface(
|
||||
} else if (kind == TextEditor::QuickFix) {
|
||||
if (!semanticInfo().doc || isOutdated())
|
||||
return 0;
|
||||
return new CppQuickFixAssistInterface(const_cast<CPPEditorWidget *>(this), reason);
|
||||
return new CppQuickFixAssistInterface(const_cast<CppEditorWidget *>(this), reason);
|
||||
} else {
|
||||
return BaseTextEditorWidget::createAssistInterface(kind, reason);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QSharedPointer<FunctionDeclDefLink> CPPEditorWidget::declDefLink() const
|
||||
QSharedPointer<FunctionDeclDefLink> CppEditorWidget::declDefLink() const
|
||||
{
|
||||
return d->m_declDefLink;
|
||||
}
|
||||
|
||||
void CPPEditorWidget::onRefactorMarkerClicked(const TextEditor::RefactorMarker &marker)
|
||||
void CppEditorWidget::onRefactorMarkerClicked(const TextEditor::RefactorMarker &marker)
|
||||
{
|
||||
if (marker.data.canConvert<FunctionDeclDefLink::Marker>())
|
||||
applyDeclDefLinkChanges(true);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::updateFunctionDeclDefLink()
|
||||
void CppEditorWidget::updateFunctionDeclDefLink()
|
||||
{
|
||||
const int pos = textCursor().selectionStart();
|
||||
|
||||
@@ -1016,7 +1016,7 @@ void CPPEditorWidget::updateFunctionDeclDefLink()
|
||||
d->m_updateFunctionDeclDefLinkTimer->start();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::updateFunctionDeclDefLinkNow()
|
||||
void CppEditorWidget::updateFunctionDeclDefLinkNow()
|
||||
{
|
||||
if (Core::EditorManager::currentEditor() != editor())
|
||||
return;
|
||||
@@ -1038,7 +1038,7 @@ void CPPEditorWidget::updateFunctionDeclDefLinkNow()
|
||||
d->m_declDefLinkFinder->startFindLinkAt(textCursor(), d->m_lastSemanticInfo.doc, snapshot);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefLink> link)
|
||||
void CppEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefLink> link)
|
||||
{
|
||||
abortDeclDefLink();
|
||||
d->m_declDefLink = link;
|
||||
@@ -1052,7 +1052,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
|
||||
|
||||
}
|
||||
|
||||
void CPPEditorWidget::onFilePathChanged()
|
||||
void CppEditorWidget::onFilePathChanged()
|
||||
{
|
||||
QTC_ASSERT(d->m_modelManager, return);
|
||||
QByteArray additionalDirectives;
|
||||
@@ -1072,7 +1072,7 @@ void CPPEditorWidget::onFilePathChanged()
|
||||
d->m_preprocessorButton->update();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
||||
void CppEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
||||
{
|
||||
if (!d->m_declDefLink)
|
||||
return;
|
||||
@@ -1081,12 +1081,12 @@ void CPPEditorWidget::applyDeclDefLinkChanges(bool jumpToMatch)
|
||||
updateFunctionDeclDefLink();
|
||||
}
|
||||
|
||||
FollowSymbolUnderCursor *CPPEditorWidget::followSymbolUnderCursorDelegate()
|
||||
FollowSymbolUnderCursor *CppEditorWidget::followSymbolUnderCursorDelegate()
|
||||
{
|
||||
return d->m_followSymbolUnderCursor.data();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::abortDeclDefLink()
|
||||
void CppEditorWidget::abortDeclDefLink()
|
||||
{
|
||||
if (!d->m_declDefLink)
|
||||
return;
|
||||
@@ -1103,22 +1103,22 @@ void CPPEditorWidget::abortDeclDefLink()
|
||||
d->m_declDefLink.clear();
|
||||
}
|
||||
|
||||
void CPPEditorWidget::onLocalRenamingFinished()
|
||||
void CppEditorWidget::onLocalRenamingFinished()
|
||||
{
|
||||
semanticRehighlight(true);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::onLocalRenamingProcessKeyPressNormally(QKeyEvent *e)
|
||||
void CppEditorWidget::onLocalRenamingProcessKeyPressNormally(QKeyEvent *e)
|
||||
{
|
||||
BaseTextEditorWidget::keyPressEvent(e);
|
||||
}
|
||||
|
||||
QTextCharFormat CPPEditorWidget::textCharFormat(TextEditor::TextStyle category)
|
||||
QTextCharFormat CppEditorWidget::textCharFormat(TextEditor::TextStyle category)
|
||||
{
|
||||
return baseTextDocument()->fontSettings().toTextCharFormat(category);
|
||||
}
|
||||
|
||||
void CPPEditorWidget::showPreProcessorWidget()
|
||||
void CppEditorWidget::showPreProcessorWidget()
|
||||
{
|
||||
const QString &fileName = editor()->document()->filePath();
|
||||
|
||||
|
@@ -50,15 +50,16 @@ namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CppEditorOutline;
|
||||
class CPPEditorWidget;
|
||||
class CPPEditorWidgetPrivate;
|
||||
class CppEditorWidget;
|
||||
class CppEditorWidgetPrivate;
|
||||
class FollowSymbolUnderCursor;
|
||||
|
||||
class CPPEditor : public TextEditor::BaseTextEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CPPEditor(CPPEditorWidget *);
|
||||
CPPEditor(CppEditorWidget *);
|
||||
|
||||
Core::IEditor *duplicate() QTC_OVERRIDE;
|
||||
|
||||
@@ -69,7 +70,7 @@ public:
|
||||
TextEditor::CompletionAssistProvider *completionAssistProvider() QTC_OVERRIDE;
|
||||
};
|
||||
|
||||
class CPPEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
class CppEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -78,9 +79,9 @@ public:
|
||||
static QString identifierUnderCursor(QTextCursor *macroCursor);
|
||||
|
||||
public:
|
||||
CPPEditorWidget(QWidget *parent = 0);
|
||||
CPPEditorWidget(CPPEditorWidget *other);
|
||||
~CPPEditorWidget();
|
||||
CppEditorWidget(QWidget *parent = 0);
|
||||
CppEditorWidget(CppEditorWidget *other);
|
||||
~CppEditorWidget();
|
||||
|
||||
CPPEditorDocument *cppEditorDocument() const;
|
||||
CppEditorOutline *outline() const;
|
||||
@@ -155,7 +156,7 @@ private slots:
|
||||
private:
|
||||
static bool openCppEditorAt(const Link &, bool inNextSplit = false);
|
||||
|
||||
CPPEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
CppEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
void ctor();
|
||||
|
||||
void createToolBar(CPPEditor *editable);
|
||||
@@ -174,7 +175,7 @@ private:
|
||||
const QList<TextEditor::HighlightingResult> &uses);
|
||||
|
||||
private:
|
||||
QScopedPointer<CPPEditorWidgetPrivate> d;
|
||||
QScopedPointer<CppEditorWidgetPrivate> d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -42,14 +42,14 @@
|
||||
|
||||
/*!
|
||||
\class CppEditor::Internal::CppEditorOutline
|
||||
\brief A helper class of CPPEditorWidget that provides the outline model
|
||||
\brief A helper class of CppEditorWidget that provides the outline model
|
||||
and widget, e.g. for the editor's tool bar.
|
||||
|
||||
\internal
|
||||
|
||||
The caller is responsible for deleting the widget returned by widget().
|
||||
|
||||
\sa CppEditor::Internal::CPPEditorWidget
|
||||
\sa CppEditor::Internal::CppEditorWidget
|
||||
*/
|
||||
|
||||
enum { UpdateOutlineIntervalInMs = 500 };
|
||||
@@ -95,7 +95,7 @@ QTimer *newSingleShotTimer(QObject *parent, int msInternal)
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
CppEditorOutline::CppEditorOutline(CPPEditorWidget *editorWidget)
|
||||
CppEditorOutline::CppEditorOutline(CppEditorWidget *editorWidget)
|
||||
: QObject(editorWidget)
|
||||
, m_editorWidget(editorWidget)
|
||||
, m_combo(new Utils::TreeViewComboBox)
|
||||
@@ -249,7 +249,7 @@ void CppEditorOutline::gotoSymbolInEditor()
|
||||
if (!symbol)
|
||||
return;
|
||||
|
||||
const TextEditor::BaseTextEditorWidget::Link &link = CPPEditorWidget::linkToSymbol(symbol);
|
||||
const TextEditor::BaseTextEditorWidget::Link &link = CppEditorWidget::linkToSymbol(symbol);
|
||||
if (!link.hasValidTarget())
|
||||
return;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ namespace Utils { class TreeViewComboBox; }
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
|
||||
class CppEditorOutline : public QObject
|
||||
{
|
||||
@@ -53,7 +53,7 @@ class CppEditorOutline : public QObject
|
||||
Q_DISABLE_COPY(CppEditorOutline)
|
||||
|
||||
public:
|
||||
explicit CppEditorOutline(CPPEditorWidget *editorWidget);
|
||||
explicit CppEditorOutline(CppEditorWidget *editorWidget);
|
||||
|
||||
void update();
|
||||
|
||||
@@ -83,7 +83,7 @@ private:
|
||||
const QModelIndex &rootIndex = QModelIndex()) const;
|
||||
|
||||
private:
|
||||
CPPEditorWidget *m_editorWidget;
|
||||
CppEditorWidget *m_editorWidget;
|
||||
|
||||
Utils::TreeViewComboBox *m_combo; // Not owned
|
||||
CPlusPlus::OverviewModel *m_model;
|
||||
|
@@ -97,7 +97,7 @@ CppEditorFactory::CppEditorFactory(CppEditorPlugin *owner) :
|
||||
|
||||
IEditor *CppEditorFactory::createEditor()
|
||||
{
|
||||
CPPEditorWidget *editor = new CPPEditorWidget();
|
||||
CppEditorWidget *editor = new CppEditorWidget();
|
||||
editor->setRevisionsVisible(true);
|
||||
m_owner->initializeEditor(editor);
|
||||
return editor->editor();
|
||||
@@ -129,7 +129,7 @@ CppEditorPlugin *CppEditorPlugin::instance()
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
void CppEditorPlugin::initializeEditor(CPPEditorWidget *editor)
|
||||
void CppEditorPlugin::initializeEditor(CppEditorWidget *editor)
|
||||
{
|
||||
editor->setLanguageSettingsId(CppTools::Constants::CPP_SETTINGS_ID);
|
||||
TextEditor::TextEditorSettings::initializeEditor(editor);
|
||||
@@ -343,38 +343,38 @@ ExtensionSystem::IPlugin::ShutdownFlag CppEditorPlugin::aboutToShutdown()
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
static CPPEditorWidget *currentCppEditorWidget()
|
||||
static CppEditorWidget *currentCppEditorWidget()
|
||||
{
|
||||
return qobject_cast<CPPEditorWidget*>(EditorManager::currentEditor()->widget());
|
||||
return qobject_cast<CppEditorWidget*>(EditorManager::currentEditor()->widget());
|
||||
}
|
||||
|
||||
void CppEditorPlugin::switchDeclarationDefinition()
|
||||
{
|
||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
editorWidget->switchDeclarationDefinition(/*inNextSplit*/ false);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::openDeclarationDefinitionInNextSplit()
|
||||
{
|
||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
editorWidget->switchDeclarationDefinition(/*inNextSplit*/ true);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::renameSymbolUnderCursor()
|
||||
{
|
||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
editorWidget->renameSymbolUnderCursor();
|
||||
}
|
||||
|
||||
void CppEditorPlugin::findUsages()
|
||||
{
|
||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
editorWidget->findUsages();
|
||||
}
|
||||
|
||||
void CppEditorPlugin::showPreProcessorDialog()
|
||||
{
|
||||
if (CPPEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
if (CppEditorWidget *editorWidget = currentCppEditorWidget())
|
||||
editorWidget->showPreProcessorWidget();
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ namespace TextEditor { class BaseTextEditor; }
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
class CppCodeModelInspectorDialog;
|
||||
class CppQuickFixCollector;
|
||||
class CppQuickFixAssistProvider;
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
ShutdownFlag aboutToShutdown();
|
||||
|
||||
// Connect editor to settings changed signals.
|
||||
void initializeEditor(CPPEditorWidget *editor);
|
||||
void initializeEditor(CppEditorWidget *editor);
|
||||
|
||||
bool sortedOutline() const;
|
||||
|
||||
|
@@ -63,14 +63,14 @@ TestCase::~TestCase()
|
||||
|
||||
bool TestCase::openCppEditor(const QString &fileName,
|
||||
Internal::CPPEditor **editor,
|
||||
Internal::CPPEditorWidget **editorWidget)
|
||||
Internal::CppEditorWidget **editorWidget)
|
||||
{
|
||||
using namespace CppEditor::Internal;
|
||||
if (CPPEditor *e = dynamic_cast<CPPEditor *>(Core::EditorManager::openEditor(fileName))) {
|
||||
if (editor)
|
||||
*editor = e;
|
||||
if (editorWidget) {
|
||||
if (CPPEditorWidget *w = dynamic_cast<CPPEditorWidget *>(e->editorWidget())) {
|
||||
if (CppEditorWidget *w = dynamic_cast<CppEditorWidget *>(e->editorWidget())) {
|
||||
*editorWidget = w;
|
||||
return true;
|
||||
} else {
|
||||
@@ -85,7 +85,7 @@ bool TestCase::openCppEditor(const QString &fileName,
|
||||
}
|
||||
|
||||
CPlusPlus::Document::Ptr TestCase::waitForRehighlightedSemanticDocument(
|
||||
Internal::CPPEditorWidget *editorWidget)
|
||||
Internal::CppEditorWidget *editorWidget)
|
||||
{
|
||||
editorWidget->semanticRehighlight(true);
|
||||
while (editorWidget->semanticInfo().doc.isNull())
|
||||
|
@@ -39,7 +39,7 @@ namespace CppEditor {
|
||||
|
||||
namespace Internal {
|
||||
class CPPEditor;
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
|
||||
namespace Tests {
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
public:
|
||||
int m_cursorPosition;
|
||||
Internal::CPPEditor *m_editor;
|
||||
Internal::CPPEditorWidget *m_editorWidget;
|
||||
Internal::CppEditorWidget *m_editorWidget;
|
||||
};
|
||||
|
||||
class TestCase : public CppTools::Tests::TestCase
|
||||
@@ -64,10 +64,10 @@ public:
|
||||
|
||||
static bool openCppEditor(const QString &fileName,
|
||||
Internal::CPPEditor **editor,
|
||||
Internal::CPPEditorWidget **editorWidget = 0);
|
||||
Internal::CppEditorWidget **editorWidget = 0);
|
||||
|
||||
static CPlusPlus::Document::Ptr waitForRehighlightedSemanticDocument(
|
||||
Internal::CPPEditorWidget *editorWidget);
|
||||
Internal::CppEditorWidget *editorWidget);
|
||||
};
|
||||
|
||||
} // namespace Tests
|
||||
|
@@ -301,7 +301,7 @@ CppDeclarableElement::CppDeclarableElement(Symbol *declaration)
|
||||
}
|
||||
|
||||
tooltip = overview.prettyType(declaration->type(), qualifiedName);
|
||||
link = CPPEditorWidget::linkToSymbol(declaration);
|
||||
link = CppEditorWidget::linkToSymbol(declaration);
|
||||
helpMark = name;
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ namespace CppTools { class CppModelManagerInterface; }
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
class CppElement;
|
||||
|
||||
class CppElementEvaluator
|
||||
|
@@ -306,8 +306,8 @@ inline LookupItem skipForwardDeclarations(const QList<LookupItem> &resolvedSymbo
|
||||
return result;
|
||||
}
|
||||
|
||||
CPPEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
|
||||
CPPEditorWidget *, CPlusPlus::Snapshot snapshot, const CPlusPlus::Document::Ptr &document,
|
||||
CppEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
|
||||
CppEditorWidget *, CPlusPlus::Snapshot snapshot, const CPlusPlus::Document::Ptr &document,
|
||||
SymbolFinder *symbolFinder)
|
||||
{
|
||||
Link result;
|
||||
@@ -365,7 +365,7 @@ CPPEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
|
||||
}
|
||||
|
||||
if (target) {
|
||||
result = CPPEditorWidget::linkToSymbol(target);
|
||||
result = CppEditorWidget::linkToSymbol(target);
|
||||
|
||||
unsigned startLine, startColumn, endLine, endColumn;
|
||||
document->translationUnit()->getTokenStartPosition(name->firstToken(), &startLine,
|
||||
@@ -396,7 +396,7 @@ Symbol *findDefinition(Symbol *symbol, const Snapshot &snapshot, SymbolFinder *s
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
FollowSymbolUnderCursor::FollowSymbolUnderCursor(CPPEditorWidget *widget)
|
||||
FollowSymbolUnderCursor::FollowSymbolUnderCursor(CppEditorWidget *widget)
|
||||
: m_widget(widget)
|
||||
, m_virtualFunctionAssistProvider(new VirtualFunctionAssistProvider)
|
||||
{
|
||||
@@ -592,7 +592,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
||||
const Macro *macro = doc->findMacroDefinitionAt(line);
|
||||
if (macro) {
|
||||
QTextCursor macroCursor = cursor;
|
||||
const QByteArray name = CPPEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
||||
const QByteArray name = CppEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
||||
if (macro->name() == name)
|
||||
return link; //already on definition!
|
||||
} else if (const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1)) {
|
||||
@@ -723,7 +723,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
||||
|
||||
// Handle macro uses
|
||||
QTextCursor macroCursor = cursor;
|
||||
const QByteArray name = CPPEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
||||
const QByteArray name = CppEditorWidget::identifierUnderCursor(¯oCursor).toUtf8();
|
||||
link = findMacroLink(name, documentFromSemanticInfo);
|
||||
if (link.hasValidTarget()) {
|
||||
link.linkTextStart = macroCursor.selectionStart();
|
||||
|
@@ -43,7 +43,7 @@ namespace CppTools { class SymbolFinder; }
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
class VirtualFunctionAssistProvider;
|
||||
|
||||
class FollowSymbolUnderCursor
|
||||
@@ -51,7 +51,7 @@ class FollowSymbolUnderCursor
|
||||
public:
|
||||
typedef TextEditor::BaseTextEditorWidget::Link Link;
|
||||
|
||||
FollowSymbolUnderCursor(CPPEditorWidget *widget);
|
||||
FollowSymbolUnderCursor(CppEditorWidget *widget);
|
||||
~FollowSymbolUnderCursor();
|
||||
|
||||
Link findLink(const QTextCursor &cursor, bool resolveTarget,
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
void setVirtualFunctionAssistProvider(VirtualFunctionAssistProvider *provider);
|
||||
|
||||
private:
|
||||
CPPEditorWidget *m_widget;
|
||||
CppEditorWidget *m_widget;
|
||||
VirtualFunctionAssistProvider *m_virtualFunctionAssistProvider;
|
||||
};
|
||||
|
||||
|
@@ -287,7 +287,7 @@ static bool namesEqual(const Name *n1, const Name *n2)
|
||||
return n1 == n2 || (n1 && n2 && n1->match(n2));
|
||||
}
|
||||
|
||||
void FunctionDeclDefLink::apply(CPPEditorWidget *editor, bool jumpToMatch)
|
||||
void FunctionDeclDefLink::apply(CppEditorWidget *editor, bool jumpToMatch)
|
||||
{
|
||||
Snapshot snapshot = editor->semanticInfo().snapshot;
|
||||
|
||||
@@ -323,7 +323,7 @@ static QList<TextEditor::RefactorMarker> removeMarkersOfType(const QList<TextEdi
|
||||
return result;
|
||||
}
|
||||
|
||||
void FunctionDeclDefLink::hideMarker(CPPEditorWidget *editor)
|
||||
void FunctionDeclDefLink::hideMarker(CppEditorWidget *editor)
|
||||
{
|
||||
if (!hasMarker)
|
||||
return;
|
||||
@@ -332,7 +332,7 @@ void FunctionDeclDefLink::hideMarker(CPPEditorWidget *editor)
|
||||
hasMarker = false;
|
||||
}
|
||||
|
||||
void FunctionDeclDefLink::showMarker(CPPEditorWidget *editor)
|
||||
void FunctionDeclDefLink::showMarker(CppEditorWidget *editor)
|
||||
{
|
||||
if (hasMarker)
|
||||
return;
|
||||
|
@@ -43,7 +43,7 @@
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
class FunctionDeclDefLink;
|
||||
|
||||
class FunctionDeclDefLinkFinder : public QObject
|
||||
@@ -80,9 +80,9 @@ public:
|
||||
bool isValid() const;
|
||||
bool isMarkerVisible() const;
|
||||
|
||||
void apply(CPPEditorWidget *editor, bool jumpToMatch);
|
||||
void hideMarker(CPPEditorWidget *editor);
|
||||
void showMarker(CPPEditorWidget *editor);
|
||||
void apply(CppEditorWidget *editor, bool jumpToMatch);
|
||||
void hideMarker(CppEditorWidget *editor);
|
||||
void showMarker(CppEditorWidget *editor);
|
||||
Utils::ChangeSet changes(const CPlusPlus::Snapshot &snapshot, int targetOffset = -1);
|
||||
|
||||
QTextCursor linkSelection;
|
||||
|
@@ -38,7 +38,7 @@ namespace CppEditor {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
|
||||
class CppHighlighter : public TextEditor::SyntaxHighlighter
|
||||
{
|
||||
|
@@ -67,7 +67,7 @@ public:
|
||||
void setup(const QString &fileName, const QString &filePath)
|
||||
{
|
||||
setText(fileName);
|
||||
m_link = CPPEditorWidget::Link(filePath);
|
||||
m_link = CppEditorWidget::Link(filePath);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -82,7 +82,7 @@ private:
|
||||
Constants::CPPEDITOR_ID);
|
||||
}
|
||||
|
||||
CPPEditorWidget::Link m_link;
|
||||
CppEditorWidget::Link m_link;
|
||||
};
|
||||
|
||||
// CppIncludeHierarchyWidget
|
||||
@@ -138,7 +138,7 @@ void CppIncludeHierarchyWidget::perform()
|
||||
if (!m_editor)
|
||||
return;
|
||||
|
||||
CPPEditorWidget *widget = qobject_cast<CPPEditorWidget *>(m_editor->widget());
|
||||
CppEditorWidget *widget = qobject_cast<CppEditorWidget *>(m_editor->widget());
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
|
@@ -55,7 +55,7 @@ namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditor;
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
class CppInclude;
|
||||
class CppIncludeLabel;
|
||||
class CppIncludeHierarchyModel;
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
void showNoIncludeHierarchyLabel();
|
||||
void showIncludeHierarchy();
|
||||
|
||||
CPPEditorWidget *m_cppEditor;
|
||||
CppEditorWidget *m_cppEditor;
|
||||
CppIncludeHierarchyTreeView *m_treeView;
|
||||
CppIncludeHierarchyModel *m_model;
|
||||
Utils::AnnotatedItemDelegate *m_delegate;
|
||||
|
@@ -36,16 +36,16 @@
|
||||
|
||||
/*!
|
||||
\class CppEditor::Internal::CppLocalRenaming
|
||||
\brief A helper class of CPPEditorWidget that implements renaming local usages.
|
||||
\brief A helper class of CppEditorWidget that implements renaming local usages.
|
||||
|
||||
\internal
|
||||
|
||||
Local use selections must be first set/updated with updateLocalUseSelections().
|
||||
Afterwards the local renaming can be started with start(). The CPPEditorWidget
|
||||
Afterwards the local renaming can be started with start(). The CppEditorWidget
|
||||
can then delegate work related to the local renaming mode to the handle*
|
||||
functions.
|
||||
|
||||
\sa CppEditor::Internal::CPPEditorWidget
|
||||
\sa CppEditor::Internal::CppEditorWidget
|
||||
*/
|
||||
|
||||
namespace {
|
||||
|
@@ -90,7 +90,7 @@ bool CppOutlineFilterModel::filterAcceptsRow(int sourceRow,
|
||||
}
|
||||
|
||||
|
||||
CppOutlineWidget::CppOutlineWidget(CPPEditorWidget *editor) :
|
||||
CppOutlineWidget::CppOutlineWidget(CppEditorWidget *editor) :
|
||||
TextEditor::IOutlineWidget(),
|
||||
m_editor(editor),
|
||||
m_treeView(new CppOutlineTreeView(this)),
|
||||
@@ -193,7 +193,7 @@ bool CppOutlineWidgetFactory::supportsEditor(Core::IEditor *editor) const
|
||||
TextEditor::IOutlineWidget *CppOutlineWidgetFactory::createWidget(Core::IEditor *editor)
|
||||
{
|
||||
CPPEditor *cppEditor = qobject_cast<CPPEditor*>(editor);
|
||||
CPPEditorWidget *cppEditorWidget = qobject_cast<CPPEditorWidget*>(cppEditor->widget());
|
||||
CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget*>(cppEditor->widget());
|
||||
QTC_ASSERT(cppEditorWidget, return 0);
|
||||
|
||||
CppOutlineWidget *widget = new CppOutlineWidget(cppEditorWidget);
|
||||
|
@@ -68,7 +68,7 @@ class CppOutlineWidget : public TextEditor::IOutlineWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CppOutlineWidget(CPPEditorWidget *editor);
|
||||
CppOutlineWidget(CppEditorWidget *editor);
|
||||
|
||||
// IOutlineWidget
|
||||
virtual QList<QAction*> filterMenuActions() const;
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
bool syncCursor();
|
||||
|
||||
private:
|
||||
CPPEditorWidget *m_editor;
|
||||
CppEditorWidget *m_editor;
|
||||
CppOutlineTreeView *m_treeView;
|
||||
CPlusPlus::OverviewModel *m_model;
|
||||
CppOutlineFilterModel *m_proxyModel;
|
||||
|
@@ -251,7 +251,7 @@ private:
|
||||
|
||||
/// Apply the factory on the source and get back the resultIndex'th result or a null pointer.
|
||||
QSharedPointer<TextEditor::QuickFixOperation> QuickFixTestCase::getFix(
|
||||
CppQuickFixFactory *factory, CPPEditorWidget *editorWidget, int resultIndex)
|
||||
CppQuickFixFactory *factory, CppEditorWidget *editorWidget, int resultIndex)
|
||||
{
|
||||
CppQuickFixInterface qfi(new CppQuickFixAssistInterface(editorWidget, ExplicitlyInvoked));
|
||||
TextEditor::QuickFixOperations results;
|
||||
|
@@ -84,7 +84,7 @@ public:
|
||||
CppQuickFixFactory *factory, const QString &incPath);
|
||||
private:
|
||||
QSharedPointer<TextEditor::QuickFixOperation> getFix(CppQuickFixFactory *factory,
|
||||
CPPEditorWidget *editorWidget,
|
||||
CppEditorWidget *editorWidget,
|
||||
int resultIndex = 0);
|
||||
|
||||
private:
|
||||
|
@@ -84,7 +84,7 @@ const IAssistProvider *CppQuickFixAssistProcessor::provider() const
|
||||
// --------------------------
|
||||
// CppQuickFixAssistInterface
|
||||
// --------------------------
|
||||
CppQuickFixAssistInterface::CppQuickFixAssistInterface(CPPEditorWidget *editor,
|
||||
CppQuickFixAssistInterface::CppQuickFixAssistInterface(CppEditorWidget *editor,
|
||||
TextEditor::AssistReason reason)
|
||||
: DefaultAssistInterface(editor->document(), editor->position(),
|
||||
editor->baseTextDocument()->filePath(), reason)
|
||||
@@ -119,7 +119,7 @@ const LookupContext &CppQuickFixAssistInterface::context() const
|
||||
return m_context;
|
||||
}
|
||||
|
||||
CPPEditorWidget *CppQuickFixAssistInterface::editor() const
|
||||
CppEditorWidget *CppQuickFixAssistInterface::editor() const
|
||||
{
|
||||
return m_editor;
|
||||
}
|
||||
|
@@ -47,18 +47,18 @@ typedef QSharedPointer<CppRefactoringFile> CppRefactoringFilePtr;
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
|
||||
class CppQuickFixAssistInterface : public TextEditor::DefaultAssistInterface
|
||||
{
|
||||
public:
|
||||
CppQuickFixAssistInterface(CPPEditorWidget *editor, TextEditor::AssistReason reason);
|
||||
CppQuickFixAssistInterface(CppEditorWidget *editor, TextEditor::AssistReason reason);
|
||||
|
||||
const QList<CPlusPlus::AST *> &path() const;
|
||||
CPlusPlus::Snapshot snapshot() const;
|
||||
CppTools::SemanticInfo semanticInfo() const;
|
||||
const CPlusPlus::LookupContext &context() const;
|
||||
CPPEditorWidget *editor() const;
|
||||
CppEditorWidget *editor() const;
|
||||
|
||||
CppTools::CppRefactoringFilePtr currentFile() const;
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
bool isCursorOn(const CPlusPlus::AST *ast) const;
|
||||
|
||||
private:
|
||||
CPPEditorWidget *m_editor;
|
||||
CppEditorWidget *m_editor;
|
||||
CppTools::SemanticInfo m_semanticInfo;
|
||||
CPlusPlus::Snapshot m_snapshot;
|
||||
CppTools::CppRefactoringFilePtr m_currentFile;
|
||||
|
@@ -4091,7 +4091,7 @@ public:
|
||||
|
||||
void perform()
|
||||
{
|
||||
CPPEditorWidget *editor = assistInterface()->editor();
|
||||
CppEditorWidget *editor = assistInterface()->editor();
|
||||
QSharedPointer<FunctionDeclDefLink> link = editor->declDefLink();
|
||||
if (link == m_link)
|
||||
editor->applyDeclDefLinkChanges(/*don't jump*/false);
|
||||
|
@@ -65,7 +65,7 @@ QStandardItem *itemForClass(const CppClass &cppClass)
|
||||
item->setData(cppClass.qualifiedName, AnnotationRole);
|
||||
item->setData(cppClass.icon, Qt::DecorationRole);
|
||||
QVariant link;
|
||||
link.setValue(CPPEditorWidget::Link(cppClass.link));
|
||||
link.setValue(CppEditorWidget::Link(cppClass.link));
|
||||
item->setData(link, LinkRole);
|
||||
return item;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
void clear()
|
||||
{
|
||||
QLabel::clear();
|
||||
m_link = CPPEditorWidget::Link();
|
||||
m_link = CppEditorWidget::Link();
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
Constants::CPPEDITOR_ID);
|
||||
}
|
||||
|
||||
CPPEditorWidget::Link m_link;
|
||||
CppEditorWidget::Link m_link;
|
||||
};
|
||||
|
||||
// CppTypeHierarchyWidget
|
||||
@@ -174,7 +174,7 @@ void CppTypeHierarchyWidget::perform()
|
||||
if (!editor)
|
||||
return;
|
||||
|
||||
CPPEditorWidget *widget = qobject_cast<CPPEditorWidget *>(editor->widget());
|
||||
CppEditorWidget *widget = qobject_cast<CppEditorWidget *>(editor->widget());
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
|
@@ -56,7 +56,7 @@ class AnnotatedItemDelegate;
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
|
||||
class CPPEditorWidget;
|
||||
class CppEditorWidget;
|
||||
class CppClass;
|
||||
class CppClassLabel;
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
void showTypeHierarchy();
|
||||
void clearTypeHierarchy();
|
||||
|
||||
CPPEditorWidget *m_cppEditor;
|
||||
CppEditorWidget *m_cppEditor;
|
||||
Utils::NavigationTreeView *m_treeView;
|
||||
QWidget *m_hierarchyWidget;
|
||||
QStackedLayout *m_stackLayout;
|
||||
|
@@ -132,7 +132,7 @@ public:
|
||||
{
|
||||
QTC_ASSERT(m_params.function, return 0);
|
||||
|
||||
BasicProposalItem *hintItem = new VirtualFunctionProposalItem(CPPEditorWidget::Link());
|
||||
BasicProposalItem *hintItem = new VirtualFunctionProposalItem(CppEditorWidget::Link());
|
||||
hintItem->setText(QCoreApplication::translate("VirtualFunctionsAssistProcessor",
|
||||
"...searching overrides"));
|
||||
hintItem->setOrder(-1000);
|
||||
@@ -181,7 +181,7 @@ private:
|
||||
|
||||
BasicProposalItem *itemFromFunction(Function *func) const
|
||||
{
|
||||
const CPPEditorWidget::Link link = CPPEditorWidget::linkToSymbol(maybeDefinitionFor(func));
|
||||
const CppEditorWidget::Link link = CppEditorWidget::linkToSymbol(maybeDefinitionFor(func));
|
||||
QString text = m_overview.prettyName(LookupContext::fullyQualifiedName(func));
|
||||
if (func->isPureVirtual())
|
||||
text += QLatin1String(" = 0");
|
||||
|
@@ -92,7 +92,7 @@ public:
|
||||
{
|
||||
public:
|
||||
/// Every Action is expected to undo its changes.
|
||||
virtual void run(CPPEditorWidget *editorWidget) = 0;
|
||||
virtual void run(CppEditorWidget *editorWidget) = 0;
|
||||
virtual ~AbstractAction() {}
|
||||
};
|
||||
typedef QSharedPointer<AbstractAction> ActionPointer;
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
static void undoChangesInAllEditorWidgets();
|
||||
|
||||
/// Execute actions for the current cursor position of editorWidget.
|
||||
static void executeActionsOnEditorWidget(CPPEditorWidget *editorWidget, Actions actions);
|
||||
static void executeActionsOnEditorWidget(CppEditorWidget *editorWidget, Actions actions);
|
||||
|
||||
private:
|
||||
/// Move word camel case wise from current cursor position until given token (not included)
|
||||
@@ -187,7 +187,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti
|
||||
// Open editor
|
||||
QCOMPARE(DocumentModel::openedDocuments().size(), 0);
|
||||
CPPEditor *editor;
|
||||
CPPEditorWidget *editorWidget;
|
||||
CppEditorWidget *editorWidget;
|
||||
QVERIFY(openCppEditor(filePath, &editor, &editorWidget));
|
||||
|
||||
QCOMPARE(DocumentModel::openedDocuments().size(), 1);
|
||||
@@ -276,7 +276,7 @@ void TestActionsTestCase::undoChangesInAllEditorWidgets()
|
||||
}
|
||||
}
|
||||
|
||||
void TestActionsTestCase::executeActionsOnEditorWidget(CPPEditorWidget *editorWidget,
|
||||
void TestActionsTestCase::executeActionsOnEditorWidget(CppEditorWidget *editorWidget,
|
||||
TestActionsTestCase::Actions actions)
|
||||
{
|
||||
foreach (const ActionPointer &action, actions)
|
||||
@@ -291,7 +291,7 @@ void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationU
|
||||
{
|
||||
QVERIFY(translationUnit);
|
||||
QVERIFY(editor);
|
||||
CPPEditorWidget *editorWidget = dynamic_cast<CPPEditorWidget *>(editor->editorWidget());
|
||||
CppEditorWidget *editorWidget = dynamic_cast<CppEditorWidget *>(editor->editorWidget());
|
||||
QVERIFY(editorWidget);
|
||||
|
||||
unsigned line, column;
|
||||
@@ -329,7 +329,7 @@ class NoOpTokenAction : public TestActionsTestCase::AbstractAction
|
||||
{
|
||||
public:
|
||||
/// Do nothing on each token
|
||||
void run(CPPEditorWidget *) {}
|
||||
void run(CppEditorWidget *) {}
|
||||
};
|
||||
|
||||
class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractAction
|
||||
@@ -337,10 +337,10 @@ class FollowSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA
|
||||
public:
|
||||
/// Follow symbol under cursor
|
||||
/// Warning: May block if file does not exists (e.g. a not generated ui_* file).
|
||||
void run(CPPEditorWidget *editorWidget);
|
||||
void run(CppEditorWidget *editorWidget);
|
||||
};
|
||||
|
||||
void FollowSymbolUnderCursorTokenAction::run(CPPEditorWidget *editorWidget)
|
||||
void FollowSymbolUnderCursorTokenAction::run(CppEditorWidget *editorWidget)
|
||||
{
|
||||
// Follow link
|
||||
IEditor *editorBefore = EditorManager::currentEditor();
|
||||
@@ -363,10 +363,10 @@ class SwitchDeclarationDefinitionTokenAction : public TestActionsTestCase::Abstr
|
||||
{
|
||||
public:
|
||||
/// Switch Declaration/Definition on each token
|
||||
void run(CPPEditorWidget *);
|
||||
void run(CppEditorWidget *);
|
||||
};
|
||||
|
||||
void SwitchDeclarationDefinitionTokenAction::run(CPPEditorWidget *)
|
||||
void SwitchDeclarationDefinitionTokenAction::run(CppEditorWidget *)
|
||||
{
|
||||
// Switch Declaration/Definition
|
||||
IEditor *editorBefore = EditorManager::currentEditor();
|
||||
@@ -388,10 +388,10 @@ class FindUsagesTokenAction : public TestActionsTestCase::AbstractAction
|
||||
{
|
||||
public:
|
||||
/// Find Usages on each token
|
||||
void run(CPPEditorWidget *);
|
||||
void run(CppEditorWidget *);
|
||||
};
|
||||
|
||||
void FindUsagesTokenAction::run(CPPEditorWidget *)
|
||||
void FindUsagesTokenAction::run(CppEditorWidget *)
|
||||
{
|
||||
CppEditor::Internal::CppEditorPlugin::instance()->findUsages();
|
||||
QApplication::processEvents();
|
||||
@@ -401,10 +401,10 @@ class RenameSymbolUnderCursorTokenAction : public TestActionsTestCase::AbstractA
|
||||
{
|
||||
public:
|
||||
/// Rename Symbol Under Cursor on each token (Renaming is not applied)
|
||||
void run(CPPEditorWidget *);
|
||||
void run(CppEditorWidget *);
|
||||
};
|
||||
|
||||
void RenameSymbolUnderCursorTokenAction::run(CPPEditorWidget *)
|
||||
void RenameSymbolUnderCursorTokenAction::run(CppEditorWidget *)
|
||||
{
|
||||
CppEditor::Internal::CppEditorPlugin::instance()->renameSymbolUnderCursor();
|
||||
QApplication::processEvents();
|
||||
@@ -414,10 +414,10 @@ class OpenTypeHierarchyTokenAction : public TestActionsTestCase::AbstractAction
|
||||
{
|
||||
public:
|
||||
/// Open Type Hierarchy on each token
|
||||
void run(CPPEditorWidget *);
|
||||
void run(CppEditorWidget *);
|
||||
};
|
||||
|
||||
void OpenTypeHierarchyTokenAction::run(CPPEditorWidget *)
|
||||
void OpenTypeHierarchyTokenAction::run(CppEditorWidget *)
|
||||
{
|
||||
CppEditor::Internal::CppEditorPlugin::instance()->openTypeHierarchy();
|
||||
QApplication::processEvents();
|
||||
@@ -428,10 +428,10 @@ class InvokeCompletionTokenAction : public TestActionsTestCase::AbstractAction
|
||||
public:
|
||||
/// Invoke completion menu on each token.
|
||||
/// Warning: May create tool tip artefacts if focus is lost.
|
||||
void run(CPPEditorWidget *editorWidget);
|
||||
void run(CppEditorWidget *editorWidget);
|
||||
};
|
||||
|
||||
void InvokeCompletionTokenAction::run(CPPEditorWidget *editorWidget)
|
||||
void InvokeCompletionTokenAction::run(CppEditorWidget *editorWidget)
|
||||
{
|
||||
// Invoke assistant and wait until it is finished
|
||||
QEventLoop loop;
|
||||
@@ -454,11 +454,11 @@ class RunAllQuickFixesTokenAction : public TestActionsTestCase::AbstractAction
|
||||
{
|
||||
public:
|
||||
/// Trigger all Quick Fixes and apply the matching ones
|
||||
void run(CPPEditorWidget *editorWidget);
|
||||
void run(CppEditorWidget *editorWidget);
|
||||
};
|
||||
|
||||
// TODO: Some QuickFixes operate on selections.
|
||||
void RunAllQuickFixesTokenAction::run(CPPEditorWidget *editorWidget)
|
||||
void RunAllQuickFixesTokenAction::run(CppEditorWidget *editorWidget)
|
||||
{
|
||||
// Calling editorWidget->invokeAssist(QuickFix) would be not enough
|
||||
// since we also want to execute the ones that match.
|
||||
@@ -497,10 +497,10 @@ void RunAllQuickFixesTokenAction::run(CPPEditorWidget *editorWidget)
|
||||
class SwitchHeaderSourceFileAction : public TestActionsTestCase::AbstractAction
|
||||
{
|
||||
public:
|
||||
void run(CPPEditorWidget *);
|
||||
void run(CppEditorWidget *);
|
||||
};
|
||||
|
||||
void SwitchHeaderSourceFileAction::run(CPPEditorWidget *)
|
||||
void SwitchHeaderSourceFileAction::run(CppEditorWidget *)
|
||||
{
|
||||
// Switch Header/Source
|
||||
IEditor *editorBefore = EditorManager::currentEditor();
|
||||
|
@@ -113,7 +113,7 @@ typedef QByteArray _;
|
||||
class VirtualFunctionTestAssistProvider : public VirtualFunctionAssistProvider
|
||||
{
|
||||
public:
|
||||
VirtualFunctionTestAssistProvider(CPPEditorWidget *editorWidget)
|
||||
VirtualFunctionTestAssistProvider(CppEditorWidget *editorWidget)
|
||||
: m_editorWidget(editorWidget)
|
||||
{}
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
OverrideItemList m_finalItems;
|
||||
|
||||
private:
|
||||
CPPEditorWidget *m_editorWidget;
|
||||
CppEditorWidget *m_editorWidget;
|
||||
};
|
||||
|
||||
class TestDocument;
|
||||
@@ -308,7 +308,7 @@ F2TestCase::F2TestCase(CppEditorAction action,
|
||||
// Trigger the action
|
||||
switch (action) {
|
||||
case FollowSymbolUnderCursorAction: {
|
||||
CPPEditorWidget *widget = initialTestFile->m_editorWidget;
|
||||
CppEditorWidget *widget = initialTestFile->m_editorWidget;
|
||||
FollowSymbolUnderCursor *delegate = widget->followSymbolUnderCursorDelegate();
|
||||
VirtualFunctionAssistProvider *original = delegate->virtualFunctionAssistProvider();
|
||||
|
||||
|
@@ -140,7 +140,7 @@ void Document::addRange(const QTextCursor &cursor, GLSL::Scope *scope)
|
||||
_cursors.append(c);
|
||||
}
|
||||
|
||||
GLSLTextEditorWidget::GLSLTextEditorWidget(QWidget *parent)
|
||||
GlslEditorWidget::GlslEditorWidget(QWidget *parent)
|
||||
: TextEditor::BaseTextEditorWidget(parent)
|
||||
{
|
||||
baseTextDocument()->setId(GLSLEditor::Constants::C_GLSLEDITOR_ID);
|
||||
@@ -148,13 +148,13 @@ GLSLTextEditorWidget::GLSLTextEditorWidget(QWidget *parent)
|
||||
ctor();
|
||||
}
|
||||
|
||||
GLSLTextEditorWidget::GLSLTextEditorWidget(GLSLTextEditorWidget *other)
|
||||
GlslEditorWidget::GlslEditorWidget(GlslEditorWidget *other)
|
||||
: TextEditor::BaseTextEditorWidget(other)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void GLSLTextEditorWidget::ctor()
|
||||
void GlslEditorWidget::ctor()
|
||||
{
|
||||
m_outlineCombo = 0;
|
||||
setParenthesesMatchingEnabled(true);
|
||||
@@ -181,17 +181,17 @@ void GLSLTextEditorWidget::ctor()
|
||||
// }
|
||||
}
|
||||
|
||||
GLSLTextEditorWidget::~GLSLTextEditorWidget()
|
||||
GlslEditorWidget::~GlslEditorWidget()
|
||||
{
|
||||
}
|
||||
|
||||
int GLSLTextEditorWidget::editorRevision() const
|
||||
int GlslEditorWidget::editorRevision() const
|
||||
{
|
||||
//return document()->revision();
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool GLSLTextEditorWidget::isOutdated() const
|
||||
bool GlslEditorWidget::isOutdated() const
|
||||
{
|
||||
// if (m_semanticInfo.revision() != editorRevision())
|
||||
// return true;
|
||||
@@ -199,27 +199,27 @@ bool GLSLTextEditorWidget::isOutdated() const
|
||||
return false;
|
||||
}
|
||||
|
||||
Core::IEditor *GLSLEditorEditable::duplicate()
|
||||
Core::IEditor *GlslEditor::duplicate()
|
||||
{
|
||||
GLSLTextEditorWidget *newEditor = new GLSLTextEditorWidget(
|
||||
qobject_cast<GLSLTextEditorWidget *>(editorWidget()));
|
||||
GlslEditorWidget *newEditor = new GlslEditorWidget(
|
||||
qobject_cast<GlslEditorWidget *>(editorWidget()));
|
||||
TextEditor::TextEditorSettings::initializeEditor(newEditor);
|
||||
return newEditor->editor();
|
||||
}
|
||||
|
||||
bool GLSLEditorEditable::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||
bool GlslEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||
{
|
||||
baseTextDocument()->setMimeType(Core::MimeDatabase::findByFile(QFileInfo(fileName)).type());
|
||||
bool b = TextEditor::BaseTextEditor::open(errorString, fileName, realFileName);
|
||||
return b;
|
||||
}
|
||||
|
||||
TextEditor::CompletionAssistProvider *GLSLEditorEditable::completionAssistProvider()
|
||||
TextEditor::CompletionAssistProvider *GlslEditor::completionAssistProvider()
|
||||
{
|
||||
return ExtensionSystem::PluginManager::getObject<GLSLCompletionAssistProvider>();
|
||||
}
|
||||
|
||||
QString GLSLTextEditorWidget::wordUnderCursor() const
|
||||
QString GlslEditorWidget::wordUnderCursor() const
|
||||
{
|
||||
QTextCursor tc = textCursor();
|
||||
const QChar ch = document()->characterAt(tc.position() - 1);
|
||||
@@ -232,14 +232,14 @@ QString GLSLTextEditorWidget::wordUnderCursor() const
|
||||
return word;
|
||||
}
|
||||
|
||||
TextEditor::BaseTextEditor *GLSLTextEditorWidget::createEditor()
|
||||
TextEditor::BaseTextEditor *GlslEditorWidget::createEditor()
|
||||
{
|
||||
GLSLEditorEditable *editable = new GLSLEditorEditable(this);
|
||||
GlslEditor *editable = new GlslEditor(this);
|
||||
createToolBar(editable);
|
||||
return editable;
|
||||
}
|
||||
|
||||
void GLSLTextEditorWidget::createToolBar(GLSLEditorEditable *editor)
|
||||
void GlslEditorWidget::createToolBar(GlslEditor *editor)
|
||||
{
|
||||
m_outlineCombo = new QComboBox;
|
||||
m_outlineCombo->setMinimumContentsLength(22);
|
||||
@@ -263,12 +263,12 @@ void GLSLTextEditorWidget::createToolBar(GLSLEditorEditable *editor)
|
||||
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, m_outlineCombo);
|
||||
}
|
||||
|
||||
void GLSLTextEditorWidget::updateDocument()
|
||||
void GlslEditorWidget::updateDocument()
|
||||
{
|
||||
m_updateDocumentTimer->start();
|
||||
}
|
||||
|
||||
void GLSLTextEditorWidget::updateDocumentNow()
|
||||
void GlslEditorWidget::updateDocumentNow()
|
||||
{
|
||||
m_updateDocumentTimer->stop();
|
||||
|
||||
@@ -334,7 +334,7 @@ void GLSLTextEditorWidget::updateDocumentNow()
|
||||
}
|
||||
}
|
||||
|
||||
int GLSLTextEditorWidget::languageVariant(const QString &type)
|
||||
int GlslEditorWidget::languageVariant(const QString &type)
|
||||
{
|
||||
int variant = 0;
|
||||
bool isVertex = false;
|
||||
@@ -371,7 +371,7 @@ int GLSLTextEditorWidget::languageVariant(const QString &type)
|
||||
return variant;
|
||||
}
|
||||
|
||||
TextEditor::IAssistInterface *GLSLTextEditorWidget::createAssistInterface(
|
||||
TextEditor::IAssistInterface *GlslEditorWidget::createAssistInterface(
|
||||
TextEditor::AssistKind kind,
|
||||
TextEditor::AssistReason reason) const
|
||||
{
|
||||
|
@@ -49,8 +49,8 @@ class Scope;
|
||||
namespace GLSLEditor {
|
||||
namespace Internal {
|
||||
|
||||
class GLSLEditorEditable;
|
||||
class GLSLTextEditorWidget;
|
||||
class GlslEditor;
|
||||
class GlslEditorWidget;
|
||||
|
||||
class Document
|
||||
{
|
||||
@@ -78,17 +78,17 @@ private:
|
||||
GLSL::Scope *_globalScope;
|
||||
QList<Range> _cursors;
|
||||
|
||||
friend class GLSLTextEditorWidget;
|
||||
friend class GlslEditorWidget;
|
||||
};
|
||||
|
||||
class GLSLTextEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
class GlslEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GLSLTextEditorWidget(QWidget *parent = 0);
|
||||
GLSLTextEditorWidget(GLSLTextEditorWidget *other);
|
||||
~GLSLTextEditorWidget();
|
||||
GlslEditorWidget(QWidget *parent = 0);
|
||||
GlslEditorWidget(GlslEditorWidget *other);
|
||||
~GlslEditorWidget();
|
||||
|
||||
int editorRevision() const;
|
||||
bool isOutdated() const;
|
||||
@@ -106,10 +106,10 @@ private slots:
|
||||
|
||||
protected:
|
||||
TextEditor::BaseTextEditor *createEditor();
|
||||
void createToolBar(Internal::GLSLEditorEditable *editable);
|
||||
void createToolBar(Internal::GlslEditor *editable);
|
||||
|
||||
private:
|
||||
GLSLTextEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
GlslEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
void ctor();
|
||||
void setSelectedElements();
|
||||
QString wordUnderCursor() const;
|
||||
|
@@ -43,7 +43,7 @@
|
||||
namespace GLSLEditor {
|
||||
namespace Internal {
|
||||
|
||||
GLSLEditorEditable::GLSLEditorEditable(GLSLTextEditorWidget *editor)
|
||||
GlslEditor::GlslEditor(GlslEditorWidget *editor)
|
||||
: BaseTextEditor(editor)
|
||||
{
|
||||
setContext(Core::Context(GLSLEditor::Constants::C_GLSLEDITOR_ID,
|
||||
|
@@ -35,14 +35,14 @@
|
||||
namespace GLSLEditor {
|
||||
namespace Internal {
|
||||
|
||||
class GLSLTextEditorWidget;
|
||||
class GlslEditorWidget;
|
||||
|
||||
class GLSLEditorEditable : public TextEditor::BaseTextEditor
|
||||
class GlslEditor : public TextEditor::BaseTextEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GLSLEditorEditable(GLSLTextEditorWidget *);
|
||||
explicit GlslEditor(GlslEditorWidget *);
|
||||
|
||||
Core::IEditor *duplicate();
|
||||
bool open(QString *errorString, const QString &fileName, const QString &realFileName);
|
||||
|
@@ -65,7 +65,7 @@ GLSLEditorFactory::GLSLEditorFactory(QObject *parent)
|
||||
|
||||
Core::IEditor *GLSLEditorFactory::createEditor()
|
||||
{
|
||||
GLSLTextEditorWidget *rc = new GLSLTextEditorWidget();
|
||||
GlslEditorWidget *rc = new GlslEditorWidget();
|
||||
TextEditor::TextEditorSettings::initializeEditor(rc);
|
||||
return rc->editor();
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@
|
||||
namespace GLSLEditor {
|
||||
namespace Internal {
|
||||
|
||||
class GLSLTextEditorWidget;
|
||||
class GlslEditorWidget;
|
||||
|
||||
class GLSLEditorPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
|
@@ -92,7 +92,7 @@ void Highlighter::highlightBlock(const QString &text)
|
||||
lex.setState(state);
|
||||
lex.setScanKeywords(false);
|
||||
lex.setScanComments(true);
|
||||
const int variant = GLSLTextEditorWidget::languageVariant(parent()
|
||||
const int variant = GlslEditorWidget::languageVariant(parent()
|
||||
? static_cast<BaseTextDocument*>(parent())->mimeType()
|
||||
: QString());
|
||||
lex.setVariant(variant);
|
||||
|
@@ -34,7 +34,7 @@
|
||||
namespace GLSLEditor {
|
||||
namespace Internal {
|
||||
|
||||
class GLSLTextEditorWidget;
|
||||
class GlslEditorWidget;
|
||||
|
||||
class Highlighter : public TextEditor::SyntaxHighlighter
|
||||
{
|
||||
|
@@ -52,14 +52,14 @@ GLSLHoverHandler::~GLSLHoverHandler()
|
||||
|
||||
bool GLSLHoverHandler::acceptEditor(IEditor *editor)
|
||||
{
|
||||
if (qobject_cast<GLSLEditorEditable *>(editor) != 0)
|
||||
if (qobject_cast<GlslEditor *>(editor) != 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void GLSLHoverHandler::identifyMatch(TextEditor::BaseTextEditor *editor, int pos)
|
||||
{
|
||||
if (GLSLTextEditorWidget *glslEditor = qobject_cast<GLSLTextEditorWidget *>(editor->widget())) {
|
||||
if (GlslEditorWidget *glslEditor = qobject_cast<GlslEditorWidget *>(editor->widget())) {
|
||||
if (! glslEditor->extraSelectionTooltip(pos).isEmpty())
|
||||
setToolTip(glslEditor->extraSelectionTooltip(pos));
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@
|
||||
namespace PythonEditor {
|
||||
namespace Internal {
|
||||
|
||||
PythonEditor::PythonEditor(EditorWidget *editorWidget)
|
||||
PythonEditor::PythonEditor(PythonEditorWidget *editorWidget)
|
||||
:BaseTextEditor(editorWidget)
|
||||
{
|
||||
setContext(Core::Context(Constants::C_PYTHONEDITOR_ID,
|
||||
@@ -58,7 +58,7 @@ PythonEditor::PythonEditor(EditorWidget *editorWidget)
|
||||
|
||||
Core::IEditor *PythonEditor::duplicate()
|
||||
{
|
||||
EditorWidget *widget = new EditorWidget(qobject_cast<EditorWidget *>(editorWidget()));
|
||||
PythonEditorWidget *widget = new PythonEditorWidget(qobject_cast<PythonEditorWidget *>(editorWidget()));
|
||||
TextEditor::TextEditorSettings::initializeEditor(widget);
|
||||
return widget->editor();
|
||||
}
|
||||
|
@@ -35,14 +35,14 @@
|
||||
namespace PythonEditor {
|
||||
namespace Internal {
|
||||
|
||||
class EditorWidget;
|
||||
class PythonEditorWidget;
|
||||
|
||||
class PythonEditor : public TextEditor::BaseTextEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PythonEditor(EditorWidget *editorWidget);
|
||||
explicit PythonEditor(PythonEditorWidget *editorWidget);
|
||||
|
||||
Core::IEditor *duplicate();
|
||||
|
||||
|
@@ -57,7 +57,7 @@ EditorFactory::EditorFactory(QObject *parent)
|
||||
|
||||
Core::IEditor *EditorFactory::createEditor()
|
||||
{
|
||||
EditorWidget *widget = new EditorWidget();
|
||||
PythonEditorWidget *widget = new PythonEditorWidget();
|
||||
TextEditor::TextEditorSettings::initializeEditor(widget);
|
||||
|
||||
return widget->editor();
|
||||
|
@@ -37,7 +37,7 @@ namespace PythonEditor {
|
||||
namespace Internal {
|
||||
|
||||
class EditorFactory;
|
||||
class EditorWidget;
|
||||
class PythonEditorWidget;
|
||||
|
||||
/**
|
||||
\class PyEditor::Plugin implements ExtensionSystem::IPlugin
|
||||
|
@@ -48,7 +48,7 @@
|
||||
namespace PythonEditor {
|
||||
namespace Internal {
|
||||
|
||||
EditorWidget::EditorWidget(QWidget *parent)
|
||||
PythonEditorWidget::PythonEditorWidget(QWidget *parent)
|
||||
: TextEditor::BaseTextEditorWidget(parent)
|
||||
{
|
||||
baseTextDocument()->setId(Constants::C_PYTHONEDITOR_ID);
|
||||
@@ -56,13 +56,13 @@ EditorWidget::EditorWidget(QWidget *parent)
|
||||
ctor();
|
||||
}
|
||||
|
||||
EditorWidget::EditorWidget(EditorWidget *other)
|
||||
PythonEditorWidget::PythonEditorWidget(PythonEditorWidget *other)
|
||||
: TextEditor::BaseTextEditorWidget(other)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void EditorWidget::ctor()
|
||||
void PythonEditorWidget::ctor()
|
||||
{
|
||||
setParenthesesMatchingEnabled(true);
|
||||
setMarksVisible(true);
|
||||
@@ -71,7 +71,7 @@ void EditorWidget::ctor()
|
||||
new PythonHighlighter(baseTextDocument());
|
||||
}
|
||||
|
||||
TextEditor::BaseTextEditor *EditorWidget::createEditor()
|
||||
TextEditor::BaseTextEditor *PythonEditorWidget::createEditor()
|
||||
{
|
||||
return new PythonEditor(this);
|
||||
}
|
||||
|
@@ -36,19 +36,19 @@
|
||||
namespace PythonEditor {
|
||||
namespace Internal {
|
||||
|
||||
class EditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
class PythonEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EditorWidget(QWidget *parent = 0);
|
||||
EditorWidget(EditorWidget *other);
|
||||
PythonEditorWidget(QWidget *parent = 0);
|
||||
PythonEditorWidget(PythonEditorWidget *other);
|
||||
|
||||
protected:
|
||||
TextEditor::BaseTextEditor *createEditor();
|
||||
|
||||
private:
|
||||
EditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
PythonEditorWidget(TextEditor::BaseTextEditorWidget *); // avoid stupidity
|
||||
void ctor();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user