summaryrefslogtreecommitdiffstats
path: root/qtools/qstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'qtools/qstring.h')
-rw-r--r--qtools/qstring.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/qtools/qstring.h b/qtools/qstring.h
index 4357809..0dd6352 100644
--- a/qtools/qstring.h
+++ b/qtools/qstring.h
@@ -368,9 +368,15 @@ public:
QString &operator=( QChar c );
QString &operator=( char c );
- QT_STATIC_CONST QString null;
-
- bool isNull() const;
+ //QT_STATIC_CONST QString null;
+ //bool isNull() const;
+
+ struct Null { };
+ static const Null null;
+ inline QString(const Null &): d(shared_null) { d->ref(); }
+ inline QString &operator=(const Null &) { *this = QString(); return *this; }
+ inline bool isNull() const { return d == shared_null; }
+
bool isEmpty() const;
uint length() const;
void truncate( uint pos );
@@ -662,8 +668,8 @@ inline QString &QString::operator=( QChar c )
inline QString &QString::operator=( char c )
{ return *this = QString(QChar(c)); }
-inline bool QString::isNull() const
-{ return unicode() == 0; }
+//inline bool QString::isNull() const
+//{ return unicode() == 0; }
inline bool QString::operator!() const
{ return isNull(); }