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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user