Commit d2c24346 authored by hjk's avatar hjk

CppEditor: Rename CPPEditor{,Document} to CppEditor{,Document}

Better in line with the rest.

Change-Id: I692c8b6b9bebf22f059709fb60e53ea04fcb7d53
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 7b67701d
......@@ -1373,8 +1373,7 @@ void CppCodeModelInspectorDialog::refresh()
dumper.dumpSnapshot(editorSnapshot, editorSnapshotTitle);
m_ui->snapshotSelector->addItem(editorSnapshotTitle);
}
CppEditor::Internal::CppEditorWidget *cppEditorWidget
= qobject_cast<CppEditor::Internal::CppEditorWidget *>(editor->editorWidget());
CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget *>(editor->editorWidget());
if (cppEditorWidget) {
SemanticInfo semanticInfo = cppEditorWidget->semanticInfo();
CPlusPlus::Snapshot snapshot;
......
......@@ -90,15 +90,15 @@ using namespace CppEditor::Internal;
namespace CppEditor {
namespace Internal {
CPPEditor::CPPEditor()
CppEditor::CppEditor()
{
m_context.add(CppEditor::Constants::C_CPPEDITOR);
m_context.add(Constants::C_CPPEDITOR);
m_context.add(ProjectExplorer::Constants::LANG_CXX);
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
setDuplicateSupported(true);
setCommentStyle(Utils::CommentDefinition::CppStyle);
setCompletionAssistProvider([this] () -> TextEditor::CompletionAssistProvider * {
if (CPPEditorDocument *document = qobject_cast<CPPEditorDocument *>(textDocument()))
if (CppEditorDocument *document = qobject_cast<CppEditorDocument *>(textDocument()))
return document->completionAssistProvider();
return 0;
});
......@@ -114,7 +114,7 @@ public:
public:
QPointer<CppTools::CppModelManagerInterface> m_modelManager;
CPPEditorDocument *m_cppEditorDocument;
CppEditorDocument *m_cppEditorDocument;
CppEditorOutline *m_cppEditorOutline;
CppDocumentationCommentHelper m_cppDocumentationCommentHelper;
......@@ -137,7 +137,7 @@ public:
CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
: m_modelManager(CppModelManagerInterface::instance())
, m_cppEditorDocument(qobject_cast<CPPEditorDocument *>(q->textDocument()))
, m_cppEditorDocument(qobject_cast<CppEditorDocument *>(q->textDocument()))
, m_cppEditorOutline(new CppEditorOutline(q))
, m_cppDocumentationCommentHelper(q)
, m_localRenaming(q)
......@@ -148,7 +148,7 @@ CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
{
}
CppEditorWidget::CppEditorWidget(TextEditor::BaseTextDocumentPtr doc, CPPEditor *editor)
CppEditorWidget::CppEditorWidget(TextEditor::BaseTextDocumentPtr doc, CppEditor *editor)
{
qRegisterMetaType<SemanticInfo>("CppTools::SemanticInfo");
......@@ -163,9 +163,9 @@ CppEditorWidget::CppEditorWidget(TextEditor::BaseTextDocumentPtr doc, CPPEditor
setParenthesesMatchingEnabled(true);
setRevisionsVisible(true);
connect(d->m_cppEditorDocument, &CPPEditorDocument::codeWarningsUpdated,
connect(d->m_cppEditorDocument, &CppEditorDocument::codeWarningsUpdated,
this, &CppEditorWidget::onCodeWarningsUpdated);
connect(d->m_cppEditorDocument, &CPPEditorDocument::ifdefedOutBlocksUpdated,
connect(d->m_cppEditorDocument, &CppEditorDocument::ifdefedOutBlocksUpdated,
this, &CppEditorWidget::onIfdefedOutBlocksUpdated);
connect(d->m_cppEditorDocument, SIGNAL(cppDocumentUpdated(CPlusPlus::Document::Ptr)),
this, SLOT(onCppDocumentUpdated()));
......@@ -229,7 +229,7 @@ CppEditorWidget::~CppEditorWidget()
// non-inline destructor, see section "Forward Declared Pointers" of QScopedPointer.
}
CppEditorWidget *CppEditorWidget::duplicate(CPPEditor *editor) const
CppEditorWidget *CppEditorWidget::duplicate(CppEditor *editor) const
{
QTC_ASSERT(editor, return 0);
......@@ -243,7 +243,7 @@ CppEditorWidget *CppEditorWidget::duplicate(CPPEditor *editor) const
return widget;
}
CPPEditorDocument *CppEditorWidget::cppEditorDocument() const
CppEditorDocument *CppEditorWidget::cppEditorDocument() const
{
return d->m_cppEditorDocument;
}
......@@ -564,16 +564,16 @@ void CppEditorWidget::keyPressEvent(QKeyEvent *e)
TextEditor::BaseTextEditorWidget::keyPressEvent(e);
}
Core::IEditor *CPPEditor::duplicate()
Core::IEditor *CppEditor::duplicate()
{
CPPEditor *editor = new CPPEditor;
CppEditor *editor = new CppEditor;
CppEditorWidget *widget = qobject_cast<CppEditorWidget *>(editorWidget())->duplicate(editor);
CppEditorPlugin::instance()->initializeEditor(widget);
editor->configureCodeAssistant();
return editor;
}
bool CPPEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
bool CppEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
{
if (!TextEditor::BaseTextEditor::open(errorString, fileName, realFileName))
return false;
......
......@@ -44,18 +44,18 @@ namespace CppTools { class SemanticInfo; }
namespace CppEditor {
namespace Internal {
class CPPEditorDocument;
class CppEditorDocument;
class CppEditorOutline;
class CppEditorWidgetPrivate;
class FollowSymbolUnderCursor;
class FunctionDeclDefLink;
class CPPEditor : public TextEditor::BaseTextEditor
class CppEditor : public TextEditor::BaseTextEditor
{
Q_OBJECT
public:
CPPEditor();
CppEditor();
Core::IEditor *duplicate() QTC_OVERRIDE;
......@@ -72,12 +72,12 @@ public:
static Link linkToSymbol(CPlusPlus::Symbol *symbol);
public:
CppEditorWidget(TextEditor::BaseTextDocumentPtr doc, CPPEditor *editor);
CppEditorWidget(TextEditor::BaseTextDocumentPtr doc, CppEditor *editor);
~CppEditorWidget();
CppEditorWidget *duplicate(CPPEditor *editor) const;
CppEditorWidget *duplicate(CppEditor *editor) const;
CPPEditorDocument *cppEditorDocument() const;
CppEditorDocument *cppEditorDocument() const;
CppEditorOutline *outline() const;
CppTools::SemanticInfo semanticInfo() const;
......
......@@ -62,7 +62,7 @@ enum { processDocumentIntervalInMs = 150 };
class CppEditorDocumentHandle : public CppTools::EditorDocumentHandle
{
public:
CppEditorDocumentHandle(CppEditor::Internal::CPPEditorDocument *cppEditorDocument)
CppEditorDocumentHandle(CppEditor::Internal::CppEditorDocument *cppEditorDocument)
: m_cppEditorDocument(cppEditorDocument)
, m_registrationFilePath(cppEditorDocument->filePath())
{
......@@ -79,13 +79,13 @@ public:
{ return m_cppEditorDocument->processor(); }
private:
CppEditor::Internal::CPPEditorDocument * const m_cppEditorDocument;
CppEditor::Internal::CppEditorDocument * const m_cppEditorDocument;
// The file path of the editor document can change (e.g. by "Save As..."), so make sure
// that un-registration happens with the path the document was registered.
const QString m_registrationFilePath;
};
CPPEditorDocument::CPPEditorDocument()
CppEditorDocument::CppEditorDocument()
: m_fileIsBeingReloaded(false)
, m_isObjCEnabled(false)
, m_cachedContentsRevision(-1)
......@@ -111,35 +111,35 @@ CPPEditorDocument::CPPEditorDocument()
// See also onFilePathChanged() for more initialization
}
CPPEditorDocument::~CPPEditorDocument()
CppEditorDocument::~CppEditorDocument()
{
}
bool CPPEditorDocument::isObjCEnabled() const
bool CppEditorDocument::isObjCEnabled() const
{
return m_isObjCEnabled;
}
CppTools::CppCompletionAssistProvider *CPPEditorDocument::completionAssistProvider() const
CppTools::CppCompletionAssistProvider *CppEditorDocument::completionAssistProvider() const
{
return m_completionAssistProvider;
}
void CPPEditorDocument::semanticRehighlight()
void CppEditorDocument::semanticRehighlight()
{
CppTools::BaseEditorDocumentProcessor *p = processor();
QTC_ASSERT(p, return);
p->semanticRehighlight(true);
}
CppTools::SemanticInfo CPPEditorDocument::recalculateSemanticInfo()
CppTools::SemanticInfo CppEditorDocument::recalculateSemanticInfo()
{
CppTools::BaseEditorDocumentProcessor *p = processor();
QTC_ASSERT(p, CppTools::SemanticInfo());
return p->recalculateSemanticInfo();
}
QByteArray CPPEditorDocument::contentsText() const
QByteArray CppEditorDocument::contentsText() const
{
QMutexLocker locker(&m_cachedContentsLock);
......@@ -152,7 +152,7 @@ QByteArray CPPEditorDocument::contentsText() const
return m_cachedContents;
}
void CPPEditorDocument::applyFontSettings()
void CppEditorDocument::applyFontSettings()
{
if (TextEditor::SyntaxHighlighter *highlighter = syntaxHighlighter()) {
// Clear all additional formats since they may have changed
......@@ -166,13 +166,13 @@ void CPPEditorDocument::applyFontSettings()
BaseTextDocument::applyFontSettings(); // rehighlights and updates additional formats
}
void CPPEditorDocument::invalidateFormatterCache()
void CppEditorDocument::invalidateFormatterCache()
{
CppTools::QtStyleCodeFormatter formatter;
formatter.invalidateCache(document());
}
void CPPEditorDocument::onMimeTypeChanged()
void CppEditorDocument::onMimeTypeChanged()
{
const QString &mt = mimeType();
m_isObjCEnabled = (mt == QLatin1String(CppTools::Constants::OBJECTIVE_C_SOURCE_MIMETYPE)
......@@ -180,19 +180,19 @@ void CPPEditorDocument::onMimeTypeChanged()
m_completionAssistProvider = mm()->completionAssistProvider(mt);
}
void CPPEditorDocument::onAboutToReload()
void CppEditorDocument::onAboutToReload()
{
QTC_CHECK(!m_fileIsBeingReloaded);
m_fileIsBeingReloaded = true;
}
void CPPEditorDocument::onReloadFinished()
void CppEditorDocument::onReloadFinished()
{
QTC_CHECK(m_fileIsBeingReloaded);
m_fileIsBeingReloaded = false;
}
void CPPEditorDocument::onFilePathChanged(const QString &oldPath, const QString &newPath)
void CppEditorDocument::onFilePathChanged(const QString &oldPath, const QString &newPath)
{
Q_UNUSED(oldPath);
......@@ -211,13 +211,13 @@ void CPPEditorDocument::onFilePathChanged(const QString &oldPath, const QString
}
}
void CPPEditorDocument::scheduleProcessDocument()
void CppEditorDocument::scheduleProcessDocument()
{
m_processorRevision = document()->revision();
m_processorTimer.start(processDocumentIntervalInMs);
}
void CPPEditorDocument::processDocument()
void CppEditorDocument::processDocument()
{
if (processor()->isParserRunning() || m_processorRevision != contentsRevision()) {
m_processorTimer.start();
......@@ -231,36 +231,36 @@ void CPPEditorDocument::processDocument()
processor()->run();
}
void CPPEditorDocument::resetProcessor()
void CppEditorDocument::resetProcessor()
{
releaseResources();
processor(); // creates a new processor
}
unsigned CPPEditorDocument::contentsRevision() const
unsigned CppEditorDocument::contentsRevision() const
{
return document()->revision();
}
void CPPEditorDocument::releaseResources()
void CppEditorDocument::releaseResources()
{
if (m_processor)
disconnect(m_processor.data(), 0, this, 0);
m_processor.reset();
}
CppTools::BaseEditorDocumentProcessor *CPPEditorDocument::processor()
CppTools::BaseEditorDocumentProcessor *CppEditorDocument::processor()
{
if (!m_processor) {
m_processor.reset(mm()->editorDocumentProcessor(this));
connect(m_processor.data(), &CppTools::BaseEditorDocumentProcessor::codeWarningsUpdated,
this, &CPPEditorDocument::codeWarningsUpdated);
this, &CppEditorDocument::codeWarningsUpdated);
connect(m_processor.data(), &CppTools::BaseEditorDocumentProcessor::ifdefedOutBlocksUpdated,
this, &CPPEditorDocument::ifdefedOutBlocksUpdated);
this, &CppEditorDocument::ifdefedOutBlocksUpdated);
connect(m_processor.data(), &CppTools::BaseEditorDocumentProcessor::cppDocumentUpdated,
this, &CPPEditorDocument::cppDocumentUpdated);
this, &CppEditorDocument::cppDocumentUpdated);
connect(m_processor.data(), &CppTools::BaseEditorDocumentProcessor::semanticInfoUpdated,
this, &CPPEditorDocument::semanticInfoUpdated);
this, &CppEditorDocument::semanticInfoUpdated);
}
return m_processor.data();
......
......@@ -44,15 +44,15 @@
namespace CppEditor {
namespace Internal {
class CPPEditorDocument : public TextEditor::BaseTextDocument
class CppEditorDocument : public TextEditor::BaseTextDocument
{
Q_OBJECT
friend class CppEditorDocumentHandle;
public:
explicit CPPEditorDocument();
~CPPEditorDocument();
explicit CppEditorDocument();
~CppEditorDocument();
bool isObjCEnabled() const;
CppTools::CppCompletionAssistProvider *completionAssistProvider() const;
......
......@@ -63,8 +63,9 @@
#include <QStringList>
using namespace Core;
using namespace CppEditor;
using namespace CppEditor::Internal;
namespace CppEditor {
namespace Internal {
void registerQuickFixes(ExtensionSystem::IPlugin *plugIn);
......@@ -75,30 +76,30 @@ enum { QUICKFIX_INTERVAL = 20 };
CppEditorFactory::CppEditorFactory(CppEditorPlugin *owner) :
m_owner(owner)
{
setId(CppEditor::Constants::CPPEDITOR_ID);
setDisplayName(qApp->translate("OpenWith::Editors", CppEditor::Constants::CPPEDITOR_DISPLAY_NAME));
addMimeType(CppEditor::Constants::C_SOURCE_MIMETYPE);
addMimeType(CppEditor::Constants::C_HEADER_MIMETYPE);
addMimeType(CppEditor::Constants::CPP_SOURCE_MIMETYPE);
addMimeType(CppEditor::Constants::CPP_HEADER_MIMETYPE);
new TextEditor::TextEditorActionHandler(this, CppEditor::Constants::C_CPPEDITOR,
setId(Constants::CPPEDITOR_ID);
setDisplayName(qApp->translate("OpenWith::Editors", Constants::CPPEDITOR_DISPLAY_NAME));
addMimeType(Constants::C_SOURCE_MIMETYPE);
addMimeType(Constants::C_HEADER_MIMETYPE);
addMimeType(Constants::CPP_SOURCE_MIMETYPE);
addMimeType(Constants::CPP_HEADER_MIMETYPE);
new TextEditor::TextEditorActionHandler(this, Constants::C_CPPEDITOR,
TextEditor::TextEditorActionHandler::Format
| TextEditor::TextEditorActionHandler::UnCommentSelection
| TextEditor::TextEditorActionHandler::UnCollapseAll
| TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor);
if (!Utils::HostOsInfo::isMacHost() && !Utils::HostOsInfo::isWindowsHost()) {
FileIconProvider::registerIconOverlayForMimeType(":/cppeditor/images/qt_cpp.png", CppEditor::Constants::CPP_SOURCE_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/cppeditor/images/qt_c.png", CppEditor::Constants::C_SOURCE_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/cppeditor/images/qt_h.png", CppEditor::Constants::CPP_HEADER_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/cppeditor/images/qt_cpp.png", Constants::CPP_SOURCE_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/cppeditor/images/qt_c.png", Constants::C_SOURCE_MIMETYPE);
FileIconProvider::registerIconOverlayForMimeType(":/cppeditor/images/qt_h.png", Constants::CPP_HEADER_MIMETYPE);
}
}
IEditor *CppEditorFactory::createEditor()
{
CPPEditor *editor = new CPPEditor;
CppEditorWidget *widget = new CppEditorWidget(BaseTextDocumentPtr(new CPPEditorDocument), editor);
CppEditor *editor = new CppEditor;
CppEditorWidget *widget = new CppEditorWidget(BaseTextDocumentPtr(new CppEditorDocument), editor);
m_owner->initializeEditor(widget);
editor->configureCodeAssistant();
return editor;
......@@ -167,16 +168,16 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
auto hf = new TextEditor::HighlighterFactory;
hf->setProductType<CppHighlighter>();
hf->setId(CppEditor::Constants::CPPEDITOR_ID);
hf->addMimeType(CppEditor::Constants::C_SOURCE_MIMETYPE);
hf->addMimeType(CppEditor::Constants::C_HEADER_MIMETYPE);
hf->addMimeType(CppEditor::Constants::CPP_SOURCE_MIMETYPE);
hf->addMimeType(CppEditor::Constants::CPP_HEADER_MIMETYPE);
hf->setId(Constants::CPPEDITOR_ID);
hf->addMimeType(Constants::C_SOURCE_MIMETYPE);
hf->addMimeType(Constants::C_HEADER_MIMETYPE);
hf->addMimeType(Constants::CPP_SOURCE_MIMETYPE);
hf->addMimeType(Constants::CPP_HEADER_MIMETYPE);
addAutoReleasedObject(hf);
m_quickFixProvider = new CppQuickFixAssistProvider;
addAutoReleasedObject(m_quickFixProvider);
CppEditor::Internal::registerQuickFixes(this);
registerQuickFixes(this);
QString trCat = QCoreApplication::translate(Constants::WIZARD_CATEGORY, Constants::WIZARD_TR_CATEGORY);
......@@ -208,9 +209,9 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
wizard->setId(QLatin1String("C.Header"));
addAutoReleasedObject(wizard);
Context context(CppEditor::Constants::C_CPPEDITOR);
Context context(Constants::C_CPPEDITOR);
ActionContainer *contextMenu = ActionManager::createMenu(CppEditor::Constants::M_CONTEXT);
ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT);
Command *cmd;
ActionContainer *cppToolsMenu = ActionManager::actionContainer(CppTools::Constants::M_TOOLS_CPP);
......@@ -425,3 +426,6 @@ void CppEditorPlugin::openIncludeHierarchy()
emit includeHierarchyRequested();
}
}
} // namespace Internal
} // namespace CppEditor
......@@ -40,6 +40,8 @@
#include <QDir>
using namespace CppEditor::Internal;
namespace CppEditor {
namespace Internal {
namespace Tests {
......@@ -63,12 +65,9 @@ TestCase::~TestCase()
{
}
bool TestCase::openCppEditor(const QString &fileName,
Internal::CPPEditor **editor,
Internal::CppEditorWidget **editorWidget)
bool TestCase::openCppEditor(const QString &fileName, CppEditor **editor, CppEditorWidget **editorWidget)
{
using namespace CppEditor::Internal;
if (CPPEditor *e = dynamic_cast<CPPEditor *>(Core::EditorManager::openEditor(fileName))) {
if (CppEditor *e = dynamic_cast<CppEditor *>(Core::EditorManager::openEditor(fileName))) {
if (editor)
*editor = e;
if (editorWidget) {
......@@ -87,7 +86,7 @@ bool TestCase::openCppEditor(const QString &fileName,
}
CPlusPlus::Document::Ptr TestCase::waitForRehighlightedSemanticDocument(
Internal::CppEditorWidget *editorWidget)
CppEditorWidget *editorWidget)
{
const QString filePath = editorWidget->textDocument()->filePath();
auto processor = CppTools::BaseEditorDocumentProcessor::get(filePath);
......
......@@ -36,9 +36,9 @@
#include <cpptools/cpptoolstestcase.h>
namespace CppEditor {
namespace Internal {
class CPPEditor;
class CppEditor;
class CppEditorWidget;
namespace Tests {
......@@ -52,8 +52,8 @@ public:
public:
int m_cursorPosition;
Internal::CPPEditor *m_editor;
Internal::CppEditorWidget *m_editorWidget;
CppEditor *m_editor;
CppEditorWidget *m_editorWidget;
};
class TestCase : public CppTools::Tests::TestCase
......@@ -63,11 +63,11 @@ public:
~TestCase();
static bool openCppEditor(const QString &fileName,
Internal::CPPEditor **editor,
Internal::CppEditorWidget **editorWidget = 0);
CppEditor **editor,
CppEditorWidget **editorWidget = 0);
static CPlusPlus::Document::Ptr waitForRehighlightedSemanticDocument(
Internal::CppEditorWidget *editorWidget);
CppEditorWidget *editorWidget);
};
} // namespace Tests
......
......@@ -43,22 +43,22 @@
#include <QSet>
#include <QQueue>
using namespace CppEditor;
using namespace CppEditor::Internal;
using namespace CPlusPlus;
namespace {
QStringList stripName(const QString &name) {
QStringList all;
all << name;
int colonColon = 0;
const int size = name.size();
while ((colonColon = name.indexOf(QLatin1String("::"), colonColon)) != -1) {
all << name.right(size - colonColon - 2);
colonColon += 2;
}
return all;
namespace CppEditor {
namespace Internal {
static QStringList stripName(const QString &name)
{
QStringList all;
all << name;
int colonColon = 0;
const int size = name.size();
while ((colonColon = name.indexOf(QLatin1String("::"), colonColon)) != -1) {
all << name.right(size - colonColon - 2);
colonColon += 2;
}
return all;
}
CppElementEvaluator::CppElementEvaluator(TextEditor::BaseTextEditorWidget *editor) :
......@@ -78,7 +78,7 @@ void CppElementEvaluator::setLookupBaseClasses(const bool lookup)
void CppElementEvaluator::setLookupDerivedClasses(const bool lookup)
{ m_lookupDerivedClasses = lookup; }
// @todo: Consider refactoring code from CPPEditor::findLinkAt into here.
// @todo: Consider refactoring code from CppEditor::findLinkAt into here.
void CppElementEvaluator::execute()
{
clear();
......@@ -235,7 +235,7 @@ const QString &CppElementEvaluator::diagnosis() const
return m_diagnosis;
}
void CppEditor::Internal::CppElementEvaluator::clear()
void CppElementEvaluator::clear()
{
m_element.clear();
m_diagnosis.clear();
......@@ -470,3 +470,6 @@ CppEnumerator::CppEnumerator(CPlusPlus::EnumeratorDeclaration *declaration)
if (!enumeratorValue.isEmpty())
tooltip.append(QLatin1String(" = ") + enumeratorValue);
}
} // namespace Internal
} // namespace CppEditor
......@@ -136,7 +136,7 @@ void CppIncludeHierarchyWidget::perform()
{
showNoIncludeHierarchyLabel();
m_editor = qobject_cast<CPPEditor *>(Core::EditorManager::currentEditor());
m_editor = qobject_cast<CppEditor *>(Core::EditorManager::currentEditor());
if (!m_editor)
return;
......
......@@ -54,7 +54,7 @@ class FileName;
namespace CppEditor {
namespace Internal {
class CPPEditor;
class CppEditor;
class CppEditorWidget;
class CppInclude;
class CppIncludeLabel;
......
......@@ -42,9 +42,11 @@
Q_DECLARE_METATYPE(QList<QByteArray>)
using namespace CPlusPlus;
using namespace CppEditor::Internal;
using namespace CppTools;
namespace CppEditor {
namespace Internal {
namespace {
QString toString(CppIncludeHierarchyModel &model, const QModelIndex &index, int indent = 0)
......@@ -69,7 +71,7 @@ QString toString(CppIncludeHierarchyModel &model)
+ toString(model, model.index(1, 0));
}
class IncludeHierarchyTestCase: public CppEditor::Internal::Tests::TestCase
class IncludeHierarchyTestCase : public Tests::TestCase
{
public:
IncludeHierarchyTestCase(const QList<QByteArray> &sourceList,
......@@ -95,7 +97,7 @@ public:
// Open Editor
const QString fileName = QDir::tempPath() + QLatin1String("/file1.h");
CPPEditor *editor;
CppEditor *editor;
QVERIFY(openCppEditor(fileName, &editor));
closeEditorAtEndOfTestCase(editor);
......@@ -182,3 +184,6 @@ void CppEditorPlugin::test_includehierarchy()
IncludeHierarchyTestCase(documents, expectedHierarchy);
}
} // namespace CppEditor
} // namespace Internal
......@@ -47,7 +47,7 @@ namespace TextEditor { class BaseTextEditor; }
namespace CppEditor {
namespace Internal {
class CPPEditor;
class CppEditor;
class CppIncludeHierarchyItem;
class CppIncludeHierarchyModel : public QAbstractItemModel
......
......@@ -40,7 +40,8 @@
#include <QVBoxLayout>
#include <QMenu>
using namespace CppEditor::Internal;
namespace CppEditor {
namespace Internal {
enum {
debug = false
......@@ -185,14 +186,14 @@ bool CppOutlineWidget::syncCursor()
bool CppOutlineWidgetFactory::supportsEditor(Core::IEditor *editor) const
{
if (qobject_cast<CPPEditor*>(editor))
if (qobject_cast<CppEditor*>(editor))
return true;
return false;
}
TextEditor::IOutlineWidget *CppOutlineWidgetFactory::createWidget(Core::IEditor *editor)
{
CPPEditor *cppEditor = qobject_cast<CPPEditor*>(editor);
CppEditor *cppEditor = qobject_cast<CppEditor*>(editor);
CppEditorWidget *cppEditorWidget = qobject_cast<CppEditorWidget*>(cppEditor->widget());
QTC_ASSERT(cppEditorWidget, return 0);
......@@ -200,3 +201,6 @@ TextEditor::IOutlineWidget *CppOutlineWidgetFactory::createWidget(Core::IEditor
return widget;
}
} // namespace Internal
} // namespace CppEditor
......@@ -68,6 +68,6 @@ private:
};
} // namespace Internal
} // namespace CPPEditor
} // namespace CppEditor
#endif // CPPPREPROCESSORDIALOG_H
......@@ -37,12 +37,13 @@
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
using namespace CppEditor;
using namespace CppEditor::Internal;
using namespace TextEditor;
using namespace CppTools;
using namespace CPlusPlus;
namespace CppEditor {
namespace Internal {
// -------------------------
// CppQuickFixAssistProvider
// -------------------------
......@@ -53,7 +54,7 @@ bool CppQuickFixAssistProvider::isAsynchronous() const
bool CppQuickFixAssistProvider::supportsEditor(Core::Id editorId) const
{
return editorId == CppEditor::Constants::CPPEDITOR_ID;
return editorId == Constants::CPPEDITOR_ID;
}
IAssistProcessor *CppQuickFixAssistProvider::createProcessor() const
......@@ -64,7 +65,7 @@ IAssistProcessor *CppQuickFixAssistProvider::createProcessor() const
QList<TextEditor::QuickFixFactory *> CppQuickFixAssistProvider::quickFixFactories() const
{
QList<TextEditor::QuickFixFactory *> results;