Prefer static to anonymous namespace for global functions

This commit is contained in:
Thorbjørn Lindeijer
2010-06-15 14:36:10 +02:00
parent 77558abc32
commit 16989185df

View File

@@ -67,10 +67,8 @@ using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal; using namespace QmlJSEditor::Internal;
using namespace QmlJS; using namespace QmlJS;
namespace {
// Temporary workaround until we have proper icons for QML completion items // Temporary workaround until we have proper icons for QML completion items
QIcon iconForColor(const QColor &color) static QIcon iconForColor(const QColor &color)
{ {
QPixmap pix(6, 6); QPixmap pix(6, 6);
@@ -100,7 +98,7 @@ QIcon iconForColor(const QColor &color)
return pix; return pix;
} }
bool checkStartOfIdentifier(const QString &word) static bool checkStartOfIdentifier(const QString &word)
{ {
if (word.isEmpty()) if (word.isEmpty())
return false; return false;
@@ -116,7 +114,7 @@ bool checkStartOfIdentifier(const QString &word)
} }
} }
bool isIdentifierChar(QChar ch) static bool isIdentifierChar(QChar ch)
{ {
switch (ch.unicode()) { switch (ch.unicode()) {
case '_': case '$': case '_': case '$':
@@ -127,6 +125,8 @@ bool isIdentifierChar(QChar ch)
} }
} }
namespace {
class SearchPropertyDefinitions: protected AST::Visitor class SearchPropertyDefinitions: protected AST::Visitor
{ {
QList<AST::UiPublicMember *> _properties; QList<AST::UiPublicMember *> _properties;