diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-19 13:49:33 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-19 13:49:33 (GMT) |
commit | 42567d2e4d85e001f77767cabea8acb06daeb94d (patch) | |
tree | 96c6e3241f322535834633b883808e3e44196495 | |
parent | b91d336573c9bfb2e7c93286a8e0b36e742bd775 (diff) | |
parent | 0f01ad8c73e352a8368296820f4dd77f9da06114 (diff) | |
download | Qt-42567d2e4d85e001f77767cabea8acb06daeb94d.zip Qt-42567d2e4d85e001f77767cabea8acb06daeb94d.tar.gz Qt-42567d2e4d85e001f77767cabea8acb06daeb94d.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-master-from-4.6
Conflicts:
tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
23 files changed, 205 insertions, 136 deletions
diff --git a/src/corelib/arch/qatomic_s390.h b/src/corelib/arch/qatomic_s390.h index 21f5037..273c17b 100644 --- a/src/corelib/arch/qatomic_s390.h +++ b/src/corelib/arch/qatomic_s390.h @@ -366,11 +366,9 @@ template <typename T> Q_INLINE_TEMPLATE T* QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue) { #ifndef __s390x__ - return (T*)__CS_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (int)newValue, "lr", - "", "bcr 15,0\n"); + return (T*)__CS_OLD_LOOP(&_q_value, (int)newValue, "lr", "", ""); #else - return (T*)__CSG_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (long)newValue, "lgr", - "", "bcr 15,0\n"); + return (T*)__CSG_OLD_LOOP(&_q_value, (long)newValue, "lgr", "", ""); #endif } @@ -378,9 +376,9 @@ template <typename T> Q_INLINE_TEMPLATE T* QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue) { #ifndef __s390x__ - return (T*)__CS_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (int)newValue, "lr", "", ""); + return (T*)__CS_OLD_LOOP(&_q_value, (int)newValue, "lr", "", "bcr 15,0 \n"); #else - return (T*)__CSG_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (long)newValue, "lgr", "", ""); + return (T*)__CSG_OLD_LOOP(&_q_value, (long)newValue, "lgr", "", "bcr 15,0 \n"); #endif } @@ -388,11 +386,9 @@ template <typename T> Q_INLINE_TEMPLATE T* QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue) { #ifndef __s390x__ - return (T*)__CS_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (int)newValue, "lr", - "bcr 15,0 \n", ""); + return (T*)__CS_OLD_LOOP(&_q_value, (int)newValue, "lr", "bcr 15,0 \n", ""); #else - return (T*)__CSG_OLD_LOOP(reinterpret_cast<volatile long*>(_q_value), (long)newValue, "lgr", - "bcr 15,0\n", ""); + return (T*)__CSG_OLD_LOOP(&_q_value, (long)newValue, "lgr", "bcr 15,0\n", ""); #endif } diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index c98c5e9..261c369 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -112,7 +112,7 @@ class QList public: inline QList() : d(&QListData::shared_null) { d->ref.ref(); } inline QList(const QList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach_helper(); } - ~QList(); // ### Qt5: make this destructor virtual + ~QList(); QList<T> &operator=(const QList<T> &l); bool operator==(const QList<T> &l) const; inline bool operator!=(const QList<T> &l) const { return !(*this == l); } diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index d0fa22d..706d2a8 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -2474,10 +2474,11 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end) QVector<QTreeViewItem> insertedItems(delta); for (int i = 0; i < delta; ++i) { - insertedItems[i].index = d->model->index(i + start, 0, parent); - insertedItems[i].level = childLevel; - insertedItems[i].hasChildren = d->hasVisibleChildren(insertedItems[i].index); - insertedItems[i].hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1)); + QTreeViewItem &item = insertedItems[i]; + item.index = d->model->index(i + start, 0, parent); + item.level = childLevel; + item.hasChildren = d->hasVisibleChildren(item.index); + item.hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1)); } if (d->viewItems.isEmpty()) d->defaultItemHeight = indexRowSizeHint(insertedItems[0].index); diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 7412b06..c9a94ee 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -210,13 +210,11 @@ bool QSoftKeyManager::handleUpdateSoftKeys() d->requestedSoftKeyActions.clear(); bool recursiveMerging = false; QWidget *source = softkeySource(NULL, recursiveMerging); - do { - if (source) { - bool added = appendSoftkeys(*source, level); - source = softkeySource(source, recursiveMerging); - level = added ? ++level : level; - } - } while (source); + while (source) { + if (appendSoftkeys(*source, level)) + ++level; + source = softkeySource(source, recursiveMerging); + } d->updateSoftKeys_sys(); return true; diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index cc6a1c8..62aa2d7 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -404,6 +404,7 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor QHttpNetworkReply *reply = new QHttpNetworkReply(request.url()); reply->setRequest(request); reply->d_func()->connection = q; + reply->d_func()->connectionChannel = &channels[0]; // will have the correct one set later HttpMessagePair pair = qMakePair(request, reply); switch (request.priority()) { @@ -688,14 +689,12 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() if (channels[i].resendCurrent) { channels[i].resendCurrent = false; channels[i].state = QHttpNetworkConnectionChannel::IdleState; - if (channels[i].reply) { - // if this is not possible, error will be emitted and connection terminated - if (!channels[i].resetUploadData()) - continue; + // if this is not possible, error will be emitted and connection terminated + if (!channels[i].resetUploadData()) + continue; - channels[i].sendRequest(); - } + channels[i].sendRequest(); } } @@ -861,17 +860,6 @@ QNetworkProxy QHttpNetworkConnection::transparentProxy() const // SSL support below #ifndef QT_NO_OPENSSL -QSslConfiguration QHttpNetworkConnectionPrivate::sslConfiguration(const QHttpNetworkReply &reply) const -{ - if (!encrypt) - return QSslConfiguration(); - - for (int i = 0; i < channelCount; ++i) - if (channels[i].reply == &reply) - return static_cast<QSslSocket *>(channels[0].socket)->sslConfiguration(); - return QSslConfiguration(); // pending or done request -} - void QHttpNetworkConnection::setSslConfiguration(const QSslConfiguration &config) { Q_D(QHttpNetworkConnection); diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index 03cf09c..823774e 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -210,11 +210,6 @@ public: void emitReplyError(QAbstractSocket *socket, QHttpNetworkReply *reply, QNetworkReply::NetworkError errorCode); bool handleAuthenticateChallenge(QAbstractSocket *socket, QHttpNetworkReply *reply, bool isProxy, bool &resend); - -#ifndef QT_NO_OPENSSL - QSslConfiguration sslConfiguration(const QHttpNetworkReply &reply) const; -#endif - #ifndef QT_NO_NETWORKPROXY QNetworkProxy networkProxy; void emitProxyAuthenticationRequired(const QHttpNetworkConnectionChannel *chan, const QNetworkProxy &proxy, QAuthenticator* auth); diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 2a3036b..dbee72a 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -124,6 +124,13 @@ void QHttpNetworkConnectionChannel::close() bool QHttpNetworkConnectionChannel::sendRequest() { + if (!reply) { + // heh, how should that happen! + qWarning() << "QHttpNetworkConnectionChannel::sendRequest() called without QHttpNetworkReply"; + state = QHttpNetworkConnectionChannel::IdleState; + return false; + } + switch (state) { case QHttpNetworkConnectionChannel::IdleState: { // write the header if (!ensureConnection()) { @@ -134,13 +141,13 @@ bool QHttpNetworkConnectionChannel::sendRequest() } written = 0; // excluding the header bytesTotal = 0; - if (reply) { - reply->d_func()->clear(); - reply->d_func()->connection = connection; - reply->d_func()->autoDecompress = request.d->autoDecompress; - reply->d_func()->pipeliningUsed = false; - } - state = QHttpNetworkConnectionChannel::WritingState; + + reply->d_func()->clear(); + reply->d_func()->connection = connection; + reply->d_func()->connectionChannel = this; + reply->d_func()->autoDecompress = request.d->autoDecompress; + reply->d_func()->pipeliningUsed = false; + pendingEncrypt = false; // if the url contains authentication parameters, use the new ones // both channels will use the new authentication parameters @@ -174,13 +181,15 @@ bool QHttpNetworkConnectionChannel::sendRequest() QObject::connect(uploadByteDevice, SIGNAL(readyRead()),this, SLOT(_q_uploadDataReadyRead())); bytesTotal = request.contentLength(); + + state = QHttpNetworkConnectionChannel::WritingState; // start writing data + sendRequest(); //recurse } else { - state = QHttpNetworkConnectionChannel::WaitingState; - sendRequest(); - break; + state = QHttpNetworkConnectionChannel::WaitingState; // now wait for response + sendRequest(); //recurse } - // write the initial chunk together with the headers - // fall through + + break; } case QHttpNetworkConnectionChannel::WritingState: { @@ -190,7 +199,7 @@ bool QHttpNetworkConnectionChannel::sendRequest() if (uploadByteDevice) emit reply->dataSendProgress(written, bytesTotal); state = QHttpNetworkConnectionChannel::WaitingState; // now wait for response - sendRequest(); + sendRequest(); // recurse break; } @@ -278,16 +287,25 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() { Q_ASSERT(socket); + if (!reply) { + // heh, how should that happen! + qWarning() << "QHttpNetworkConnectionChannel::_q_receiveReply() called without QHttpNetworkReply," + << socket->bytesAvailable() << "bytes on socket."; + close(); + return; + } + qint64 bytes = 0; QAbstractSocket::SocketState socketState = socket->state(); // connection might be closed to signal the end of data if (socketState == QAbstractSocket::UnconnectedState) { if (socket->bytesAvailable() <= 0) { - if (reply && reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState) { + if (reply->d_func()->state == QHttpNetworkReplyPrivate::ReadingDataState) { // finish this reply. this case happens when the server did not send a content length reply->d_func()->state = QHttpNetworkReplyPrivate::AllDoneState; allDone(); + return; } else { handleUnexpectedEOF(); return; @@ -299,12 +317,13 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() // read loop for the response while (socket->bytesAvailable()) { - QHttpNetworkReplyPrivate::ReplyState state = reply ? reply->d_func()->state : QHttpNetworkReplyPrivate::AllDoneState; + QHttpNetworkReplyPrivate::ReplyState state = reply->d_func()->state; switch (state) { case QHttpNetworkReplyPrivate::NothingDoneState: { // only eat whitespace on the first call eatWhitespace(); state = reply->d_func()->state = QHttpNetworkReplyPrivate::ReadingStatusState; + // fallthrough } case QHttpNetworkReplyPrivate::ReadingStatusState: { qint64 statusBytes = reply->d_func()->readStatus(socket); @@ -412,8 +431,10 @@ void QHttpNetworkConnectionChannel::_q_receiveReply() #endif } } + // still in ReadingDataState? This function will be called again by the socket's readyRead if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState) break; + // everything done, fall through } case QHttpNetworkReplyPrivate::AllDoneState: @@ -568,7 +589,8 @@ void QHttpNetworkConnectionChannel::allDone() handleStatus(); // ### at this point there should be no more data on the socket // close if server requested - if (reply->d_func()->isConnectionCloseEnabled()) + bool connectionCloseEnabled = reply->d_func()->isConnectionCloseEnabled(); + if (connectionCloseEnabled) close(); // queue the finished signal, this is required since we might send new requests from // slot connected to it. The socket will not fire readyRead signal, if we are already @@ -579,14 +601,22 @@ void QHttpNetworkConnectionChannel::allDone() // in case of failures, each channel will attempt two reconnects before emitting error. reconnectAttempts = 2; + detectPipeliningSupport(); + // now the channel can be seen as free/idle again, all signal emissions for the reply have been done this->state = QHttpNetworkConnectionChannel::IdleState; - detectPipeliningSupport(); + // if it does not need to be sent again we can set it to 0 + // the previous code did not do that and we had problems with accidental re-sending of a + // finished request. + // Note that this may trigger a segfault at some other point. But then we can fix the underlying + // problem. + if (!resendCurrent) + reply = 0; // move next from pipeline to current request if (!alreadyPipelinedRequests.isEmpty()) { - if (resendCurrent || reply->d_func()->isConnectionCloseEnabled() || socket->state() != QAbstractSocket::ConnectedState) { + if (resendCurrent || connectionCloseEnabled || socket->state() != QAbstractSocket::ConnectedState) { // move the pipelined ones back to the main queue requeueCurrentlyPipelinedRequests(); close(); @@ -742,12 +772,11 @@ void QHttpNetworkConnectionChannel::pipelineInto(HttpMessagePair &pair) QHttpNetworkRequest &request = pair.first; QHttpNetworkReply *reply = pair.second; - if (reply) { - reply->d_func()->clear(); - reply->d_func()->connection = connection; - reply->d_func()->autoDecompress = request.d->autoDecompress; - reply->d_func()->pipeliningUsed = true; - } + reply->d_func()->clear(); + reply->d_func()->connection = connection; + reply->d_func()->connectionChannel = this; + reply->d_func()->autoDecompress = request.d->autoDecompress; + reply->d_func()->pipeliningUsed = true; #ifndef QT_NO_NETWORKPROXY QByteArray header = QHttpNetworkRequestPrivate::header(request, diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index 512c045..984f557 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -230,6 +230,7 @@ void QHttpNetworkReplyPrivate::clear() currentChunkRead = 0; connectionCloseEnabled = true; connection = 0; + connectionChannel = 0; #ifndef QT_NO_COMPRESS if (initInflate) inflateEnd(&inflateStrm); @@ -803,9 +804,15 @@ void QHttpNetworkReplyPrivate::eraseData() QSslConfiguration QHttpNetworkReply::sslConfiguration() const { Q_D(const QHttpNetworkReply); - if (d->connection) - return d->connection->d_func()->sslConfiguration(*this); - return QSslConfiguration(); + + if (!d->connectionChannel) + return QSslConfiguration(); + + QSslSocket *sslSocket = qobject_cast<QSslSocket*>(d->connectionChannel->socket); + if (!sslSocket) + return QSslConfiguration(); + + return sslSocket->sslConfiguration(); } void QHttpNetworkReply::setSslConfiguration(const QSslConfiguration &config) diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h index af9266b..fa240ec 100644 --- a/src/network/access/qhttpnetworkreply_p.h +++ b/src/network/access/qhttpnetworkreply_p.h @@ -86,6 +86,7 @@ static const unsigned char gz_magic[2] = {0x1f, 0x8b}; // gzip magic header QT_BEGIN_NAMESPACE class QHttpNetworkConnection; +class QHttpNetworkConnectionChannel; class QHttpNetworkRequest; class QHttpNetworkConnectionPrivate; class QHttpNetworkReplyPrivate; @@ -218,6 +219,7 @@ public: qint64 currentChunkSize; qint64 currentChunkRead; QPointer<QHttpNetworkConnection> connection; + QPointer<QHttpNetworkConnectionChannel> connectionChannel; bool initInflate; bool streamEnd; #ifndef QT_NO_COMPRESS diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 538333a..1f78a82 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -263,6 +263,8 @@ private Q_SLOTS: void httpConnectionCount(); + void httpRecursiveCreation(); + #ifndef QT_NO_OPENSSL void ioPostToHttpsUploadProgress(); void ignoreSslErrorsList_data(); @@ -3871,6 +3873,70 @@ void tst_QNetworkReply::httpConnectionCount() #endif } +class HttpRecursiveCreationHelper : public QObject { + Q_OBJECT +public: + + HttpRecursiveCreationHelper(): + QObject(0), + requestsStartedCount_finished(0), + requestsStartedCount_readyRead(0), + requestsFinishedCount(0) + { + } + QNetworkAccessManager manager; + int requestsStartedCount_finished; + int requestsStartedCount_readyRead; + int requestsFinishedCount; +public slots: + void finishedSlot() { + requestsFinishedCount++; + + QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); + QVERIFY(!reply->error()); + QVERIFY(reply->bytesAvailable() == 27906); + + if (requestsFinishedCount == 60) { + QTestEventLoop::instance().exitLoop(); + return; + } + + if (requestsStartedCount_finished < 30) { + startOne(); + requestsStartedCount_finished++; + } + + reply->deleteLater(); + } + void readyReadSlot() { + QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); + QVERIFY(!reply->error()); + + if (requestsStartedCount_readyRead < 30 && reply->bytesAvailable() > 27906/2) { + startOne(); + requestsStartedCount_readyRead++; + } + } + void startOne() { + QUrl url = "http://" + QtNetworkSettings::serverName() + "/gif/fluke.gif"; + QNetworkRequest request(url); + QNetworkReply *reply = manager.get(request); + reply->setParent(this); + connect(reply, SIGNAL(finished()), this, SLOT(finishedSlot())); + connect(reply, SIGNAL(readyRead()), this, SLOT(readyReadSlot())); + } +}; + +void tst_QNetworkReply::httpRecursiveCreation() +{ + // this test checks if creation of new requests to the same host properly works + // from readyRead() and finished() signals + HttpRecursiveCreationHelper helper; + helper.startOne(); + QTestEventLoop::instance().enterLoop(30); + QVERIFY(!QTestEventLoop::instance().timeout()); +} + #ifndef QT_NO_OPENSSL void tst_QNetworkReply::ignoreSslErrorsList_data() { diff --git a/tests/benchmarks/corelib/io/qdir/10000/10000.pro b/tests/benchmarks/corelib/io/qdir/10000/10000.pro new file mode 100644 index 0000000..93b0992 --- /dev/null +++ b/tests/benchmarks/corelib/io/qdir/10000/10000.pro @@ -0,0 +1,10 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = bench_qdir_10000 +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += bench_qdir_10000.cpp + +QT -= gui diff --git a/tests/benchmarks/corelib/io/qdir/tst_qdir.cpp b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp index aea9fd0..b325250 100644 --- a/tests/benchmarks/corelib/io/qdir/tst_qdir.cpp +++ b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp @@ -50,7 +50,7 @@ # include <unistd.h> #endif -class Test : public QObject{ +class bench_QDir_10000 : public QObject{ Q_OBJECT public slots: void initTestCase() { @@ -95,9 +95,9 @@ private slots: QBENCHMARK { QDirIterator dit(testdir.path(), QDir::Files); while (dit.hasNext()) { + dit.next(); dit.fileInfo().isDir(); dit.fileInfo().size(); - dit.next(); } } } @@ -116,9 +116,9 @@ private slots: QBENCHMARK { QDirIterator dit(testdir.path()); while (dit.hasNext()) { + dit.next(); dit.fileInfo().isDir(); dit.fileInfo().size(); - dit.next(); } } } @@ -194,5 +194,5 @@ private slots: } }; -QTEST_MAIN(Test) -#include "tst_qdir.moc" +QTEST_MAIN(bench_QDir_10000) +#include "bench_qdir_10000.moc" diff --git a/tests/benchmarks/corelib/io/qdir/qdir.pro b/tests/benchmarks/corelib/io/qdir/qdir.pro index 2cdebfd..c572566 100644 --- a/tests/benchmarks/corelib/io/qdir/qdir.pro +++ b/tests/benchmarks/corelib/io/qdir/qdir.pro @@ -1,8 +1,2 @@ -load(qttest_p4) -TEMPLATE = app -TARGET = tst_qdir -DEPENDPATH += . -INCLUDEPATH += . - -# Input -SOURCES += tst_qdir.cpp +TEMPLATE = subdirs +SUBDIRS = 10000 diff --git a/tools/assistant/lib/qhelpsearchengine.cpp b/tools/assistant/lib/qhelpsearchengine.cpp index 7c2635d..9914efa 100644 --- a/tools/assistant/lib/qhelpsearchengine.cpp +++ b/tools/assistant/lib/qhelpsearchengine.cpp @@ -63,9 +63,9 @@ QT_BEGIN_NAMESPACE #if defined(QT_CLUCENE_SUPPORT) - using namespace qt::fulltextsearch::clucene; + using namespace fulltextsearch::clucene; #else - using namespace qt::fulltextsearch::std; + using namespace fulltextsearch::std; #endif class QHelpSearchEnginePrivate : public QObject @@ -195,7 +195,7 @@ private: QHelpSearchQueryWidget *queryWidget; QHelpSearchResultWidget *resultWidget; - qt::fulltextsearch::QHelpSearchIndexReader *indexReader; + fulltextsearch::QHelpSearchIndexReader *indexReader; QHelpSearchIndexWriter *indexWriter; QPointer<QHelpEngineCore> helpEngine; diff --git a/tools/assistant/lib/qhelpsearchindexreader.cpp b/tools/assistant/lib/qhelpsearchindexreader.cpp index 92d7658..e79fca6 100644 --- a/tools/assistant/lib/qhelpsearchindexreader.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader.cpp @@ -43,8 +43,7 @@ QT_BEGIN_NAMESPACE -namespace qt { - namespace fulltextsearch { +namespace fulltextsearch { QHelpSearchIndexReader::QHelpSearchIndexReader() : QThread() @@ -100,7 +99,6 @@ QList<QHelpSearchEngine::SearchHit> QHelpSearchIndexReader::hits(int start, } - } // namespace fulltextsearch -} // namespace qt +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp index ee6dcfb..c2274c4 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp @@ -58,9 +58,8 @@ QT_BEGIN_NAMESPACE -namespace qt { - namespace fulltextsearch { - namespace clucene { +namespace fulltextsearch { +namespace clucene { QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() : QHelpSearchIndexReader() @@ -476,8 +475,7 @@ void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engin } } - } // namespace clucene - } // namespace fulltextsearch -} // namespace qt +} // namespace clucene +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexreader_default.cpp b/tools/assistant/lib/qhelpsearchindexreader_default.cpp index d2241a5..11a50d9 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_default.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader_default.cpp @@ -52,9 +52,8 @@ QT_BEGIN_NAMESPACE -namespace qt { - namespace fulltextsearch { - namespace std { +namespace fulltextsearch { +namespace std { namespace { QStringList split( const QString &str ) @@ -607,8 +606,7 @@ void QHelpSearchIndexReaderDefault::run() emit searchingFinished(hitList.count()); } - } // namespace std - } // namespace fulltextsearch -} // namespace qt +} // namespace std +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexreader_default_p.h b/tools/assistant/lib/qhelpsearchindexreader_default_p.h index 8c80608..b30fa4b 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_default_p.h +++ b/tools/assistant/lib/qhelpsearchindexreader_default_p.h @@ -64,9 +64,8 @@ QT_BEGIN_NAMESPACE struct Entry; struct PosEntry; -namespace qt { - namespace fulltextsearch { - namespace std { +namespace fulltextsearch { +namespace std { class Reader { @@ -127,9 +126,8 @@ private: Reader m_reader; }; - } // namespace std - } // namespace fulltextsearch -} // namespace qt +} // namespace std +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexreader_p.h b/tools/assistant/lib/qhelpsearchindexreader_p.h index b309f46..4d27c0f 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_p.h +++ b/tools/assistant/lib/qhelpsearchindexreader_p.h @@ -66,8 +66,7 @@ QT_BEGIN_NAMESPACE class QHelpEngineCore; -namespace qt { - namespace fulltextsearch { +namespace fulltextsearch { class QHelpSearchIndexReader : public QThread { @@ -100,8 +99,7 @@ private: virtual void run()=0; }; - } // namespace fulltextsearch -} // namespace qt +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp index 6e49e54..d9dcec5 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp @@ -64,9 +64,8 @@ QT_BEGIN_NAMESPACE -namespace qt { - namespace fulltextsearch { - namespace clucene { +namespace fulltextsearch { +namespace clucene { // taken from qtexthtmlparser static const struct QTextHtmlEntity @@ -893,8 +892,7 @@ void QHelpSearchIndexWriter::closeIndexWriter(QCLuceneIndexWriter *writer) #endif } - } // namespace clucene - } // namespace fulltextsearch -} // namespace qt +} // namespace clucene +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h b/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h index 91b8abd..db1e533 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h @@ -69,9 +69,8 @@ QT_BEGIN_NAMESPACE class QCLuceneIndexWriter; -namespace qt { - namespace fulltextsearch { - namespace clucene { +namespace fulltextsearch { +namespace clucene { class QHelpSearchIndexWriter : public QThread { @@ -116,9 +115,9 @@ private: QString m_indexFilesFolder; }; - } // namespace clucene - } // namespace fulltextsearch } // namespace clucene +} // namespace fulltextsearch + QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexwriter_default.cpp b/tools/assistant/lib/qhelpsearchindexwriter_default.cpp index 6d09fb8..cb3e49c 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_default.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_default.cpp @@ -55,9 +55,8 @@ QT_BEGIN_NAMESPACE -namespace qt { - namespace fulltextsearch { - namespace std { +namespace fulltextsearch { +namespace std { Writer::Writer(const QString &path) : indexPath(path) @@ -379,8 +378,7 @@ QString QHelpSearchIndexWriter::removeNamespace(const QString namespaces, return value; } - } // namespace std - } // namespace fulltextsearch -} // namespace qt +} // namespace std +} // namespace fulltextsearch QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexwriter_default_p.h b/tools/assistant/lib/qhelpsearchindexwriter_default_p.h index b222203..625cb84 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_default_p.h +++ b/tools/assistant/lib/qhelpsearchindexwriter_default_p.h @@ -65,9 +65,8 @@ QT_BEGIN_NAMESPACE -namespace qt { - namespace fulltextsearch { - namespace std { +namespace fulltextsearch { +namespace std { class Writer { @@ -123,9 +122,8 @@ private: QString m_indexFilesFolder; }; - } // namespace std - } // namespace fulltextsearch -} // namespace qt +} // namespace std +} // namespace fulltextsearch QT_END_NAMESPACE |