Changeset 769 for trunk/src/corelib/tools
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
-
. (modified) (1 prop)
-
src/corelib/tools/qbytedata_p.h (modified) (1 diff)
-
src/corelib/tools/qchar.cpp (modified) (1 diff)
-
src/corelib/tools/qcontiguouscache.h (modified) (2 diffs)
-
src/corelib/tools/qhash.cpp (modified) (2 diffs)
-
src/corelib/tools/qhash.h (modified) (5 diffs)
-
src/corelib/tools/qlinkedlist.h (modified) (3 diffs)
-
src/corelib/tools/qlist.cpp (modified) (1 diff)
-
src/corelib/tools/qlist.h (modified) (3 diffs)
-
src/corelib/tools/qlocale.cpp (modified) (1 diff)
-
src/corelib/tools/qlocale_symbian.cpp (modified) (1 diff)
-
src/corelib/tools/qmap.h (modified) (5 diffs)
-
src/corelib/tools/qpoint.cpp (modified) (1 diff)
-
src/corelib/tools/qregexp.cpp (modified) (2 diffs)
-
src/corelib/tools/qscopedpointer.cpp (modified) (2 diffs)
-
src/corelib/tools/qset.h (modified) (3 diffs)
-
src/corelib/tools/qsharedpointer_impl.h (modified) (2 diffs)
-
src/corelib/tools/qstring.cpp (modified) (6 diffs)
-
src/corelib/tools/qstringbuilder.h (modified) (1 diff)
-
src/corelib/tools/qstringlist.cpp (modified) (1 diff)
-
src/corelib/tools/qvarlengtharray.h (modified) (5 diffs)
-
src/corelib/tools/qvector.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/corelib/tools/qbytedata_p.h
r651 r769 85 85 86 86 87 inline void append( QByteArray& bd)87 inline void append(QByteArray& bd) 88 88 { 89 89 if (bd.isEmpty()) -
trunk/src/corelib/tools/qchar.cpp
r651 r769 382 382 \value Null A QChar with this value isNull(). 383 383 \value Nbsp Non-breaking space. 384 \value ReplacementCharacter 385 \value ObjectReplacementCharacter The character shown when a font has no glyph for a certain codepoint. The square character is normally used. 384 \value ReplacementCharacter The character shown when a font has no glyph 385 for a certain codepoint. A special question mark character is often 386 used. Codecs use this codepoint when input data cannot be 387 represented in Unicode. 388 \value ObjectReplacementCharacter Used to represent an object such as an 389 image when such objects cannot be presented. 386 390 \value ByteOrderMark 387 391 \value ByteOrderSwapped -
trunk/src/corelib/tools/qcontiguouscache.h
r651 r769 98 98 typedef value_type& reference; 99 99 typedef const value_type& const_reference; 100 typedef ptrdiff_tdifference_type;100 typedef difference_type; 101 101 typedef int size_type; 102 102 … … 222 222 x.d->count = qMin(d->count, asize); 223 223 x.d->offset = d->offset + d->count - x.d->count; 224 x.d->start = x.d->offset % x.d->alloc; 225 T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc; 226 T *src = p->array + (d->start + d->count-1) % d->alloc; 224 if(asize) 225 x.d->start = x.d->offset % x.d->alloc; 226 else 227 x.d->start = 0; 228 227 229 int oldcount = x.d->count; 228 while (oldcount--) { 229 if (QTypeInfo<T>::isComplex) { 230 new (dest) T(*src); 231 } else { 232 *dest = *src; 230 if(oldcount) 231 { 232 T *dest = x.p->array + (x.d->start + x.d->count-1) % x.d->alloc; 233 T *src = p->array + (d->start + d->count-1) % d->alloc; 234 while (oldcount--) { 235 if (QTypeInfo<T>::isComplex) { 236 new (dest) T(*src); 237 } else { 238 *dest = *src; 239 } 240 if (dest == x.p->array) 241 dest = x.p->array + x.d->alloc; 242 dest--; 243 if (src == p->array) 244 src = p->array + d->alloc; 245 src--; 233 246 } 234 if (dest == x.p->array)235 dest = x.p->array + x.d->alloc;236 dest--;237 if (src == p->array)238 src = p->array + d->alloc;239 src--;240 247 } 241 248 /* free old */ -
trunk/src/corelib/tools/qhash.cpp
r651 r769 69 69 while (n--) { 70 70 h = (h << 4) + *p++; 71 if ((g = (h & 0xf0000000)) != 0)72 h ^= g >> 23;71 72 h ^= g >> 23; 73 73 h &= ~g; 74 74 } … … 83 83 while (n--) { 84 84 h = (h << 4) + (*p++).unicode(); 85 if ((g = (h & 0xf0000000)) != 0)86 h ^= g >> 23;85 86 h ^= g >> 23; 87 87 h &= ~g; 88 88 } -
trunk/src/corelib/tools/qhash.h
r651 r769 330 330 public: 331 331 typedef std::bidirectional_iterator_tag iterator_category; 332 typedef ptrdiff_tdifference_type;332 typedef difference_type; 333 333 typedef T value_type; 334 334 typedef T *pointer; … … 395 395 public: 396 396 typedef std::bidirectional_iterator_tag iterator_category; 397 typedef ptrdiff_tdifference_type;397 typedef difference_type; 398 398 typedef T value_type; 399 399 typedef const T *pointer; … … 479 479 typedef T mapped_type; 480 480 typedef Key key_type; 481 typedef ptrdiff_tdifference_type;481 typedef difference_type; 482 482 typedef int size_type; 483 483 … … 928 928 929 929 inline QMultiHash &operator+=(const QMultiHash &other) 930 { unite(other); return *this; }930 { unite(other); return *this; } 931 931 inline QMultiHash operator+(const QMultiHash &other) const 932 932 { QMultiHash result = *this; result += other; return result; } … … 1003 1003 while (i != end && i.key() == key) { 1004 1004 if (i.value() == value) { 1005 #if defined(Q_CC_RVCT) 1006 // RVCT has problems with scoping, apparently. 1007 i = QHash<Key, T>::erase(i); 1008 #else 1009 i = erase(i); 1010 #endif 1005 i = this->erase(i); 1011 1006 ++n; 1012 1007 } else { -
trunk/src/corelib/tools/qlinkedlist.h
r651 r769 114 114 public: 115 115 typedef std::bidirectional_iterator_tag iterator_category; 116 typedef ptrdiff_tdifference_type;116 typedef difference_type; 117 117 typedef T value_type; 118 118 typedef T *pointer; … … 147 147 public: 148 148 typedef std::bidirectional_iterator_tag iterator_category; 149 typedef ptrdiff_tdifference_type;149 typedef difference_type; 150 150 typedef T value_type; 151 151 typedef const T *pointer; … … 213 213 typedef value_type &reference; 214 214 typedef const value_type &const_reference; 215 typedef ptrdiff_tdifference_type;215 typedef difference_type; 216 216 217 217 #ifndef QT_NO_STL -
trunk/src/corelib/tools/qlist.cpp
r651 r769 209 209 if (n) { 210 210 if (e + n > d->alloc) 211 realloc(grow(e + l.d->end - l.d->begin));211 realloc(grow(e + n)); 212 212 d->end += n; 213 213 } -
trunk/src/corelib/tools/qlist.h
r651 r769 164 164 Node *i; 165 165 typedef std::random_access_iterator_tag iterator_category; 166 typedef ptrdiff_tdifference_type;166 typedef difference_type; 167 167 typedef T value_type; 168 168 typedef T *pointer; … … 211 211 Node *i; 212 212 typedef std::random_access_iterator_tag iterator_category; 213 typedef ptrdiff_tdifference_type;213 typedef difference_type; 214 214 typedef T value_type; 215 215 typedef const T *pointer; … … 290 290 typedef value_type &reference; 291 291 typedef const value_type &const_reference; 292 typedef ptrdiff_tdifference_type;292 typedef difference_type; 293 293 294 294 #ifdef QT3_SUPPORT -
trunk/src/corelib/tools/qlocale.cpp
r717 r769 774 774 }; 775 775 776 776 777 static const WindowsToISOListElt windows_to_iso_list[] = { 777 778 { 0x0401, "ar_SA" }, -
trunk/src/corelib/tools/qlocale_symbian.cpp
r651 r769 88 88 89 89 /* 90 Mapping from Symbian to ISO locale 90 Mapping from Symbian to ISO locale. 91 NOTE: This array should be sorted by the first column! 91 92 */ 92 93 static const symbianToISO symbian_to_iso_list[] = { 93 { ELangEnglish, "en_GB" }, 94 { ELangFrench, "fr_FR" }, 95 { ELangGerman, "de_DE" }, 96 { ELangSpanish, "es_ES" }, 97 { ELangItalian, "it_IT" }, 98 { ELangSwedish, "sv_SE" }, 99 { ELangDanish, "da_DK" }, 100 { ELangNorwegian, "no_NO" }, 101 { ELangFinnish, "fi_FI" }, 102 { ELangAmerican, "en_US" }, 103 { ELangPortuguese, "pt_PT" }, 104 { ELangTurkish, "tr_TR" }, 105 { ELangIcelandic, "is_IS" }, 106 { ELangRussian, "ru_RU" }, 107 { ELangHungarian, "hu_HU" }, 108 { ELangDutch, "nl_NL" }, 109 { ELangBelgianFlemish, "nl_BE" }, 110 { ELangCzech, "cs_CZ" }, 111 { ELangSlovak, "sk_SK" }, 112 { ELangPolish, "pl_PL" }, 113 { ELangSlovenian, "sl_SI" }, 114 { ELangTaiwanChinese, "zh_TW" }, 115 { ELangHongKongChinese, "zh_HK" }, 116 { ELangPrcChinese, "zh_CN" }, 117 { ELangJapanese, "ja_JP" }, 118 { ELangThai, "th_TH" }, 119 { ELangArabic, "ar_AE" }, 120 { ELangTagalog, "tl_PH" }, 121 { ELangBulgarian, "bg_BG" }, 122 { ELangCatalan, "ca_ES" }, 123 { ELangCroatian, "hr_HR" }, 124 { ELangEstonian, "et_EE" }, 125 { ELangFarsi, "fa_IR" }, 126 { ELangCanadianFrench, "fr_CA" }, 127 { ELangGreek, "el_GR" }, 128 { ELangHebrew, "he_IL" }, 129 { ELangHindi, "hi_IN" }, 130 { ELangIndonesian, "id_ID" }, 131 { ELangLatvian, "lv_LV" }, 132 { ELangLithuanian, "lt_LT" }, 133 { ELangMalay, "ms_MY" }, 134 { ELangBrazilianPortuguese, "pt_BR" }, 135 { ELangRomanian, "ro_RO" }, 136 { ELangSerbian, "sr_YU" }, 137 { ELangLatinAmericanSpanish, "es" }, 138 { ELangUkrainian, "uk_UA" }, 139 { ELangUrdu, "ur_PK" }, // India/Pakistan 140 { ELangVietnamese, "vi_VN" }, 94 { ELangEnglish, "en_GB" }, // 1 95 { ELangFrench, "fr_FR" }, // 2 96 { ELangGerman, "de_DE" }, // 3 97 { ELangSpanish, "es_ES" }, // 4 98 { ELangItalian, "it_IT" }, // 5 99 { ELangSwedish, "sv_SE" }, // 6 100 { ELangDanish, "da_DK" }, // 7 101 { ELangNorwegian, "no_NO" }, // 8 102 { ELangFinnish, "fi_FI" }, // 9 103 { ELangAmerican, "en_US" }, // 10 104 { ELangPortuguese, "pt_PT" }, // 13 105 { ELangTurkish, "tr_TR" }, // 14 106 { ELangIcelandic, "is_IS" }, // 15 107 { ELangRussian, "ru_RU" }, // 16 108 { ELangHungarian, "hu_HU" }, // 17 109 { ELangDutch, "nl_NL" }, // 18 110 { ELangBelgianFlemish, "nl_BE" }, // 19 111 { ELangCzech, "cs_CZ" }, // 25 112 { ELangSlovak, "sk_SK" }, // 26 113 { ELangPolish, "pl_PL" }, // 27 114 { ELangSlovenian, "sl_SI" }, // 28 115 { ELangTaiwanChinese, "zh_TW" }, // 29 116 { ELangHongKongChinese, "zh_HK" }, // 30 117 { ELangPrcChinese, "zh_CN" }, // 31 118 { ELangJapanese, "ja_JP" }, // 32 119 { ELangThai, "th_TH" }, // 33 120 { ELangArabic, "ar_AE" }, // 37 121 { ELangTagalog, "tl_PH" }, // 39 122 { ELangBulgarian, "bg_BG" }, // 42 123 { ELangCatalan, "ca_ES" }, // 44 124 { ELangCroatian, "hr_HR" }, // 45 125 { ELangEstonian, "et_EE" }, // 49 126 { ELangFarsi, "fa_IR" }, // 50 127 { ELangCanadianFrench, "fr_CA" }, // 51 128 { ELangGreek, "el_GR" }, // 54 129 { ELangHebrew, "he_IL" }, // 57 130 { ELangHindi, "hi_IN" }, // 58 131 { ELangIndonesian, "id_ID" }, // 59 132 { ELangKorean, "ko_KO" }, // 65 133 { ELangLatvian, "lv_LV" }, // 67 134 { ELangLithuanian, "lt_LT" }, // 68 135 { ELangMalay, "ms_MY" }, // 70 136 { ELangNorwegianNynorsk, "nn_NO" }, // 75 137 { ELangBrazilianPortuguese, "pt_BR" }, // 76 138 { ELangRomanian, "ro_RO" }, // 78 139 { ELangSerbian, "sr_RS" }, // 79 140 { ELangLatinAmericanSpanish,"es_419" }, // 83 141 { ELangUkrainian, "uk_UA" }, // 93 142 { ELangUrdu, "ur_PK" }, // 94 - India/Pakistan 143 { ELangVietnamese, "vi_VN" }, // 96 141 144 #ifdef __E32LANG_H__ 142 145 // 5.0 143 { ELangBasque, "eu_ES" }, 144 { ELangGalician, "gl_ES" }, 146 { ELangBasque, "eu_ES" }, 147 { ELangGalician, "gl_ES" }, 145 148 #endif 146 149 #if !defined(__SERIES60_31__) 147 { ELangEnglish_Apac, "en" }, 148 { ELangEnglish_Taiwan, "en_TW" }, 149 { ELangEnglish_HongKong, "en_HK" }, 150 { ELangEnglish_Prc, "en_CN" }, 151 { ELangEnglish_Japan, "en_JP"}, 152 { ELangEnglish_Thailand, "en_TH" }, 153 { ELangMalay_Apac, "ms" } 150 { ELangEnglish_Apac, "en" }, 151 { ELangEnglish_Taiwan, "en_TW" }, 152 { ELangEnglish_HongKong, "en_HK" }, 153 { ELangEnglish_Prc, "en_CN" }, 154 { ELangEnglish_Japan, "en_JP"}, 155 { ELangEnglish_Thailand, "en_TH" }, 156 { ELangMalay_Apac, "ms" } 154 157 #endif 158 155 159 }; 156 160 -
trunk/src/corelib/tools/qmap.h
r651 r769 214 214 public: 215 215 typedef std::bidirectional_iterator_tag iterator_category; 216 typedef ptrdiff_tdifference_type;216 typedef difference_type; 217 217 typedef T value_type; 218 218 typedef T *pointer; … … 282 282 public: 283 283 typedef std::bidirectional_iterator_tag iterator_category; 284 typedef ptrdiff_tdifference_type;284 typedef difference_type; 285 285 typedef T value_type; 286 286 typedef const T *pointer; … … 385 385 typedef Key key_type; 386 386 typedef T mapped_type; 387 typedef ptrdiff_tdifference_type;387 typedef difference_type; 388 388 typedef int size_type; 389 389 inline bool empty() const { return isEmpty(); } … … 954 954 955 955 inline QMultiMap &operator+=(const QMultiMap &other) 956 { unite(other); return *this; }956 { unite(other); return *this; } 957 957 inline QMultiMap operator+(const QMultiMap &other) const 958 958 { QMultiMap result = *this; result += other; return result; } … … 1029 1029 while (i != end && !qMapLessThanKey<Key>(key, i.key())) { 1030 1030 if (i.value() == value) { 1031 #if defined(Q_CC_RVCT) 1032 // RVCT has problems with scoping, apparently. 1033 i = QMap<Key, T>::erase(i); 1034 #else 1035 i = erase(i); 1036 #endif 1031 i = this->erase(i); 1037 1032 ++n; 1038 1033 } else { -
trunk/src/corelib/tools/qpoint.cpp
r651 r769 375 375 { 376 376 d.nospace() << "QPointF(" << p.x() << ", " << p.y() << ')'; 377 return d ;377 return d; 378 378 } 379 379 #endif -
trunk/src/corelib/tools/qregexp.cpp
r651 r769 524 524 525 525 In the mode Wildcard, the wildcard characters cannot be 526 escaped. In the mode WildcardUnix, the character '\ ' escapes the526 escaped. In the mode WildcardUnix, the character '\' escapes the 527 527 wildcard. 528 528 … … 3775 3775 \value WildcardUnix This is similar to Wildcard but with the 3776 3776 behavior of a Unix shell. The wildcard characters can be escaped 3777 with the character "\ ".3777 with the character "\". 3778 3778 3779 3779 \value FixedString The pattern is a fixed string. This is -
trunk/src/corelib/tools/qscopedpointer.cpp
r651 r769 58 58 59 59 QScopedPointer guarantees that the object pointed to will get deleted when 60 the current scope dis sapears.60 the current scope dispears. 61 61 62 62 Consider this function which does heap allocations, and have various exit points: … … 226 226 */ 227 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 228 283 QT_END_NAMESPACE -
trunk/src/corelib/tools/qset.h
r651 r769 98 98 public: 99 99 typedef std::bidirectional_iterator_tag iterator_category; 100 typedef ptrdiff_tdifference_type;100 typedef difference_type; 101 101 typedef T value_type; 102 102 typedef const T *pointer; … … 133 133 public: 134 134 typedef std::bidirectional_iterator_tag iterator_category; 135 typedef ptrdiff_tdifference_type;135 typedef difference_type; 136 136 typedef T value_type; 137 137 typedef const T *pointer; … … 189 189 typedef value_type &reference; 190 190 typedef const value_type &const_reference; 191 typedef ptrdiff_tdifference_type;191 typedef difference_type; 192 192 typedef int size_type; 193 193 194 194 inline bool empty() const { return isEmpty(); } 195 196 195 // comfort 197 196 inline QSet<T> &operator<<(const T &value) { insert(value); return *this; } -
trunk/src/corelib/tools/qsharedpointer_impl.h
r651 r769 133 133 typedef value_type &reference; 134 134 typedef const value_type &const_reference; 135 typedef ptrdiff_tdifference_type;135 typedef difference_type; 136 136 137 137 inline T *data() const { return value; } … … 542 542 typedef value_type &reference; 543 543 typedef const value_type &const_reference; 544 typedef ptrdiff_tdifference_type;544 typedef difference_type; 545 545 546 546 inline bool isNull() const { return d == 0 || d->strongref == 0 || value == 0; } -
trunk/src/corelib/tools/qstring.cpp
r659 r769 891 891 { 892 892 if (sizeof(wchar_t) == sizeof(QChar)) { 893 return fromUtf16(( ushort *)string, size);893 return fromUtf16((ushort *)string, size); 894 894 } else { 895 895 return fromUcs4((uint *)string, size); … … 3191 3191 x++; 3192 3192 } 3193 if((flags & SectionIncludeLeadingSep) ) {3193 if((flags & SectionIncludeLeadingSep)) { 3194 3194 const qt_section_chunk §ion = sections.at(first_i); 3195 3195 ret.prepend(section.string.left(section.length)); … … 3863 3863 with a 0. 3864 3864 3865 3866 3867 3868 3869 3870 3865 3871 QString makes a deep copy of the Unicode data. 3866 3872 … … 3928 3934 If \a unicode is 0, nothing is copied, but the string is still 3929 3935 resized to \a size. 3936 3937 3938 3930 3939 3931 3940 \sa utf16(), setUnicode() … … 4705 4714 Returns the QString as a '\\0\'-terminated array of unsigned 4706 4715 shorts. The result remains valid until the string is modified. 4716 4717 4707 4718 4708 4719 \sa unicode() … … 7777 7788 if (m_size && m_position == 0 && m_size == m_string->size()) 7778 7789 return *m_string; 7779 return QString ::fromUtf16(reinterpret_cast<const ushort*>(m_string->unicode() + m_position), m_size);7790 return QString, m_size); 7780 7791 } 7781 7792 -
trunk/src/corelib/tools/qstringbuilder.h
r651 r769 72 72 private: 73 73 const int m_size; 74 const char * m_data;74 const char *m_data; 75 75 }; 76 76 -
trunk/src/corelib/tools/qstringlist.cpp
r651 r769 405 405 QString QtPrivate::QStringList_join(const QStringList *that, const QString &sep) 406 406 { 407 int totalLength = 0;408 const int size = that->size();409 410 for (int i = 0; i < size; ++i)411 totalLength += that->at(i).size();412 413 if(size > 0)414 totalLength += sep.size() * (size - 1);415 416 407 QString res; 417 res.reserve(totalLength);418 408 for (int i = 0; i < that->size(); ++i) { 419 409 if (i) -
trunk/src/corelib/tools/qvarlengtharray.h
r651 r769 129 129 void realloc(int size, int alloc); 130 130 131 int a; 132 int s; 133 T *ptr; 131 int a; 132 int s; 133 T *ptr; 134 134 union { 135 135 // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size … … 194 194 T *oldPtr = ptr; 195 195 int osize = s; 196 // s = asize; 197 196 197 const int copySize = qMin(asize, osize); 198 198 if (aalloc != a) { 199 199 ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T))); … … 206 206 QT_TRY { 207 207 // copy all the old elements 208 const int copySize = qMin(asize, osize);209 208 while (s < copySize) { 210 209 new (ptr+s) T(*(oldPtr+s)); … … 222 221 } 223 222 } else { 224 qMemCopy(ptr, oldPtr, qMin(asize, osize) * sizeof(T)); 225 s = asize; 223 qMemCopy(ptr, oldPtr, copySize * sizeof(T)); 226 224 } 227 225 } else { … … 230 228 } 231 229 } 232 233 if (QTypeInfo<T>::isComplex) { 230 s = copySize; 231 232 if (QTypeInfo<T>::isComplex) { 233 // destroy remaining old objects 234 234 while (osize > asize) 235 235 (oldPtr+(--osize))->~T(); 236 if( oldPtr == ptr )237 s = osize;238 236 } 239 237 -
trunk/src/corelib/tools/qvector.h
r651 r769 164 164 T *i; 165 165 typedef std::random_access_iterator_tag iterator_category; 166 typedef ptrdiff_tdifference_type;166 typedef difference_type; 167 167 typedef T value_type; 168 168 typedef T *pointer; … … 197 197 T *i; 198 198 typedef std::random_access_iterator_tag iterator_category; 199 typedef ptrdiff_tdifference_type;199 typedef difference_type; 200 200 typedef T value_type; 201 201 typedef const T *pointer; … … 261 261 typedef value_type& reference; 262 262 typedef const value_type& const_reference; 263 typedef ptrdiff_tdifference_type;263 typedef difference_type; 264 264 typedef iterator Iterator; 265 265 typedef const_iterator ConstIterator;
Note:
See TracChangeset
for help on using the changeset viewer.
