diff -Naur qt-x11-free-3.0.2.orig/src/tools/qstring.cpp qt-x11-free-3.0.2/src/tools/qstring.cpp --- qt-x11-free-3.0.2.orig/src/tools/qstring.cpp Sun Mar 3 14:52:32 2002 +++ qt-x11-free-3.0.2/src/tools/qstring.cpp Sun Mar 3 14:52:32 2002 @@ -12603,9 +12603,9 @@ \sa isNull() */ -QString::QString( int size, bool /*dummy*/ ) +QString::QString( int size, bool make_blank ) { - if ( size ) { + if ( size || ( !size && make_blank ) ) { Q2HELPER(stat_construct_int++) int l = size; Q2HELPER(stat_construct_int_size+=l) @@ -12626,9 +12626,14 @@ QString::QString( const QByteArray& ba ) { Q2HELPER(stat_construct_ba++) - uint l; - QChar *uc = internalAsciiToUnicode(ba,&l); - d = new QStringData(uc,l,l); + if(ba.isNull()) { + QString tmp = ba.size() ? QString::fromLocal8Bit(ba.data()) : QString(0,true); + tmp.d->ref(); + d = tmp.d; + } else { + d = shared_null ? shared_null : makeSharedNull(); + d->ref(); + } } /*! @@ -12679,10 +12684,14 @@ QString::QString( const char *str ) { Q2HELPER(stat_construct_charstar++) - uint l; - QChar *uc = internalAsciiToUnicode(str,&l); - Q2HELPER(stat_construct_charstar_size+=l) - d = new QStringData(uc,l,l); + if(str) { + QString tmp = str[0] ? QString::fromLocal8Bit(str) : QString(0,true); + tmp.d->ref(); + d = tmp.d; + } else { + d = shared_null ? shared_null : makeSharedNull(); + d->ref(); + } }