summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Use factor and divisor wording to be consistent with the documentation and restLaszlo Papp2012-07-101-27/+27
| | | | | Change-Id: If05bdcba8f94f4220bae4c40dc5fc3cf44ee41a0 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* statemachine: goToState() should require that the machine is runningKent Hansen2012-07-101-10/+7
| | | | | | | | | | | goToState() is an internal function. Allowing both goToState() and machine.setInitialState() to be used to set the initial state of the machine complicates the logic of QStateMachine::start(). The existing tests for goToState() still pass. Change-Id: Ie831b4c869848f7f4c3e6bd576cf298a9799eb22 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Speed up QCoreApplication construction a bitHarald Fernengel2012-07-102-3/+3
| | | | | | | | Remove all QString conversions during QCoreApplication construction on Linux. Saves multiple mallocs. Change-Id: Ia8ba071a750dd6a08dcf14ef3ecc424f70a3098d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q_DECLARE_SHARED: mark the type movableMarc Mutz2012-07-108-7/+2
| | | | | | | | | | All implicitly shared classes are by definition movable, so this patch adds Q_DECLARE_TYPEINFO(Type, Q_MOVABLE_TYPE) to Q_DECLARE_SHARED. Change-Id: Idf8989ae1a7ed6d1ac13fccb7eaef7395a875350 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtCore: mark some classes as sharedMarc Mutz2012-07-107-5/+12
| | | | | Change-Id: I811d3eebd87c230883cc579c20f9fa4e14ff9521 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make the x() and y() method documentation consistent with the restLaszlo Papp2012-07-101-2/+2
| | | | | Change-Id: I24d34fe32e2ed7673ba525db0543e705d08037c4 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add note and references to the operator*=() methods for consistencyLaszlo Papp2012-07-101-0/+12
| | | | | Change-Id: Ic2681e1db39a30619d3b2a906595cdbdd0e766d6 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QNX: QtGlobal: compile as a C header againMarc Mutz2012-07-091-1/+3
| | | | | | | | | | | <utility> is a C++ header, only execute the check for the Dinkumware standard library if we're compiling under a C++ compiler. Change-Id: I1b24e76f20bfc03b70a330f9da96b4f815106e61 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove Library dependency on SettingsTasuku Suzuki2012-07-095-16/+8
| | | | | | | | made QLibraryInfo available with QT_NO_SETTINGS. QKdeTheme is removed when QT_NO_SETTINGS is defined. Change-Id: I63d619bb305e6c23985d9ea50c72d39a697b7a4b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QMimeType: document preferredSuffix()/suffixes() betterDavid Faure2012-07-081-2/+3
| | | | | | | Change-Id: Icf4aab3516cd622d9932e32cb0bd819bef22ce9b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com> Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
* Fix QMimeType::operator== to only compare mimetype names.David Faure2012-07-082-20/+3
| | | | | | | | | | The name is the unique identifier. Code such as if (oldItem.mimeType() == newItem.mimeType()) really wants to detect whether the item has a new mimetype (name), not compare static mimetype data such as comments and icons. Change-Id: I5fe56443295c91e1024c066ad6e7f93d842ae507 Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
* Q_DECLARE_SHARED: fix docs; require and use member-swapMarc Mutz2012-07-061-5/+5
| | | | | | | | | | | | | | | By requiring a member-swap, this macro becomes applicable to a wider range of types (e.g. QFont, which has another member besides 'd'), while at the same time avoiding the encapsulation leak that is data_ptr(). There have been concerns over breaking existing users of this macro, but for some time now, Q_DECLARE_SHARED only works within QT_BEGIN_NAMESPACE anyway, so its a safe bet that all users of this macro are in-tree. Change-Id: I7fdd9dba204554af8d3f9768b97bb42847a5acf4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QArrayData: Fix gcc warning about parentheses in 'a + b & c'.Friedemann Kleint2012-07-061-1/+1
| | | | | Change-Id: I2c08dc8170c77de401663b1643ebca8484dbfec0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix event loop throughput issueRafael Roquetto2012-07-051-8/+25
| | | | | | | | | | Currently, only one bps event can be handled per event loop iteration, bringing about a huge performance penalty. This patch fixes this issue by bulk processing events whenever they are available. Change-Id: Iecce1e86730bd90c3c81a7c6ebdf9ed83189e58e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix socket notifier registration on Blackberry.Rafael Roquetto2012-07-042-8/+52
| | | | | | | | | | This fixes a bug on QEventDispatcherBlackberry, where registerSocketNotifier() and unregisterSocketNotifier() wrongly assumed that a file descriptor was being watched exclusively by one QSocketNotifier, while in fact there can be more than one QSocketNotifier associated with a single file descriptor. Change-Id: I0ce54bf809df109ad97f4a7f170f448d5d04d453 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Uppercase the CONFIG for verbatim mode.Stephen Kelly2012-07-041-1/+1
| | | | | Change-Id: Iec883e0218af80fc329d866affb2b95db72c54d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Add a Q_PROPERTY for the sourceModel of a proxy model.Stephen Kelly2012-07-042-9/+16
| | | | | | | | | | | Now that Q_PROPERTY with a QObject derived type is more powerful. This property can be used in QML so that wrappers for proxy models do not need to be created, such as in the example at https://codereview.qt-project.org/#change,13007 Change-Id: I6ba676549d2135585d429a28e214fef0b2a6b1f9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Revert "Allow moc to handle symbols that have been redefined."Matthew Vogt2012-07-041-6/+6
| | | | | | | | | | | | This reverts commit 5bb1408927b4eb5a03e8ab9f7cbc68f80d8a3962. The temporary measure used to support redefinition of QtDeclarative class names during the transition period is no longer required. Task-number: QTBUG-24517 Change-Id: Ib90f08fcdfb02e004e594ac72b698eaa0325d98d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Simplify the creation of QMetaTypeId specializations.Stephen Kelly2012-07-031-10/+6
| | | | | Change-Id: I07405f91b6f73a4e129859ca45a983d3ec7029ab Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QNX: fix compilation with C++11 enabledMarc Mutz2012-07-031-0/+12
| | | | | | | | | | | | | | | | | | | | QNX uses GCC, but by default not libstdc++ as the standard library, but 'libcpp', a Dinkumware-derived implementation that doesn't sport many of the C++11 features, yet. Thus, the compiler detection sets Q_COMPILER_INITIALIZER_LIST, which is true, in a way, but we're lacking stdlib support, so the next \#include <initializer_list> will fail. So, simply don't define Q_COMPILER_INITIALIZER_LIST if we're on QNX and detect a Dinkumware signature (taken from Boost.Config). This is a hot-fix. I'm also preparing a more comprehensive solution (qstdlibdetection.h). Change-Id: Ieeb147251c2935517faba61f75d1580a9e1649c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QChar::SoftHyphen enum valueKonstantin Ritt2012-07-032-1/+2
| | | | | | | | | Just like for the QChar::ByteOrderMark, `ch == QChar::SoftHyphen` is much more readable than `ch == 0x00ad // (soft-hyphen)`, etc. Change-Id: I9c85f14cfd979037d35103c3259a435fd729b869 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Silence clang warning in QVector::reallocData()Kent Hansen2012-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | qvector.h:459:30: warning: destination for this 'memcpy' call is a pointer to dynamic class 'QImage'; vtable pointer will be overwritten [-Wdynamic-class-memaccess] ::memcpy(dst, srcBegin, (srcEnd - srcBegin) * sizeof(T)); ~~~~~~~~ ^ qvector.h:459:30: note: explicitly cast the pointer to silence this warning ::memcpy(dst, srcBegin, (srcEnd - srcBegin) * sizeof(T)); ^ (void*) QImage inherits from QPaintDevice, which has virtual functions. qimage.h declares QImage as a movable type, so QTypeInfo<QImage>::isStatic is false. Hence, the memcpy codepath will be reached when the vector is not shared. We should trust that people declaring such type traits know what they're doing, so silence the warning. Change-Id: If36582f57a398fc237fb4bd4f72938fb09667118 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add erase operation to QArrayDataOpsJoão Abecasis2012-07-031-0/+63
| | | | | Change-Id: I37d3ac465f5beddb5038e22e9cda32acb16c78fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: add member-swap to shared classesMarc Mutz2012-07-0313-0/+67
| | | | | | | | | | Implemented as in other shared classes (e.g. QPen). Special case: QUrlQuery: document existing swap(). Change-Id: I4b36cc9577fbf2232d4b2a2d8822d26e41e22cad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Forward the CMAKE_PREFIX_PATH to invoked tests.Stephen Kelly2012-07-031-2/+2
| | | | | Change-Id: I5166fb39dcf3ab660c971c4c68b714f534de40cb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move the macros for invoking ctest to a shared location.Stephen Kelly2012-07-033-0/+60
| | | | | | | | | They are still internal, but all Qt5 modules will be able to use them then. Change-Id: I42ab656115b0976ca959293dfd664ec071f35dbf Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add constexpr template specializations for built in metatypes.Stephen Kelly2012-07-031-5/+5
| | | | | | | | | This will make it possible (in Qt 6) to remove the enums listing metatype ids. As it is constexpr, it can be used in switch statements just like enums, as enum values, and as template specialization values. Change-Id: I51293674c403714e34cb8a8b8953522fc97a740a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* buildsystem: Remove SXE from the configure and qconfig-*.h filesHolger Hans Peter Freyther2012-07-022-6/+0
| | | | | | | The SXE feature was used with Qtopia but is long gone. Clean it up. Change-Id: I55fba97b6382300ba63e94f3a6c415227f571e37 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Make the CPU detection much more efficient in user codeThiago Macieira2012-07-022-43/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | First, check that the option in question hasn't been already enabled by the compiler, via compiler switches. If it has been, then we don't need to verify anything, and we can assume that it's safe to use such instructions. For example, on an x86-64 build, qCpuHasFeature(SSE2) is always a constant true. If the compile-time check fails, then we proceed to try and detect the processor features at runtime. But instead of insisting on a call to qDetectCPUFeatures, allow the code using the detection to read from a variable and simply test it for values. Only if the variable isn't initialised should it make a function call. The Q_ASSUME allows this code to be very efficient even with multiple uses of qCpuHasFeature. Change the uninitialised value from -1 to 0 so that simpler instructions can be used to check for non-initialisation. The qDetectCPUFeatures function is renamed to qDetectCpuFeatures to match the Qt coding style and also to catch uses this code that need to be adapted. Change-Id: I24ca5a6ad21075e2e249e1a4f8f5057b8f68ce7c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix MinGW-w64 compilationJonathan Liu2012-07-021-1/+1
| | | | | | Task-number: QTBUG-24699 Change-Id: If6210315926f0266045766bb5d3b00a6d0bdf703 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Implement QVariant conversions for QObject derived pointer metatypes.Stephen Kelly2012-07-011-1/+64
| | | | | | | canConvert() and convert() use the metaobject to convert such types. Change-Id: Ic05e74c5c2423b4b9682b88adc856a16dcba4cff Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Store the QMetaObject with the QMetaType.Stephen Kelly2012-07-013-7/+98
| | | | | | | | This will allow conversion between pointers to compatible QObject derived types. Change-Id: I19e08934571fb3f1b91e594892214041fe5f6a11 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Add detection for C++11 noexceptThiago Macieira2012-06-291-0/+13
| | | | | | | | | | | | | | | | | The Q_COMPILER_NOEXCEPT feature indicates whether this compiler has support for noexcept. Note that the GCC C++11 status page does not list this feature, but investigation into the source code as well as testing reveals it's supported since GCC 4.6. Also add Q_DECL_NOEXCEPT, to be used to declare that a function throws no exceptions, and Q_DECL_NOEXCEPT_EXPR(x), which declares that the function throws no exceptions if x evaluates to true. In C++98 mode, these macros expand to empty -- the old C++98 and C++03 exception specification is deprecated and considered harmful. Change-Id: Ic84901d13eceb06dcc7f025a4b7fc8b250769be9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Clean up the EXPORT macros in qglobal.h.Thiago Macieira2012-06-291-56/+3
| | | | | | | | | | | | | | | | | | | | QtPlatformSupport is a static library. It should never export anything, so Q_PLATFORMSUPPORT_EXPORT is unnecessary. QtSql, QtXml, QtDBus, QtOpenGL and QtPrintSupport now have the macros on their own source trees. It's possible these modules might be separated out from qtbase in the future. For QtDBus, the macros are moving back to where they used to be. This also leaves qglobal.h only creating the macros for QtCore, QtGui, QtWidgets and QtNetwork, the core libraries. Q_CANVAS_EXPORT, Q_OPENVG_EXPORT and Q_COMPAT_EXPORT aren't used anywhere in the Qt sources, so simply delete them. And the Q_QUICK1_EXPORT macro in the static section was wrong, so remove it too. Change-Id: I50bdf86e783338f814903b25979721f788a7becf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix warning: returning non void by using Q_UNREACHABLEFrederik Gladhorn2012-06-281-0/+2
| | | | | | Change-Id: I08e5b629582b1286c57f6c5f991e2adaf431daa4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
* Call QObject::disconnectNotify() when receiver is destroyedKent Hansen2012-06-282-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Store the signal index in QObjectPrivate::Connection, thereby making it available in "implicit" disconnect contexts (i.e., receiver deletion). This change does not cause the size of QObjectPrivate::Connection to grow (still 40 bytes on 32-bit Linux, 72 bytes on 64-bit Mac). Valgrinding the new benchmark indicates that the percentage of the time spent in the QObject destructor increased from 7.8% to 8.4% on ia32, for that particular stress test; the increase is the combined cost of calling metaObject(), QMetaObjectPrivate::signal(), and disconnectNotify() for one connection. In practice, the measured wallclock time increased by about 3ms for a 500ms run (which repeatedly constructs, connects, and destroys an object). Task-number: QTBUG-4844 Change-Id: I1beb01c753f31542fc0acb62edb4c6d165fcc5b4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QMetaType: Fix warnings about truncation from uint64 to int.Friedemann Kleint2012-06-281-2/+2
| | | | | | | Triggers warnings with MSVC2010/64bit. Change-Id: I90abdf4de416e0db554eb46e4b3cc7a0a38cb1db Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Move the QDataStream operator<< for QPair to qdatastream.hThiago Macieira2012-06-282-18/+18
| | | | | | | | | | QPair is small and is no problem to include from qdatastream.h. However, including QDataStream from qpair.h means including QIODevice and QObject too. Change-Id: I344321e9f68438008ec329a165135c3a346c6058 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Update the macros for shared/DLL and static buildsThiago Macieira2012-06-281-80/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, we had a mess of different macros used for building DLLs, for building shared libraries on Unix systems and for building static libraries. Some of the macros were contradictory and did not work. From now on, there shall be only: - QT_STATIC: indicates that it's a static Qt build and the export macros should expand to empty - QT_SHARED: indicates that it's a shared / dynamic Qt build and the export macros should expand to Q_DECL_EXPORT or Q_DECL_IMPORT, depending on whether the macro corresponds to the current module being built (the QT_BUILD_XXXX_LIB macro comes from the module's .pro file) QT_BOOTSTRAPPED implies QT_STATIC since the bootstrapped tools link statically to some source code. QT_STATIC is recorded in qconfig.h by configure when Qt is configured for static builds. Nothing is recorded for a shared / dynamic build, so QT_SHARED is implied if nothing is defined. This allows for the existence of a static_and_shared build: with nothing recorded, defining QT_STATIC before qglobal.h causes the export macros to be that of the static form. Linking to the static libraries is out of the scope of this change (something for the buildsystem and linker to figure out). From this commit on, the proper way of declaring the export macros for a module called QtFoo is: #ifndef QT_STATIC # ifdef QT_BUILD_FOO_LIB # define Q_FOO_EXPORT Q_DECL_EXPORT # else # define Q_FOO_EXPORT Q_DECL_IMPORT # endif #else # define Q_FOO_EXPORT #endif The type of the Qt build is recorded in QT_CONFIG (in qconfig.pri) so all Qt modules build by default the same type of library. The keywords are "static" and "shared", used in both QT_CONFIG and CONFIG. The previous keyword of "staticlib" is deprecated and should not be used. Discussed-on: http://lists.qt-project.org/pipermail/development/2012-April/003172.html Change-Id: I127896607794795b681c98d08467efd8af49bcf3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Include QScopedPointer in qsettings.hThiago Macieira2012-06-281-0/+1
| | | | | | | | qobject.h includes it, but only if QT_NO_QOBJECT isn't defined. It is during the build of the bootstrapped tools. Change-Id: I8fc921fb17c283358af263a6932b763a21209d40 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* doc: use correct snippet id for QObject::isSignalConnectedKent Hansen2012-06-281-1/+1
| | | | | | | Copy-and-paste error; the doc was based on QObject::receivers. Change-Id: I4f6ce716d388328e0345e8457cbc99fff323ce41 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* doc: remove duplicate linkKent Hansen2012-06-281-1/+1
| | | | | | | | | | Since QStateMachine inherits QState, QStateMachine::finished() and QState::finished() are the same thing. Task-number: QTBUG-14553 Change-Id: I7df2f815be377c19aeee393e9a2ce124183dc5e1 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* doc: add missing \sa tagKent Hansen2012-06-281-1/+1
| | | | | | Change-Id: I50580bfefdf556f116b7099946b047acd12d4563 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Document that the object of a plugin must be default-constructible.Stephen Kelly2012-06-271-0/+2
| | | | | Change-Id: Iaaf56ec3bb0d2423c8ab5deb0627dc1357cee830 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add \since 5.0 to QDir::removeRecursivelyShane Kearns2012-06-271-0/+1
| | | | | Change-Id: I2392f26e666d5e01e71932f1afa48a65704f6d48 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove debug outputABBAPOH2012-06-272-68/+0
| | | | | | Change-Id: I07270211ee6f0439dc7249c8946795a68025828f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <faure@kde.org>
* Add QAbstractDeclarativeData::isSignalConnected hookKent Hansen2012-06-262-6/+10
| | | | | | | | | | | | | | Similar to QAbstractDeclarative::receivers. This hook will allow QObject::isSignalConnected(QMetaMethod) to return true when there are QML-managed connections. It's important that the hook is called from QObjectPrivate::isSignalConnected(uint), since QML calls that function. Change-Id: I9c5e42f2b3e7f985af02905985a3a47101cdee05 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix QIODevice warning when running rcc.Mitch Curtis2012-06-261-10/+10
| | | | | | | | | | | | | | | | | | When opening a QFile on stdout, for example, we must not call seek as it is a sequential device. This has been flagged as a warning since commit Ie3a96d3a and has resulted in spurious warnings being emitted. In the case of opening a QFile in Append mode, QIODevice::open already sets the position marker, so calling seek is redundant. This is also true for the file engine's open function (called through openExternalFile()), which also ensures the handle or descriptor is repositioned appropriately. Task-number: QTBUG-26104 Change-Id: I71040c399efe54e7538f54433368b432e959e08d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* QIODevice: free memory when buffer is clearedMartin Petersson2012-06-262-5/+9
| | | | | | | | | | | | | | | The QIODevicePrivateLinearBuffer does not deallocate any data on readAll or clear. This fix will change the buffer so that data is deallocated on clear, readAll and when read emptied the buffer. This is needed for QAbstractSockets that don't have readBufferMaxSize set, as the buffer will grow but never decrease in size when you read from it. Change-Id: Iab42e40182f9ebe0739c99b2d1e820ce287dc931 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QAbstractSocket: Enable readNotifier on read from bufferMartin Petersson2012-06-263-1/+19
| | | | | | | | | | | | | | This is needed for the QSslSocket. When we read on that socket we will only read from the QIODevice buffer to get the unencrypted data. So when the readNotifier has been turned off on the plainsocket there is nothing to trigger it to be turned on again. This will add a readData with zero size when we have read everything from the buffer. This is so that we get a call into the socket to check if the readNotifier should be turned on again. Change-Id: I3b63e33de007db823e964480903186eb1b8caac2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>