Commit 65e7db42 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

C++: Remove unneeded qualifications

Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent f5225c09
......@@ -827,7 +827,7 @@ TopLevelDeclarationProcessor *Control::topLevelDeclarationProcessor() const
return d->processor;
}
void Control::setTopLevelDeclarationProcessor(CPlusPlus::TopLevelDeclarationProcessor *processor)
void Control::setTopLevelDeclarationProcessor(TopLevelDeclarationProcessor *processor)
{
d->processor = processor;
}
......
......@@ -28,9 +28,9 @@
#include <cstring>
using namespace CPlusPlus;
namespace CPlusPlus {
class CPlusPlus::SymbolTable
class SymbolTable
{
SymbolTable(const SymbolTable &other);
void operator =(const SymbolTable &other);
......@@ -293,3 +293,5 @@ unsigned Scope::endOffset() const
void Scope::setEndOffset(unsigned offset)
{ _endOffset = offset; }
} // namespace CPlusPlus
......@@ -503,7 +503,7 @@ QString Document::functionAt(int line, int column, int *lineOpeningDeclaratorPar
if (line < 1 || column < 1)
return QString();
CPlusPlus::Symbol *symbol = lastVisibleSymbolAt(line, column);
Symbol *symbol = lastVisibleSymbolAt(line, column);
if (!symbol)
return QString();
......
......@@ -38,7 +38,7 @@
using namespace CPlusPlus;
uint CPlusPlus::qHash(const CPlusPlus::LookupItem &key)
uint CPlusPlus::qHash(const LookupItem &key)
{
const uint h1 = QT_PREPEND_NAMESPACE(qHash)(key.type().type());
const uint h2 = QT_PREPEND_NAMESPACE(qHash)(key.scope());
......
......@@ -747,7 +747,7 @@ bool ResolveExpression::visit(SimpleNameAST *ast)
if (typeItems.empty())
continue;
CPlusPlus::Clone cloner(_context.bindings()->control().data());
Clone cloner(_context.bindings()->control().data());
for (int n = 0; n < typeItems.size(); ++ n) {
FullySpecifiedType newType = cloner.type(typeItems[n].type(), 0);
......
......@@ -46,12 +46,16 @@
//#define TIME_COMPLETION
class ClangCodeModel::ClangCompleter::PrivateData
using namespace ClangCodeModel::Internal;
namespace ClangCodeModel {
class ClangCompleter::PrivateData
{
public:
PrivateData()
: m_mutex(QMutex::Recursive)
, m_unit(Internal::Unit::create())
, m_unit(Unit::create())
, m_isSignalSlotCompletion(false)
{
}
......@@ -60,7 +64,7 @@ public:
{
}
bool parseFromFile(const Internal::UnsavedFiles &unsavedFiles)
bool parseFromFile(const UnsavedFiles &unsavedFiles)
{
Q_ASSERT(!m_unit->isLoaded());
if (m_unit->fileName().isEmpty())
......@@ -80,13 +84,10 @@ public:
public:
QMutex m_mutex;
Internal::Unit::Ptr m_unit;
Unit::Ptr m_unit;
bool m_isSignalSlotCompletion;
};
using namespace ClangCodeModel;
using namespace ClangCodeModel::Internal;
/**
* @brief Constructs with highest possible priority
*/
......@@ -127,7 +128,7 @@ QString ClangCompleter::fileName() const
void ClangCompleter::setFileName(const QString &fileName)
{
if (d->m_unit->fileName() != fileName) {
d->m_unit = Internal::Unit::create(fileName);
d->m_unit = Unit::create(fileName);
}
}
......@@ -208,3 +209,5 @@ QMutex *ClangCompleter::mutex() const
{
return &d->m_mutex;
}
} // namespace ClangCodeModel
......@@ -190,7 +190,7 @@ namespace Internal {
// ClangCompletionAssistProvider
// -----------------------------
ClangCompletionAssistProvider::ClangCompletionAssistProvider()
: m_clangCompletionWrapper(new ClangCodeModel::ClangCompleter)
: m_clangCompletionWrapper(new ClangCompleter)
{
}
......@@ -215,15 +215,15 @@ AssistInterface *ClangCompletionAssistProvider::createAssistInterface(
foreach (ProjectPart::Ptr part, parts) {
if (part.isNull())
continue;
options = ClangCodeModel::Utils::createClangOptions(part, filePath);
options = Utils::createClangOptions(part, filePath);
pchInfo = PchManager::instance()->pchInfo(part);
if (!pchInfo.isNull())
options.append(ClangCodeModel::Utils::createPCHInclusionOptions(pchInfo->fileName()));
options.append(Utils::createPCHInclusionOptions(pchInfo->fileName()));
headerPaths = part->headerPaths;
break;
}
return new ClangCodeModel::ClangCompletionAssistInterface(
return new ClangCompletionAssistInterface(
m_clangCompletionWrapper,
document, position, filePath, reason,
options, headerPaths, pchInfo);
......@@ -287,7 +287,7 @@ public:
virtual int activeArgument(const QString &prefix) const;
private:
QList<ClangCodeModel::CodeCompletionResult> m_functionSymbols;
QList<CodeCompletionResult> m_functionSymbols;
mutable int m_currentArg;
};
......@@ -323,7 +323,7 @@ int ClangFunctionHintModel::activeArgument(const QString &prefix) const
SimpleLexer tokenize;
Tokens tokens = tokenize(prefix);
for (int i = 0; i < tokens.count(); ++i) {
const CPlusPlus::Token &tk = tokens.at(i);
const Token &tk = tokens.at(i);
if (tk.is(T_LPAREN))
++parcount;
else if (tk.is(T_RPAREN))
......@@ -544,7 +544,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface(ClangCompleter::P
const QString &fileName,
AssistReason reason,
const QStringList &options,
const QList<CppTools::ProjectPart::HeaderPath> &headerPaths,
const QList<ProjectPart::HeaderPath> &headerPaths,
const PchInfo::Ptr &pchInfo)
: AssistInterface(document, position, fileName, reason)
, m_clangWrapper(clangWrapper)
......@@ -719,7 +719,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
tokenize.setSkipComments(false);
const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); // get the token at the left of the cursor
const CPlusPlus::Token tk = (tokenIdx == -1) ? CPlusPlus::Token() : tokens.at(tokenIdx);
const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx);
if (*kind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) {
*kind = T_EOF_SYMBOL;
......@@ -740,7 +740,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
}
else if (*kind == T_LPAREN) {
if (tokenIdx > 0) {
const CPlusPlus::Token &previousToken = tokens.at(tokenIdx - 1); // look at the token at the left of T_LPAREN
const Token &previousToken = tokens.at(tokenIdx - 1); // look at the token at the left of T_LPAREN
switch (previousToken.kind()) {
case T_IDENTIFIER:
case T_GREATER:
......@@ -761,7 +761,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
if (tokens.size() >= 3) {
if (tokens.at(0).is(T_POUND) && tokens.at(1).is(T_IDENTIFIER) && (tokens.at(2).is(T_STRING_LITERAL) ||
tokens.at(2).is(T_ANGLE_STRING_LITERAL))) {
const CPlusPlus::Token &directiveToken = tokens.at(1);
const Token &directiveToken = tokens.at(1);
QString directive = tc.block().text().mid(directiveToken.bytesBegin(),
directiveToken.bytes());
if (directive == QLatin1String("include") ||
......@@ -830,7 +830,7 @@ bool ClangCompletionAssistProcessor::accepts() const
tokenize.setSkipComments(false);
const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1));
const CPlusPlus::Token tk = (tokenIdx == -1) ? CPlusPlus::Token() : tokens.at(tokenIdx);
const Token tk = (tokenIdx == -1) ? Token() : tokens.at(tokenIdx);
if (!tk.isComment() && !tk.isLiteral()) {
return true;
......@@ -839,7 +839,7 @@ bool ClangCompletionAssistProcessor::accepts() const
&& tokens.at(0).kind() == T_POUND
&& tokens.at(1).kind() == T_IDENTIFIER) {
const QString &line = tc.block().text();
const CPlusPlus::Token &idToken = tokens.at(1);
const Token &idToken = tokens.at(1);
const QStringRef &identifier =
line.midRef(idToken.bytesBegin(),
idToken.bytesEnd() - idToken.bytesBegin());
......
......@@ -66,5 +66,5 @@ CppTools::CppCompletionAssistProvider *ModelManagerSupport::completionAssistProv
CppTools::BaseEditorDocumentProcessor *ModelManagerSupport::editorDocumentProcessor(
TextEditor::TextDocument *baseTextDocument)
{
return new ClangCodeModel::ClangEditorDocumentProcessor(baseTextDocument);
return new ClangEditorDocumentProcessor(baseTextDocument);
}
......@@ -75,7 +75,7 @@ UnsavedFiles createUnsavedFiles(WorkingCopy workingCopy)
// TODO: Reason: the UnsavedFile needs a QByteArray.
QSet< ::Utils::FileName> modifiedFiles;
foreach (IDocument *doc, Core::DocumentManager::modifiedDocuments())
foreach (IDocument *doc, DocumentManager::modifiedDocuments())
modifiedFiles.insert(doc->filePath());
UnsavedFiles result;
......@@ -112,7 +112,7 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, const QString &fil
static QString getResourceDir()
{
QDir dir(Core::ICore::instance()->resourcePath() + QLatin1String("/cplusplus/clang/") +
QDir dir(ICore::instance()->resourcePath() + QLatin1String("/cplusplus/clang/") +
QLatin1String(CLANG_VERSION) + QLatin1String("/include"));
if (!dir.exists() || !QFileInfo(dir, QLatin1String("stdint.h")).exists())
dir = QDir(QLatin1String(CLANG_RESOURCE_DIR));
......@@ -144,18 +144,17 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind
result << QLatin1String("-v");
const bool objcExt = pPart->languageExtensions & ProjectPart::ObjectiveCExtensions;
result << CppTools::CompilerOptionsBuilder::createLanguageOption(fileKind, objcExt);
result << CppTools::CompilerOptionsBuilder::createOptionsForLanguage(
pPart->languageVersion,
pPart->languageExtensions,
maybeIncludeBorlandExtensions());
result << CppTools::CompilerOptionsBuilder::createDefineOptions(pPart->toolchainDefines);
result << CppTools::CompilerOptionsBuilder::createDefineOptions(pPart->projectDefines);
result << CppTools::CompilerOptionsBuilder::createHeaderPathOptions(pPart->headerPaths,
isBlacklisted);
result << CompilerOptionsBuilder::createLanguageOption(fileKind, objcExt);
result << CompilerOptionsBuilder::createOptionsForLanguage(
pPart->languageVersion,
pPart->languageExtensions,
maybeIncludeBorlandExtensions());
result << CompilerOptionsBuilder::createDefineOptions(pPart->toolchainDefines);
result << CompilerOptionsBuilder::createDefineOptions(pPart->projectDefines);
result << CompilerOptionsBuilder::createHeaderPathOptions(pPart->headerPaths, isBlacklisted);
// Inject header file
static const QString injectedHeader = Core::ICore::instance()->resourcePath()
static const QString injectedHeader = ICore::instance()->resourcePath()
+ QLatin1String("/cplusplus/qt%1-qobjectdefs-injected.h");
// if (qtVersion == ProjectPart::Qt4)
// opts << QLatin1String("-include") << injectedHeader.arg(QLatin1Char('4'));
......
......@@ -244,7 +244,7 @@ protected:
indexingResults.reserve(m_allFiles.size());
foreach (const QString &fn, m_allFiles.keys()) {
QVector<ClangCodeModel::Symbol> symbols; unfoldSymbols(symbols, fn);
QVector<Symbol> symbols; unfoldSymbols(symbols, fn);
QSet<QString> processedFiles = QSet<QString>::fromList(m_allFiles.keys());
Unit::Ptr unit = Unit::create(fn);
IndexingResult indexingResult(symbols, processedFiles, unit, projectPart);
......@@ -487,18 +487,18 @@ protected:
}
}
void unfoldSymbols(QVector<ClangCodeModel::Symbol> &result, const QString &fileName) {
void unfoldSymbols(QVector<Symbol> &result, const QString &fileName) {
const QVector<Symbol *> symbolsForFile = file(fileName)->symbols();
foreach (const Symbol *s, symbolsForFile) {
unfoldSymbols(s, result);
}
}
void unfoldSymbols(const Symbol *s, QVector<ClangCodeModel::Symbol> &result) {
void unfoldSymbols(const Symbol *s, QVector<Symbol> &result) {
if (!s->file)
return;
ClangCodeModel::Symbol sym;
Symbol sym;
sym.m_name = s->spellingName;
sym.m_qualification = s->spellingName;
......@@ -509,16 +509,16 @@ protected:
sym.m_location = SourceLocation(s->file->name(), s->line, s->column, s->offset);
switch (s->kind) {
case CXCursor_EnumDecl: sym.m_kind = ClangCodeModel::Symbol::Enum; break;
case CXCursor_EnumDecl: sym.m_kind = Symbol::Enum; break;
case CXCursor_StructDecl:
case CXCursor_ClassDecl: sym.m_kind = ClangCodeModel::Symbol::Class; break;
case CXCursor_CXXMethod: sym.m_kind = ClangCodeModel::Symbol::Method; break;
case CXCursor_ClassDecl: sym.m_kind = Symbol::Class; break;
case CXCursor_CXXMethod: sym.m_kind = Symbol::Method; break;
case CXCursor_FunctionTemplate:
case CXCursor_FunctionDecl: sym.m_kind = ClangCodeModel::Symbol::Function; break;
case CXCursor_DeclStmt: sym.m_kind = ClangCodeModel::Symbol::Declaration; break;
case CXCursor_Constructor: sym.m_kind = ClangCodeModel::Symbol::Constructor; break;
case CXCursor_Destructor: sym.m_kind = ClangCodeModel::Symbol::Destructor; break;
default: sym.m_kind = ClangCodeModel::Symbol::Unknown; break;
case CXCursor_FunctionDecl: sym.m_kind = Symbol::Function; break;
case CXCursor_DeclStmt: sym.m_kind = Symbol::Declaration; break;
case CXCursor_Constructor: sym.m_kind = Symbol::Constructor; break;
case CXCursor_Destructor: sym.m_kind = Symbol::Destructor; break;
default: sym.m_kind = Symbol::Unknown; break;
}
result.append(sym);
......@@ -588,7 +588,7 @@ restart:
goto restart;
}
QStringList opts = ClangCodeModel::Utils::createClangOptions(pPart, fd.m_fileName);
QStringList opts = Utils::createClangOptions(pPart, fd.m_fileName);
if (!pchInfo.isNull())
opts.append(Utils::createPCHInclusionOptions(pchInfo->fileName()));
......
......@@ -369,7 +369,7 @@ void Manager::onProjectListChanged()
\sa CppTools::Constants::TASK_INDEX
*/
void Manager::onTaskStarted(Core::Id type)
void Manager::onTaskStarted(Id type)
{
if (type != CppTools::Constants::TASK_INDEX)
return;
......@@ -385,7 +385,7 @@ void Manager::onTaskStarted(Core::Id type)
\sa CppTools::Constants::TASK_INDEX
*/
void Manager::onAllTasksFinished(Core::Id type)
void Manager::onAllTasksFinished(Id type)
{
if (type != CppTools::Constants::TASK_INDEX)
return;
......
......@@ -718,25 +718,24 @@ void Parser::emitCurrentTree()
Generates a project node file list for the root node \a node.
*/
QStringList Parser::projectNodeFileList(const ProjectExplorer::FolderNode *node) const
QStringList Parser::projectNodeFileList(const FolderNode *node) const
{
QStringList list;
if (!node)
return list;
QList<ProjectExplorer::FileNode *> fileNodes = node->fileNodes();
QList<ProjectExplorer::FolderNode *> subFolderNodes = node->subFolderNodes();
QList<FileNode *> fileNodes = node->fileNodes();
QList<FolderNode *> subFolderNodes = node->subFolderNodes();
foreach (const ProjectExplorer::FileNode *file, fileNodes) {
foreach (const FileNode *file, fileNodes) {
if (file->isGenerated())
continue;
list << file->path();
}
foreach (const ProjectExplorer::FolderNode *folder, subFolderNodes) {
if (folder->nodeType() != ProjectExplorer::FolderNodeType
&& folder->nodeType() != ProjectExplorer::VirtualFolderNodeType)
foreach (const FolderNode *folder, subFolderNodes) {
if (folder->nodeType() != FolderNodeType && folder->nodeType() != VirtualFolderNodeType)
continue;
list << projectNodeFileList(folder);
}
......@@ -751,8 +750,7 @@ QStringList Parser::projectNodeFileList(const ProjectExplorer::FolderNode *node)
Returns a list of projects which were added to the item.
*/
QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item,
const ProjectExplorer::ProjectNode *node)
QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const ProjectNode *node)
{
QStringList projectList;
if (!node)
......@@ -777,9 +775,9 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item,
}
// subnodes
QList<ProjectExplorer::ProjectNode *> projectNodes = node->subProjectNodes();
QList<ProjectNode *> projectNodes = node->subProjectNodes();
foreach (const ProjectExplorer::ProjectNode *project, projectNodes) {
foreach (const ProjectNode *project, projectNodes) {
ParserTreeItem::Ptr itemPrj(new ParserTreeItem());
SymbolInformation information(project->displayName(), project->path());
......@@ -813,11 +811,10 @@ QStringList Parser::getAllFiles(const ProjectNode *node)
d->cachedPrjFileLists[nodePath] = fileList;
}
// subnodes
QList<ProjectExplorer::ProjectNode *> projectNodes = node->subProjectNodes();
QList<ProjectNode *> projectNodes = node->subProjectNodes();
foreach (const ProjectExplorer::ProjectNode *project, projectNodes) {
foreach (const ProjectNode *project, projectNodes)
fileList += getAllFiles(project);
}
return fileList;
}
......
......@@ -1342,7 +1342,7 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde
void CppCodeModelInspectorDialog::refresh()
{
CppTools::CppModelManager *cmmi = CppTools::CppModelManager::instance();
CppModelManager *cmmi = CppModelManager::instance();
const int oldSnapshotIndex = m_ui->snapshotSelector->currentIndex();
const bool selectEditorRelevant
......
......@@ -105,7 +105,7 @@ public:
CppEditorWidgetPrivate(CppEditorWidget *q);
public:
QPointer<CppTools::CppModelManager> m_modelManager;
QPointer<CppModelManager> m_modelManager;
CppEditorDocument *m_cppEditorDocument;
CppEditorOutline *m_cppEditorOutline;
......@@ -114,7 +114,7 @@ public:
CppLocalRenaming m_localRenaming;
CppTools::SemanticInfo m_lastSemanticInfo;
SemanticInfo m_lastSemanticInfo;
QuickFixOperations m_quickFixes;
CppUseSelectionsUpdater m_useSelectionsUpdater;
......@@ -172,7 +172,7 @@ void CppEditorWidget::finalizeInitialization()
SLOT(updateSelectionsForVariableUnderCursor(QList<QTextEdit::ExtraSelection>)));
connect(&d->m_useSelectionsUpdater, &CppUseSelectionsUpdater::finished,
[this] (CppTools::SemanticInfo::LocalUseMap localUses) {
[this] (SemanticInfo::LocalUseMap localUses) {
QTC_CHECK(isSemanticInfoValidExceptLocalUses());
d->m_lastSemanticInfo.localUsesUpdated = true;
d->m_lastSemanticInfo.localUses = localUses;
......@@ -242,7 +242,7 @@ CppEditorDocument *CppEditorWidget::cppEditorDocument() const
return d->m_cppEditorDocument;
}
CppTools::CppEditorOutline *CppEditorWidget::outline() const
CppEditorOutline *CppEditorWidget::outline() const
{
return d->m_cppEditorOutline;
}
......@@ -588,7 +588,7 @@ void CppEditorWidget::applyFontSettings()
void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
{
CppTools::QtStyleCodeFormatter formatter;
QtStyleCodeFormatter formatter;
formatter.invalidateCache(document());
}
......
......@@ -95,7 +95,7 @@ public:
setEditorWidgetCreator([]() { return new CppEditorWidget; });
setEditorCreator([]() { return new CppEditor; });
setAutoCompleterCreator([]() { return new CppAutoCompleter; });
setCommentStyle(Utils::CommentDefinition::CppStyle);
setCommentStyle(CommentDefinition::CppStyle);
setCodeFoldingSupported(true);
setMarksVisible(true);
setParenthesesMatchingEnabled(true);
......@@ -107,7 +107,7 @@ public:
addHoverHandler(new CppHoverHandler);
if (!Utils::HostOsInfo::isMacHost() && !Utils::HostOsInfo::isWindowsHost()) {
if (!HostOsInfo::isMacHost() && !HostOsInfo::isWindowsHost()) {
FileIconProvider::registerIconOverlayForMimeType(
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCppSource, QLatin1String(":/cppeditor/images/qt_cpp.png"))),
Constants::CPP_SOURCE_MIMETYPE);
......@@ -153,7 +153,7 @@ CppQuickFixAssistProvider *CppEditorPlugin::quickFixProvider() const
bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
{
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":/cppeditor/CppEditor.mimetypes.xml"), errorMessage))
if (!MimeDatabase::addMimeTypes(QLatin1String(":/cppeditor/CppEditor.mimetypes.xml"), errorMessage))
return false;
addAutoReleasedObject(new CppEditorFactory);
......@@ -203,7 +203,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
new QAction(tr("Open Function Declaration/Definition in Next Split"), this);
cmd = ActionManager::registerAction(openDeclarationDefinitionInNextSplit,
Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT, context, true);
cmd->setDefaultKeySequence(QKeySequence(Utils::HostOsInfo::isMacHost()
cmd->setDefaultKeySequence(QKeySequence(HostOsInfo::isMacHost()
? tr("Meta+E, Shift+F2")
: tr("Ctrl+E, Shift+F2")));
connect(openDeclarationDefinitionInNextSplit, SIGNAL(triggered()),
......@@ -225,8 +225,8 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cppToolsMenu->addAction(cmd);
m_openIncludeHierarchyAction = new QAction(tr("Open Include Hierarchy"), this);
cmd = Core::ActionManager::registerAction(m_openIncludeHierarchyAction, Constants::OPEN_INCLUDE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+I") : tr("Ctrl+Shift+I")));
cmd = ActionManager::registerAction(m_openIncludeHierarchyAction, Constants::OPEN_INCLUDE_HIERARCHY, context);
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Shift+I") : tr("Ctrl+Shift+I")));
connect(m_openIncludeHierarchyAction, SIGNAL(triggered()), this, SLOT(openIncludeHierarchy()));
contextMenu->addAction(cmd);
cppToolsMenu->addAction(cmd);
......@@ -258,7 +258,7 @@ bool CppEditorPlugin::initialize(const QStringList & /*arguments*/, QString *err
cppToolsMenu->addSeparator(globalContext);
QAction *inspectCppCodeModel = new QAction(tr("Inspect C++ Code Model..."), this);
cmd = ActionManager::registerAction(inspectCppCodeModel, Constants::INSPECT_CPP_CODEMODEL, globalContext);
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12")));
cmd->setDefaultKeySequence(QKeySequence(UseMacShortcuts ? tr("Meta+Shift+F12") : tr("Ctrl+Shift+F12")));
connect(inspectCppCodeModel, SIGNAL(triggered()), this, SLOT(inspectCppCodeModel()));
cppToolsMenu->addAction(cmd);
......@@ -322,7 +322,7 @@ void CppEditorPlugin::showPreProcessorDialog()
editorWidget->showPreProcessorWidget();
}
void CppEditorPlugin::onTaskStarted(Core::Id type)
void CppEditorPlugin::onTaskStarted(Id type)
{
if (type == CppTools::Constants::TASK_INDEX) {
m_renameSymbolUnderCursorAction->setEnabled(false);
......@@ -333,7 +333,7 @@ void CppEditorPlugin::onTaskStarted(Core::Id type)
}
}
void CppEditorPlugin::onAllTasksFinished(Core::Id type)
void CppEditorPlugin::onAllTasksFinished(Id type)
{
if (type == CppTools::Constants::TASK_INDEX) {
m_renameSymbolUnderCursorAction->setEnabled(true);
......@@ -375,8 +375,8 @@ void CppEditorPlugin::openTypeHierarchy()
void CppEditorPlugin::openIncludeHierarchy()
{
if (currentCppEditorWidget()) {
Core::NavigationWidget *navigation = Core::NavigationWidget::instance();
navigation->activateSubWidget(Core::Id(Constants::INCLUDE_HIERARCHY_ID));
NavigationWidget *navigation = NavigationWidget::instance();
navigation->activateSubWidget(Id(Constants::INCLUDE_HIERARCHY_ID));
emit includeHierarchyRequested();
}
}
......
......@@ -128,7 +128,7 @@ void CppElementEvaluator::checkDiagnosticMessage(int pos)
}
}
bool CppElementEvaluator::matchIncludeFile(const CPlusPlus::Document::Ptr &document, unsigned line)
bool CppElementEvaluator::matchIncludeFile(const Document::Ptr &document, unsigned line)
{
foreach (const Document::Include &includeFile, document->resolvedIncludes()) {
if (includeFile.line() == line) {
......@@ -139,7 +139,7 @@ bool CppElementEvaluator::matchIncludeFile(const CPlusPlus::Document::Ptr &docum
return false;
}
bool CppElementEvaluator::matchMacroInUse(const CPlusPlus::Document::Ptr &document, unsigned pos)
bool CppElementEvaluator::matchMacroInUse(const Document::Ptr &document, unsigned pos)
{
foreach (const Document::MacroUse &use, document->macroUses()) {
if (use.containsUtf16charOffset(pos)) {
......@@ -322,7 +322,7 @@ bool CppClass::operator==(const CppClass &other)
return this->declaration == other.declaration;
}
void CppClass::lookupBases(Symbol *declaration, const CPlusPlus::LookupContext &context)
void CppClass::lookupBases(Symbol *declaration, const LookupContext &context)
{
typedef QPair<ClassOrNamespace *, CppClass *> Data;
......@@ -353,7 +353,7 @@ void CppClass::lookupBases(Symbol *declaration, const CPlusPlus::LookupContext &
}
}
void CppClass::lookupDerived(CPlusPlus::Symbol *declaration, const CPlusPlus::Snapshot &snapshot)
void CppClass::lookupDerived(Symbol *declaration, const Snapshot &snapshot)
{
typedef QPair<CppClass *, CppTools::TypeHierarchy> Data;
......@@ -446,7 +446,7 @@ CppVariable::CppVariable(Symbol *declaration, const LookupContext &context, Scop
}
}
CppEnumerator::CppEnumerator(CPlusPlus::EnumeratorDeclaration *declaration)
CppEnumerator::CppEnumerator(EnumeratorDeclaration *declaration)
: CppDeclarableElement(declaration)
{
helpCategory = TextEditor::HelpItem::Enum;
......
......@@ -308,7 +308,7 @@ inline LookupItem skipForwardDeclarations(const QList<LookupItem> &resolvedSymbo
}
CppEditorWidget::Link attemptFuncDeclDef(const QTextCursor &cursor,
CppEditorWidget *, CPlusPlus::Snapshot snapshot, const CPlusPlus::Document::Ptr &document,
CppEditorWidget *, Snapshot snapshot, const Document::Ptr &document,
SymbolFinder *symbolFinder)
{
Link result;
......@@ -624,7 +624,7 @@ TextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &curs
continue;
if (ch == QLatin1Char('(') && !expression.isEmpty()) {
tc.setPosition(pos);
if (TextEditor::TextBlockUserData::findNextClosingParenthesis(&tc, true))
if (TextBlockUserData::findNextClosingParenthesis(&tc, true))
expression.append(tc.selectedText());
}
......@@ -684,8 +684,7 @@ TextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &curs
params.openInNextSplit = inNextSplit;
if (m_virtualFunctionAssistProvider->configure(params)) {
m_widget->invokeAssist(TextEditor::FollowSymbol,
m_virtualFunctionAssistProvider);
m_widget->invokeAssist(FollowSymbol, m_virtualFunctionAssistProvider);
m_virtualFunctionAssistProvider->clearParams();
}
......
......@@ -45,22 +45,22 @@ using namespace TextEditor;
using namespace CPlusPlus;
CppHighlighter::CppHighlighter(QTextDocument *document) :
TextEditor::SyntaxHighlighter(document)
SyntaxHighlighter(document)
{
static QVector<TextEditor::TextStyle> categories;
static QVector<TextStyle> categories;
if (categories.isEmpty()) {
categories << TextEditor::C_NUMBER
<< TextEditor::C_STRING
<< TextEditor::C_TYPE
<< TextEditor::C_KEYWORD
<< TextEditor::C_PRIMITIVE_TYPE
<< TextEditor::C_OPERATOR
<< TextEditor::C_PREPROCESSOR
<< TextEditor::C_LABEL
<< TextEditor::C_COMMENT
<< TextEditor::C_DOXYGEN_COMMENT
<< TextEditor::C_DOXYGEN_TAG
<< TextEditor::C_VISUAL_WHITESPACE;
categories << C_NUMBER
<< C_STRING
<< C_TYPE
<< C_KEYWORD
<< C_PRIMITIVE_TYPE
<< C_OPERATOR
<< C_PREPROCESSOR
<< C_LABEL
<< C_COMMENT
<< C_DOXYGEN_COMMENT
<< C_DOXYGEN_TAG
<< C_VISUAL_WHITESPACE;
}
setTextFormatCategories(categories);
}
......
......@@ -51,7 +51,7 @@ namespace {
Snapshot globalSnapshot()