forked from qt-creator/qt-creator
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: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
f5225c0928
commit
65e7db42b8
@@ -125,13 +125,13 @@ class CppModelManagerPrivate
|
||||
public:
|
||||
// Snapshot
|
||||
mutable QMutex m_snapshotMutex;
|
||||
CPlusPlus::Snapshot m_snapshot;
|
||||
Snapshot m_snapshot;
|
||||
|
||||
// Project integration
|
||||
mutable QMutex m_projectMutex;
|
||||
QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo;
|
||||
QMap<Utils::FileName, QList<CppTools::ProjectPart::Ptr> > m_fileToProjectParts;
|
||||
QMap<QString, CppTools::ProjectPart::Ptr> m_projectFileToProjectPart;
|
||||
QMap<Utils::FileName, QList<ProjectPart::Ptr> > m_fileToProjectParts;
|
||||
QMap<QString, ProjectPart::Ptr> m_projectFileToProjectPart;
|
||||
// The members below are cached/(re)calculated from the projects and/or their project parts
|
||||
bool m_dirty;
|
||||
QStringList m_projectFiles;
|
||||
@@ -236,7 +236,7 @@ QString CppModelManager::editorConfigurationFileName()
|
||||
|
||||
QString CppModelManager::configurationFileName()
|
||||
{
|
||||
return CPlusPlus::Preprocessor::configurationFileName;
|
||||
return Preprocessor::configurationFileName;
|
||||
}
|
||||
|
||||
void CppModelManager::updateModifiedSourceFiles()
|
||||
@@ -312,7 +312,7 @@ CppModelManager::CppModelManager(QObject *parent)
|
||||
this, SLOT(onCoreAboutToClose()));
|
||||
|
||||
qRegisterMetaType<CPlusPlus::Document::Ptr>("CPlusPlus::Document::Ptr");
|
||||
qRegisterMetaType<QList<CPlusPlus::Document::DiagnosticMessage>>(
|
||||
qRegisterMetaType<QList<Document::DiagnosticMessage>>(
|
||||
"QList<CPlusPlus::Document::DiagnosticMessage>");
|
||||
|
||||
d->m_modelManagerSupportFallback.reset(new ModelManagerSupportInternal);
|
||||
@@ -503,36 +503,36 @@ void CppModelManager::unregisterCppEditorDocument(const QString &filePath)
|
||||
}
|
||||
}
|
||||
|
||||
QList<int> CppModelManager::references(CPlusPlus::Symbol *symbol, const LookupContext &context)
|
||||
QList<int> CppModelManager::references(Symbol *symbol, const LookupContext &context)
|
||||
{
|
||||
return d->m_findReferences->references(symbol, context);
|
||||
}
|
||||
|
||||
void CppModelManager::findUsages(CPlusPlus::Symbol *symbol, const CPlusPlus::LookupContext &context)
|
||||
void CppModelManager::findUsages(Symbol *symbol, const LookupContext &context)
|
||||
{
|
||||
if (symbol->identifier())
|
||||
d->m_findReferences->findUsages(symbol, context);
|
||||
}
|
||||
|
||||
void CppModelManager::renameUsages(CPlusPlus::Symbol *symbol,
|
||||
const CPlusPlus::LookupContext &context,
|
||||
void CppModelManager::renameUsages(Symbol *symbol,
|
||||
const LookupContext &context,
|
||||
const QString &replacement)
|
||||
{
|
||||
if (symbol->identifier())
|
||||
d->m_findReferences->renameUsages(symbol, context, replacement);
|
||||
}
|
||||
|
||||
void CppModelManager::findMacroUsages(const CPlusPlus::Macro ¯o)
|
||||
void CppModelManager::findMacroUsages(const Macro ¯o)
|
||||
{
|
||||
d->m_findReferences->findMacroUses(macro);
|
||||
}
|
||||
|
||||
void CppModelManager::renameMacroUsages(const CPlusPlus::Macro ¯o, const QString &replacement)
|
||||
void CppModelManager::renameMacroUsages(const Macro ¯o, const QString &replacement)
|
||||
{
|
||||
d->m_findReferences->renameMacroUses(macro, replacement);
|
||||
}
|
||||
|
||||
void CppModelManager::replaceSnapshot(const CPlusPlus::Snapshot &newSnapshot)
|
||||
void CppModelManager::replaceSnapshot(const Snapshot &newSnapshot)
|
||||
{
|
||||
QMutexLocker snapshotLocker(&d->m_snapshotMutex);
|
||||
d->m_snapshot = newSnapshot;
|
||||
|
Reference in New Issue
Block a user