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 ...@@ -827,7 +827,7 @@ TopLevelDeclarationProcessor *Control::topLevelDeclarationProcessor() const
return d->processor; return d->processor;
} }
void Control::setTopLevelDeclarationProcessor(CPlusPlus::TopLevelDeclarationProcessor *processor) void Control::setTopLevelDeclarationProcessor(TopLevelDeclarationProcessor *processor)
{ {
d->processor = processor; d->processor = processor;
} }
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
#include <cstring> #include <cstring>
using namespace CPlusPlus; namespace CPlusPlus {
class CPlusPlus::SymbolTable class SymbolTable
{ {
SymbolTable(const SymbolTable &other); SymbolTable(const SymbolTable &other);
void operator =(const SymbolTable &other); void operator =(const SymbolTable &other);
...@@ -293,3 +293,5 @@ unsigned Scope::endOffset() const ...@@ -293,3 +293,5 @@ unsigned Scope::endOffset() const
void Scope::setEndOffset(unsigned offset) void Scope::setEndOffset(unsigned offset)
{ _endOffset = offset; } { _endOffset = offset; }
} // namespace CPlusPlus
...@@ -503,7 +503,7 @@ QString Document::functionAt(int line, int column, int *lineOpeningDeclaratorPar ...@@ -503,7 +503,7 @@ QString Document::functionAt(int line, int column, int *lineOpeningDeclaratorPar
if (line < 1 || column < 1) if (line < 1 || column < 1)
return QString(); return QString();
CPlusPlus::Symbol *symbol = lastVisibleSymbolAt(line, column); Symbol *symbol = lastVisibleSymbolAt(line, column);
if (!symbol) if (!symbol)
return QString(); return QString();
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
using namespace CPlusPlus; 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 h1 = QT_PREPEND_NAMESPACE(qHash)(key.type().type());
const uint h2 = QT_PREPEND_NAMESPACE(qHash)(key.scope()); const uint h2 = QT_PREPEND_NAMESPACE(qHash)(key.scope());
......
...@@ -747,7 +747,7 @@ bool ResolveExpression::visit(SimpleNameAST *ast) ...@@ -747,7 +747,7 @@ bool ResolveExpression::visit(SimpleNameAST *ast)
if (typeItems.empty()) if (typeItems.empty())
continue; continue;
CPlusPlus::Clone cloner(_context.bindings()->control().data()); Clone cloner(_context.bindings()->control().data());
for (int n = 0; n < typeItems.size(); ++ n) { for (int n = 0; n < typeItems.size(); ++ n) {
FullySpecifiedType newType = cloner.type(typeItems[n].type(), 0); FullySpecifiedType newType = cloner.type(typeItems[n].type(), 0);
......
...@@ -46,12 +46,16 @@ ...@@ -46,12 +46,16 @@
//#define TIME_COMPLETION //#define TIME_COMPLETION
class ClangCodeModel::ClangCompleter::PrivateData using namespace ClangCodeModel::Internal;
namespace ClangCodeModel {
class ClangCompleter::PrivateData
{ {
public: public:
PrivateData() PrivateData()
: m_mutex(QMutex::Recursive) : m_mutex(QMutex::Recursive)
, m_unit(Internal::Unit::create()) , m_unit(Unit::create())
, m_isSignalSlotCompletion(false) , m_isSignalSlotCompletion(false)
{ {
} }
...@@ -60,7 +64,7 @@ public: ...@@ -60,7 +64,7 @@ public:
{ {
} }
bool parseFromFile(const Internal::UnsavedFiles &unsavedFiles) bool parseFromFile(const UnsavedFiles &unsavedFiles)
{ {
Q_ASSERT(!m_unit->isLoaded()); Q_ASSERT(!m_unit->isLoaded());
if (m_unit->fileName().isEmpty()) if (m_unit->fileName().isEmpty())
...@@ -80,13 +84,10 @@ public: ...@@ -80,13 +84,10 @@ public:
public: public:
QMutex m_mutex; QMutex m_mutex;
Internal::Unit::Ptr m_unit; Unit::Ptr m_unit;
bool m_isSignalSlotCompletion; bool m_isSignalSlotCompletion;
}; };
using namespace ClangCodeModel;
using namespace ClangCodeModel::Internal;
/** /**
* @brief Constructs with highest possible priority * @brief Constructs with highest possible priority
*/ */
...@@ -127,7 +128,7 @@ QString ClangCompleter::fileName() const ...@@ -127,7 +128,7 @@ QString ClangCompleter::fileName() const
void ClangCompleter::setFileName(const QString &fileName) void ClangCompleter::setFileName(const QString &fileName)
{ {
if (d->m_unit->fileName() != 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 ...@@ -208,3 +209,5 @@ QMutex *ClangCompleter::mutex() const
{ {
return &d->m_mutex; return &d->m_mutex;
} }
} // namespace ClangCodeModel
...@@ -190,7 +190,7 @@ namespace Internal { ...@@ -190,7 +190,7 @@ namespace Internal {
// ClangCompletionAssistProvider // ClangCompletionAssistProvider
// ----------------------------- // -----------------------------
ClangCompletionAssistProvider::ClangCompletionAssistProvider() ClangCompletionAssistProvider::ClangCompletionAssistProvider()
: m_clangCompletionWrapper(new ClangCodeModel::ClangCompleter) : m_clangCompletionWrapper(new ClangCompleter)
{ {
} }
...@@ -215,15 +215,15 @@ AssistInterface *ClangCompletionAssistProvider::createAssistInterface( ...@@ -215,15 +215,15 @@ AssistInterface *ClangCompletionAssistProvider::createAssistInterface(
foreach (ProjectPart::Ptr part, parts) { foreach (ProjectPart::Ptr part, parts) {
if (part.isNull()) if (part.isNull())
continue; continue;
options = ClangCodeModel::Utils::createClangOptions(part, filePath); options = Utils::createClangOptions(part, filePath);
pchInfo = PchManager::instance()->pchInfo(part); pchInfo = PchManager::instance()->pchInfo(part);
if (!pchInfo.isNull()) if (!pchInfo.isNull())
options.append(ClangCodeModel::Utils::createPCHInclusionOptions(pchInfo->fileName())); options.append(Utils::createPCHInclusionOptions(pchInfo->fileName()));
headerPaths = part->headerPaths; headerPaths = part->headerPaths;
break; break;
} }
return new ClangCodeModel::ClangCompletionAssistInterface( return new ClangCompletionAssistInterface(
m_clangCompletionWrapper, m_clangCompletionWrapper,
document, position, filePath, reason, document, position, filePath, reason,
options, headerPaths, pchInfo); options, headerPaths, pchInfo);
...@@ -287,7 +287,7 @@ public: ...@@ -287,7 +287,7 @@ public:
virtual int activeArgument(const QString &prefix) const; virtual int activeArgument(const QString &prefix) const;
private: private:
QList<ClangCodeModel::CodeCompletionResult> m_functionSymbols; QList<CodeCompletionResult> m_functionSymbols;
mutable int m_currentArg; mutable int m_currentArg;
}; };
...@@ -323,7 +323,7 @@ int ClangFunctionHintModel::activeArgument(const QString &prefix) const ...@@ -323,7 +323,7 @@ int ClangFunctionHintModel::activeArgument(const QString &prefix) const
SimpleLexer tokenize; SimpleLexer tokenize;
Tokens tokens = tokenize(prefix); Tokens tokens = tokenize(prefix);
for (int i = 0; i < tokens.count(); ++i) { 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)) if (tk.is(T_LPAREN))
++parcount; ++parcount;
else if (tk.is(T_RPAREN)) else if (tk.is(T_RPAREN))
...@@ -544,7 +544,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface(ClangCompleter::P ...@@ -544,7 +544,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface(ClangCompleter::P
const QString &fileName, const QString &fileName,
AssistReason reason, AssistReason reason,
const QStringList &options, const QStringList &options,
const QList<CppTools::ProjectPart::HeaderPath> &headerPaths, const QList<ProjectPart::HeaderPath> &headerPaths,
const PchInfo::Ptr &pchInfo) const PchInfo::Ptr &pchInfo)
: AssistInterface(document, position, fileName, reason) : AssistInterface(document, position, fileName, reason)
, m_clangWrapper(clangWrapper) , m_clangWrapper(clangWrapper)
...@@ -719,7 +719,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos, ...@@ -719,7 +719,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
tokenize.setSkipComments(false); tokenize.setSkipComments(false);
const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block())); 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 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))) { if (*kind == T_DOXY_COMMENT && !(tk.is(T_DOXY_COMMENT) || tk.is(T_CPP_DOXY_COMMENT))) {
*kind = T_EOF_SYMBOL; *kind = T_EOF_SYMBOL;
...@@ -740,7 +740,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos, ...@@ -740,7 +740,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
} }
else if (*kind == T_LPAREN) { else if (*kind == T_LPAREN) {
if (tokenIdx > 0) { 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()) { switch (previousToken.kind()) {
case T_IDENTIFIER: case T_IDENTIFIER:
case T_GREATER: case T_GREATER:
...@@ -761,7 +761,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos, ...@@ -761,7 +761,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int pos,
if (tokens.size() >= 3) { if (tokens.size() >= 3) {
if (tokens.at(0).is(T_POUND) && tokens.at(1).is(T_IDENTIFIER) && (tokens.at(2).is(T_STRING_LITERAL) || 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))) { 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(), QString directive = tc.block().text().mid(directiveToken.bytesBegin(),
directiveToken.bytes()); directiveToken.bytes());
if (directive == QLatin1String("include") || if (directive == QLatin1String("include") ||
...@@ -830,7 +830,7 @@ bool ClangCompletionAssistProcessor::accepts() const ...@@ -830,7 +830,7 @@ bool ClangCompletionAssistProcessor::accepts() const
tokenize.setSkipComments(false); tokenize.setSkipComments(false);
const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block())); const Tokens &tokens = tokenize(tc.block().text(), BackwardsScanner::previousBlockState(tc.block()));
const int tokenIdx = SimpleLexer::tokenBefore(tokens, qMax(0, tc.positionInBlock() - 1)); 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()) { if (!tk.isComment() && !tk.isLiteral()) {
return true; return true;
...@@ -839,7 +839,7 @@ bool ClangCompletionAssistProcessor::accepts() const ...@@ -839,7 +839,7 @@ bool ClangCompletionAssistProcessor::accepts() const
&& tokens.at(0).kind() == T_POUND && tokens.at(0).kind() == T_POUND
&& tokens.at(1).kind() == T_IDENTIFIER) { && tokens.at(1).kind() == T_IDENTIFIER) {
const QString &line = tc.block().text(); const QString &line = tc.block().text();
const CPlusPlus::Token &idToken = tokens.at(1); const Token &idToken = tokens.at(1);
const QStringRef &identifier = const QStringRef &identifier =
line.midRef(idToken.bytesBegin(), line.midRef(idToken.bytesBegin(),
idToken.bytesEnd() - idToken.bytesBegin()); idToken.bytesEnd() - idToken.bytesBegin());
......
...@@ -66,5 +66,5 @@ CppTools::CppCompletionAssistProvider *ModelManagerSupport::completionAssistProv ...@@ -66,5 +66,5 @@ CppTools::CppCompletionAssistProvider *ModelManagerSupport::completionAssistProv
CppTools::BaseEditorDocumentProcessor *ModelManagerSupport::editorDocumentProcessor( CppTools::BaseEditorDocumentProcessor *ModelManagerSupport::editorDocumentProcessor(
TextEditor::TextDocument *baseTextDocument) TextEditor::TextDocument *baseTextDocument)
{ {
return new ClangCodeModel::ClangEditorDocumentProcessor(baseTextDocument); return new ClangEditorDocumentProcessor(baseTextDocument);
} }
...@@ -75,7 +75,7 @@ UnsavedFiles createUnsavedFiles(WorkingCopy workingCopy) ...@@ -75,7 +75,7 @@ UnsavedFiles createUnsavedFiles(WorkingCopy workingCopy)
// TODO: Reason: the UnsavedFile needs a QByteArray. // TODO: Reason: the UnsavedFile needs a QByteArray.
QSet< ::Utils::FileName> modifiedFiles; QSet< ::Utils::FileName> modifiedFiles;
foreach (IDocument *doc, Core::DocumentManager::modifiedDocuments()) foreach (IDocument *doc, DocumentManager::modifiedDocuments())
modifiedFiles.insert(doc->filePath()); modifiedFiles.insert(doc->filePath());
UnsavedFiles result; UnsavedFiles result;
...@@ -112,7 +112,7 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, const QString &fil ...@@ -112,7 +112,7 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, const QString &fil
static QString getResourceDir() 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")); QLatin1String(CLANG_VERSION) + QLatin1String("/include"));
if (!dir.exists() || !QFileInfo(dir, QLatin1String("stdint.h")).exists()) if (!dir.exists() || !QFileInfo(dir, QLatin1String("stdint.h")).exists())
dir = QDir(QLatin1String(CLANG_RESOURCE_DIR)); dir = QDir(QLatin1String(CLANG_RESOURCE_DIR));
...@@ -144,18 +144,17 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind ...@@ -144,18 +144,17 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind
result << QLatin1String("-v"); result << QLatin1String("-v");
const bool objcExt = pPart->languageExtensions & ProjectPart::ObjectiveCExtensions; const bool objcExt = pPart->languageExtensions & ProjectPart::ObjectiveCExtensions;
result << CppTools::CompilerOptionsBuilder::createLanguageOption(fileKind, objcExt); result << CompilerOptionsBuilder::createLanguageOption(fileKind, objcExt);
result << CppTools::CompilerOptionsBuilder::createOptionsForLanguage( result << CompilerOptionsBuilder::createOptionsForLanguage(
pPart->languageVersion, pPart->languageVersion,
pPart->languageExtensions, pPart->languageExtensions,
maybeIncludeBorlandExtensions()); maybeIncludeBorlandExtensions());
result << CppTools::CompilerOptionsBuilder::createDefineOptions(pPart->toolchainDefines); result << CompilerOptionsBuilder::createDefineOptions(pPart->toolchainDefines);
result << CppTools::CompilerOptionsBuilder::createDefineOptions(pPart->projectDefines); result << CompilerOptionsBuilder::createDefineOptions(pPart->projectDefines);
result << CppTools::CompilerOptionsBuilder::createHeaderPathOptions(pPart->headerPaths, result << CompilerOptionsBuilder::createHeaderPathOptions(pPart->headerPaths, isBlacklisted);
isBlacklisted);
// Inject header file // 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"); + QLatin1String("/cplusplus/qt%1-qobjectdefs-injected.h");
// if (qtVersion == ProjectPart::Qt4) // if (qtVersion == ProjectPart::Qt4)
// opts << QLatin1String("-include") << injectedHeader.arg(QLatin1Char('4')); // opts << QLatin1String("-include") << injectedHeader.arg(QLatin1Char('4'));
......
...@@ -244,7 +244,7 @@ protected: ...@@ -244,7 +244,7 @@ protected:
indexingResults.reserve(m_allFiles.size()); indexingResults.reserve(m_allFiles.size());
foreach (const QString &fn, m_allFiles.keys()) { 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()); QSet<QString> processedFiles = QSet<QString>::fromList(m_allFiles.keys());
Unit::Ptr unit = Unit::create(fn); Unit::Ptr unit = Unit::create(fn);
IndexingResult indexingResult(symbols, processedFiles, unit, projectPart); IndexingResult indexingResult(symbols, processedFiles, unit, projectPart);
...@@ -487,18 +487,18 @@ protected: ...@@ -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(); const QVector<Symbol *> symbolsForFile = file(fileName)->symbols();
foreach (const Symbol *s, symbolsForFile) { foreach (const Symbol *s, symbolsForFile) {
unfoldSymbols(s, result); unfoldSymbols(s, result);
} }
} }
void unfoldSymbols(const Symbol *s, QVector<ClangCodeModel::Symbol> &result) { void unfoldSymbols(const Symbol *s, QVector<Symbol> &result) {
if (!s->file) if (!s->file)
return; return;
ClangCodeModel::Symbol sym; Symbol sym;
sym.m_name = s->spellingName; sym.m_name = s->spellingName;
sym.m_qualification = s->spellingName; sym.m_qualification = s->spellingName;
...@@ -509,16 +509,16 @@ protected: ...@@ -509,16 +509,16 @@ protected:
sym.m_location = SourceLocation(s->file->name(), s->line, s->column, s->offset); sym.m_location = SourceLocation(s->file->name(), s->line, s->column, s->offset);
switch (s->kind) { 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_StructDecl:
case CXCursor_ClassDecl: sym.m_kind = ClangCodeModel::Symbol::Class; break; case CXCursor_ClassDecl: sym.m_kind = Symbol::Class; break;
case CXCursor_CXXMethod: sym.m_kind = ClangCodeModel::Symbol::Method; break; case CXCursor_CXXMethod: sym.m_kind = Symbol::Method; break;
case CXCursor_FunctionTemplate: case CXCursor_FunctionTemplate:
case CXCursor_FunctionDecl: sym.m_kind = ClangCodeModel::Symbol::Function; break; case CXCursor_FunctionDecl: sym.m_kind = Symbol::Function; break;
case CXCursor_DeclStmt: sym.m_kind = ClangCodeModel::Symbol::Declaration; break; case CXCursor_DeclStmt: sym.m_kind = Symbol::Declaration; break;
case CXCursor_Constructor: sym.m_kind = ClangCodeModel::Symbol::Constructor; break; case CXCursor_Constructor: sym.m_kind = Symbol::Constructor; break;
case CXCursor_Destructor: sym.m_kind = ClangCodeModel::Symbol::Destructor; break; case CXCursor_Destructor: sym.m_kind = Symbol::Destructor; break;
default: sym.m_kind = ClangCodeModel::Symbol::Unknown; break; default: sym.m_kind = Symbol::Unknown; break;
} }
result.append(sym); result.append(sym);
...@@ -588,7 +588,7 @@ restart: ...@@ -588,7 +588,7 @@ restart:
goto restart; goto restart;
} }
QStringList opts = ClangCodeModel::Utils::createClangOptions(pPart, fd.m_fileName); QStringList opts = Utils::createClangOptions(pPart, fd.m_fileName);
if (!pchInfo.isNull()) if (!pchInfo.isNull())
opts.append(Utils::createPCHInclusionOptions(pchInfo->fileName())); opts.append(Utils::createPCHInclusionOptions(pchInfo->fileName()));
......
...@@ -369,7 +369,7 @@ void Manager::onProjectListChanged() ...@@ -369,7 +369,7 @@ void Manager::onProjectListChanged()
\sa CppTools::Constants::TASK_INDEX \sa CppTools::Constants::TASK_INDEX
*/ */
void Manager::onTaskStarted(Core::Id type) void Manager::onTaskStarted(Id type)
{ {
if (type != CppTools::Constants::TASK_INDEX) if (type != CppTools::Constants::TASK_INDEX)
return; return;
...@@ -385,7 +385,7 @@ void Manager::onTaskStarted(Core::Id type) ...@@ -385,7 +385,7 @@ void Manager::onTaskStarted(Core::Id type)
\sa CppTools::Constants::TASK_INDEX \sa CppTools::Constants::TASK_INDEX
*/ */
void Manager::onAllTasksFinished(Core::Id type) void Manager::onAllTasksFinished(Id type)
{ {
if (type != CppTools::Constants::TASK_INDEX) if (type != CppTools::Constants::TASK_INDEX)
return; return;
......
...@@ -718,25 +718,24 @@ void Parser::emitCurrentTree() ...@@ -718,25 +718,24 @@ void Parser::emitCurrentTree()
Generates a project node file list for the root node \a node. 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; QStringList list;
if (!node) if (!node)
return list; return list;
QList<ProjectExplorer::FileNode *> fileNodes = node->fileNodes(); QList<FileNode *> fileNodes = node->fileNodes();
QList<ProjectExplorer::FolderNode *> subFolderNodes = node->subFolderNodes(); QList<FolderNode *> subFolderNodes = node->subFolderNodes();
foreach (const ProjectExplorer::FileNode *file, fileNodes) { foreach (const FileNode *file, fileNodes) {
if (file->isGenerated()) if (file->isGenerated())
continue; continue;
list << file->path(); list << file->path();
} }
foreach (const ProjectExplorer::FolderNode *folder, subFolderNodes) { foreach (const FolderNode *folder, subFolderNodes) {
if (folder->nodeType() != ProjectExplorer::FolderNodeType if (folder->nodeType() != FolderNodeType && folder->nodeType() != VirtualFolderNodeType)
&& folder->nodeType() != ProjectExplorer::VirtualFolderNodeType)
continue; continue;
list << projectNodeFileList(folder); list << projectNodeFileList(folder);
} }
...@@ -751,8 +750,7 @@ QStringList Parser::projectNodeFileList(const ProjectExplorer::FolderNode *node) ...@@ -751,8 +750,7 @@ QStringList Parser::projectNodeFileList(const ProjectExplorer::FolderNode *node)
Returns a list of projects which were added to the item. Returns a list of projects which were added to the item.
*/ */
QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const ProjectNode *node)
const ProjectExplorer::ProjectNode *node)
{ {
QStringList projectList; QStringList projectList;
if (!node) if (!node)
...@@ -777,9 +775,9 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, ...@@ -777,9 +775,9 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item,
} }
// subnodes // 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()); ParserTreeItem::Ptr itemPrj(new ParserTreeItem());
SymbolInformation information(project->displayName(), project->path()); SymbolInformation information(project->displayName(), project->path());
...@@ -813,11 +811,10 @@ QStringList Parser::getAllFiles(const ProjectNode *node) ...@@ -813,11 +811,10 @@ QStringList Parser::getAllFiles(const ProjectNode *node)
d->cachedPrjFileLists[nodePath] = fileList; d->cachedPrjFileLists[nodePath] = fileList;
} }
// subnodes // 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); fileList += getAllFiles(project);
}
return fileList; return fileList;
} }
......
...@@ -1342,7 +1342,7 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde ...@@ -1342,7 +1342,7 @@ void CppCodeModelInspectorDialog::onWorkingCopyDocumentSelected(const QModelInde
void CppCodeModelInspectorDialog::refresh() void CppCodeModelInspectorDialog::refresh()
{ {
CppTools::CppModelManager *cmmi = CppTools::CppModelManager::instance(); CppModelManager *cmmi = CppModelManager::instance();
const int oldSnapshotIndex = m_ui->snapshotSelector->currentIndex(); const int oldSnapshotIndex = m_ui->snapshotSelector->currentIndex();
const bool selectEditorRelevant const bool selectEditorRelevant
......
<
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
CppEditorWidgetPrivate(CppEditorWidget *q); CppEditorWidgetPrivate(CppEditorWidget *q);
public: public:
QPointer<CppTools::CppModelManager> m_modelManager; QPointer<CppModelManager> m_modelManager;
CppEditorDocument *m_cppEditorDocument; CppEditorDocument *m_cppEditorDocument;
CppEditorOutline *m_cppEditorOutline; CppEditorOutline *m_cppEditorOutline;
...@@ -114,7 +114,7 @@ public: ...@@ -114,7 +114,7 @@ public:
CppLocalRenaming m_localRenaming; CppLocalRenaming m_localRenaming;
CppTools::SemanticInfo m_lastSemanticInfo; SemanticInfo m_lastSemanticInfo;
QuickFixOperations m_quickFixes; QuickFixOperations m_quickFixes;
CppUseSelectionsUpdater m_useSelectionsUpdater; CppUseSelectionsUpdater m_useSelectionsUpdater;
...@@ -172,7 +172,7 @@ void CppEditorWidget::finalizeInitialization() ...@@ -172,7 +172,7 @@ void CppEditorWidget::finalizeInitialization()
SLOT(updateSelectionsForVariableUnderCursor(QList<QTextEdit::ExtraSelection>))); SLOT(updateSelectionsForVariableUnderCursor(QList<QTextEdit::ExtraSelection>)));
connect(&d->m_useSelectionsUpdater, &CppUseSelectionsUpdater::finished, connect(&d->m_useSelectionsUpdater, &CppUseSelectionsUpdater::finished,
[this] (CppTools::SemanticInfo::LocalUseMap localUses) { [this] (SemanticInfo::LocalUseMap localUses) {
QTC_CHECK(isSemanticInfoValidExceptLocalUses()); QTC_CHECK(isSemanticInfoValidExceptLocalUses());
d->m_lastSemanticInfo.localUsesUpdated = true; d->m_lastSemanticInfo.localUsesUpdated = true;
d->m_lastSemanticInfo.localUses = localUses; d->m_lastSemanticInfo.localUses = localUses;
...@@ -242,7 +242,7 @@ CppEditorDocument *CppEditorWidget::cppEditorDocument() const ...@@ -242,7 +242,7 @@ CppEditorDocument *CppEditorWidget::cppEditorDocument() const
return d->m_cppEditorDocument; return d->m_cppEditorDocument;
} }
CppTools::CppEditorOutline *CppEditorWidget::outline() const CppEditorOutline *CppEditorWidget::outline() const
{ {
return d->m_cppEditorOutline; return d->m_cppEditorOutline;
} }
...@@ -588,7 +588,7 @@ void CppEditorWidget::applyFontSettings() ...@@ -588,7 +588,7 @@ void CppEditorWidget::applyFontSettings()
void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &) void CppEditorWidget::slotCodeStyleSettingsChanged(const QVariant &)
{ {
CppTools::QtStyleCodeFormatter formatter; QtStyleCodeFormatter formatter;