diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-08 12:55:54 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-06-08 14:23:30 (GMT) |
commit | 168f75927390d4ab726870946d60604abf994654 (patch) | |
tree | 9c0ff68b880dc00d9695b5addb9991afda787020 /src | |
parent | c7296d97ae0dc92b2383dfd47e1f85aa570d5d0c (diff) | |
download | Qt-168f75927390d4ab726870946d60604abf994654.zip Qt-168f75927390d4ab726870946d60604abf994654.tar.gz Qt-168f75927390d4ab726870946d60604abf994654.tar.bz2 |
Small simplification on code
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qnoncontiguousbytedevice_p.h | 5 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 4 | ||||
-rw-r--r-- | src/corelib/plugin/qplugin.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qthread.cpp | 6 | ||||
-rw-r--r-- | src/corelib/thread/qthread_p.h | 54 | ||||
-rw-r--r-- | src/gui/itemviews/qtablewidget.cpp | 10 |
6 files changed, 35 insertions, 46 deletions
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h index acfc6eb..562b759 100644 --- a/src/corelib/io/qnoncontiguousbytedevice_p.h +++ b/src/corelib/io/qnoncontiguousbytedevice_p.h @@ -96,7 +96,6 @@ public: class QNonContiguousByteDeviceByteArrayImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba); ~QNonContiguousByteDeviceByteArrayImpl(); @@ -112,7 +111,6 @@ protected: class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceRingBufferImpl(QRingBuffer *rb); ~QNonContiguousByteDeviceRingBufferImpl(); @@ -129,7 +127,6 @@ protected: class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d); ~QNonContiguousByteDeviceIoDeviceImpl(); @@ -151,7 +148,6 @@ protected: class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice { - Q_OBJECT public: QNonContiguousByteDeviceBufferImpl(QBuffer *b); ~QNonContiguousByteDeviceBufferImpl(); @@ -169,7 +165,6 @@ protected: // ... and the reverse thing class QByteDeviceWrappingIoDevice : public QIODevice { - Q_OBJECT public: QByteDeviceWrappingIoDevice (QNonContiguousByteDevice *bd); ~QByteDeviceWrappingIoDevice (); diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 1501351..5e33a71 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2228,11 +2228,11 @@ static void err_method_notfound(const QObject *object, if (strchr(method,')') == 0) // common typing mistake qWarning("Object::%s: Parentheses expected, %s %s::%s%s%s", func, type, object->metaObject()->className(), method+1, - loc ? " in ":"\0", loc ? loc : "\0"); + loc ? " in ": "", loc ? loc : ""); else qWarning("Object::%s: No such %s %s::%s%s%s", func, type, object->metaObject()->className(), method+1, - loc ? " in ":"\0", loc ? loc : "\0"); + loc ? " in ": "", loc ? loc : ""); } diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 121a875..e3b9d32 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -131,7 +131,7 @@ struct qt_plugin_instance_deleter "pattern=""QT_PLUGIN_VERIFICATION_DATA""\n" \ "version="QT_VERSION_STR"\n" \ "debug="QPLUGIN_DEBUG_STR"\n" \ - "buildkey="QT_BUILD_KEY"\0"; + "buildkey="QT_BUILD_KEY; # if defined (Q_OS_WIN32) && defined(Q_CC_BOR) # define Q_STANDARD_CALL __stdcall diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 2fb6335..8fba574 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -113,12 +113,6 @@ QThreadData::~QThreadData() // fprintf(stderr, "QThreadData %p destroyed\n", this); } -QThreadData *QThreadData::get2(QThread *thread) -{ - Q_ASSERT_X(thread != 0, "QThread", "internal error"); - return thread->d_func()->data; -} - void QThreadData::ref() { #ifndef QT_NO_THREAD diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 75293ce..eb290db 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -107,32 +107,6 @@ public: { } }; -class Q_CORE_EXPORT QThreadData -{ - QAtomicInt _ref; - -public: - QThreadData(int initialRefCount = 1); - ~QThreadData(); - - static QThreadData *current(); - static QThreadData *get2(QThread *thread); - - void ref(); - void deref(); - - QThread *thread; - bool quitNow; - int loopLevel; - QAbstractEventDispatcher *eventDispatcher; - QStack<QEventLoop *> eventLoops; - QPostEventList postEventList; - bool canWait; - QMap<int, void *> tls; - - QMutex mutex; -}; - #ifndef QT_NO_THREAD class QThreadPrivate : public QObjectPrivate { @@ -210,6 +184,34 @@ public: #endif // QT_NO_THREAD +class QThreadData +{ + QAtomicInt _ref; + +public: + QThreadData(int initialRefCount = 1); + ~QThreadData(); + + static QThreadData *current(); + static QThreadData *get2(QThread *thread) + { Q_ASSERT_X(thread != 0, "QThread", "internal error"); return thread->d_func()->data; } + + + void ref(); + void deref(); + + QThread *thread; + bool quitNow; + int loopLevel; + QAbstractEventDispatcher *eventDispatcher; + QStack<QEventLoop *> eventLoops; + QPostEventList postEventList; + bool canWait; + QMap<int, void *> tls; + + QMutex mutex; +}; + QT_END_NAMESPACE #endif // QTHREAD_P_H diff --git a/src/gui/itemviews/qtablewidget.cpp b/src/gui/itemviews/qtablewidget.cpp index e88301e..8cb2e55 100644 --- a/src/gui/itemviews/qtablewidget.cpp +++ b/src/gui/itemviews/qtablewidget.cpp @@ -1662,10 +1662,9 @@ void QTableWidgetPrivate::_q_emitCurrentItemChanged(const QModelIndex ¤t, void QTableWidgetPrivate::_q_sort() { - Q_Q(QTableWidget); if (sortingEnabled) { - int column = q->horizontalHeader()->sortIndicatorSection(); - Qt::SortOrder order = q->horizontalHeader()->sortIndicatorOrder(); + int column = horizontalHeader->sortIndicatorSection(); + Qt::SortOrder order = horizontalHeader->sortIndicatorOrder(); model()->sort(column, order); } } @@ -1673,11 +1672,10 @@ void QTableWidgetPrivate::_q_sort() void QTableWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { - Q_Q(QTableWidget); if (sortingEnabled && topLeft.isValid() && bottomRight.isValid()) { - int column = q->horizontalHeader()->sortIndicatorSection(); + int column = horizontalHeader->sortIndicatorSection(); if (column >= topLeft.column() && column <= bottomRight.column()) { - Qt::SortOrder order = q->horizontalHeader()->sortIndicatorOrder(); + Qt::SortOrder order = horizontalHeader->sortIndicatorOrder(); model()->ensureSorted(column, order, topLeft.row(), bottomRight.row()); } } |