summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.h
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-08-24 08:26:04 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-08-24 08:31:31 (GMT)
commit94c444e71e6a36cfbd3782416200ff20bdd1cea9 (patch)
treed32f09f8685ec567759bec7382867bac69ab9e68 /src/corelib/tools/qlist.h
parenta7d8ba4fb8ed918205815e6d8cd52c5c04365cbe (diff)
downloadQt-94c444e71e6a36cfbd3782416200ff20bdd1cea9.zip
Qt-94c444e71e6a36cfbd3782416200ff20bdd1cea9.tar.gz
Qt-94c444e71e6a36cfbd3782416200ff20bdd1cea9.tar.bz2
Restore QList backward compatibility
Add detach3 and append2, leaving the old functions as they were. This ensures that new code will use the optimized version of QList, and old code will just continue calling the old functions. Reviewed-by: Thiago
Diffstat (limited to 'src/corelib/tools/qlist.h')
-rw-r--r--src/corelib/tools/qlist.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index ab6f7bd..331f448 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -72,13 +72,15 @@ struct Q_CORE_EXPORT QListData {
enum { DataHeaderSize = sizeof(Data) - sizeof(void *) };
Data *detach(); // remove in 5.0
- Data *detach2();
+ Data *detach2(); // remove in 5.0
+ Data *detach3();
void realloc(int alloc);
static Data shared_null;
Data *d;
void **erase(void **xi);
void **append();
void **append(const QListData &l);
+ void **append2(const QListData &l); // remove in 5.0
void **prepend();
void **insert(int i);
void remove(int i);
@@ -593,7 +595,7 @@ template <typename T>
Q_OUTOFLINE_TEMPLATE void QList<T>::detach_helper()
{
Node *n = reinterpret_cast<Node *>(p.begin());
- QListData::Data *x = p.detach2();
+ QListData::Data *x = p.detach3();
QT_TRY {
node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
} QT_CATCH(...) {
@@ -693,7 +695,7 @@ template <typename T>
Q_OUTOFLINE_TEMPLATE QList<T> &QList<T>::operator+=(const QList<T> &l)
{
detach();
- Node *n = reinterpret_cast<Node *>(p.append(l.p));
+ Node *n = reinterpret_cast<Node *>(p.append2(l.p));
QT_TRY{
node_copy(n, reinterpret_cast<Node *>(p.end()), reinterpret_cast<Node *>(l.p.begin()));
} QT_CATCH(...) {