diff options
Diffstat (limited to 'src/tools/qstring.cpp')
-rw-r--r-- | src/tools/qstring.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/src/tools/qstring.cpp b/src/tools/qstring.cpp index 1288fd7..c7b0c95 100644 --- a/src/tools/qstring.cpp +++ b/src/tools/qstring.cpp @@ -93,9 +93,9 @@ #define ULLONG_MAX Q_UINT64_C(18446744073709551615) #endif -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) #include "qmutex.h" -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE extern QMutex *qt_sharedStringMutex; @@ -1053,9 +1053,9 @@ QStringData::QStringData() : QShared(), maxl(0), islatin1(FALSE), security_unpaged(FALSE) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) mutex = new QMutex(FALSE); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE ref(); } @@ -1067,9 +1067,9 @@ QStringData::QStringData(QChar *u, uint l, uint m) : QShared(), maxl(m), islatin1(FALSE), security_unpaged(FALSE) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) mutex = new QMutex(FALSE); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } QStringData::~QStringData() { @@ -1084,12 +1084,12 @@ QStringData::~QStringData() { if ( ascii ) { delete[] ascii; } -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) if ( mutex ) { delete mutex; mutex = NULL; } -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } void QStringData::setDirty() { @@ -1457,14 +1457,14 @@ QT_STATIC_CONST_IMPL QChar QChar::nbsp((ushort)0x00a0); QStringData* QString::makeSharedNull() { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) if (qt_sharedStringMutex) qt_sharedStringMutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if (QString::shared_null) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) if (qt_sharedStringMutex) qt_sharedStringMutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE return QString::shared_null; } @@ -1474,9 +1474,9 @@ QStringData* QString::makeSharedNull() that->d = QString::shared_null; #endif -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) if (qt_sharedStringMutex) qt_sharedStringMutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE return QString::shared_null; } @@ -1517,13 +1517,13 @@ QString::QString( const QString &s ) : d(s.d) { if ( d && (d != shared_null) ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE d->ref(); -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } } @@ -1676,20 +1676,20 @@ QString::~QString() return; } -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d->deref() ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE d->deleteSelf(); d = NULL; } else { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } } @@ -1711,22 +1711,22 @@ void QString::real_detach() void QString::deref() { if ( d && (d != shared_null) ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d->deref() ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d != shared_null ) { delete d; } d = 0; } else { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } } } @@ -1769,13 +1769,13 @@ void QStringData::deleteSelf() QString &QString::operator=( const QString &s ) { if ( s.d && (s.d != shared_null) ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) s.d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE s.d->ref(); -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) s.d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } deref(); d = s.d; @@ -1883,9 +1883,9 @@ void QString::truncate( uint newLen ) */ void QString::setLength( uint newLen ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d->count != 1 || newLen > d->maxl || ( newLen * 4 < d->maxl && d->maxl > 4 ) ) { @@ -1896,24 +1896,24 @@ void QString::setLength( uint newLen ) uint len = QMIN( d->len, newLen ); memcpy( nd, d->unicode, sizeof(QChar) * len ); bool unpaged = d->security_unpaged; -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE deref(); d = new QStringData( nd, newLen, newMax ); setSecurityUnPaged(unpaged); } else { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } } else { d->len = newLen; -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE d->setDirty(); } } @@ -1999,21 +1999,21 @@ void QString::squeeze() */ void QString::grow( uint newLen ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d->count != 1 || newLen > d->maxl ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE setLength( newLen ); } else { d->len = newLen; -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE d->setDirty(); } } @@ -6423,19 +6423,19 @@ QString QString::fromUcs2( const unsigned short *str ) */ QChar& QString::ref(uint i) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( (d->count != 1) || (i >= d->len) ) { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE subat( i ); } else { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } d->setDirty(); return d->unicode[i]; @@ -6523,9 +6523,9 @@ QString& QString::setUnicode( const QChar *unicode, uint len ) } } else { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d->count != 1 || len > d->maxl || ( len * 4 < d->maxl && d->maxl > 4 ) ) { // detach, grown or shrink uint newMax = computeNewMax( len ); @@ -6533,17 +6533,17 @@ QString& QString::setUnicode( const QChar *unicode, uint len ) if ( unicode ) { memcpy( nd, unicode, sizeof(QChar)*len ); } -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE deref(); d = new QStringData( nd, len, newMax ); } else { d->len = len; -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE d->setDirty(); if ( unicode ) { memcpy( d->unicode, unicode, sizeof(QChar)*len ); @@ -7254,9 +7254,9 @@ QConstString::QConstString( const QChar* unicode, uint length ) : */ QConstString::~QConstString() { -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->lock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE if ( d->count > 1 ) { QChar* cp = QT_ALLOC_QCHAR_VEC( d->len ); @@ -7268,9 +7268,9 @@ QConstString::~QConstString() } // The original d->unicode is now unlinked. -#if defined(QT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) +#if defined(TQT_THREAD_SUPPORT) && defined(MAKE_QSTRING_THREAD_SAFE) d->mutex->unlock(); -#endif // QT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE +#endif // TQT_THREAD_SUPPORT && MAKE_QSTRING_THREAD_SAFE } /*! |