summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-10-28 03:34:36 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-10-28 03:34:36 (GMT)
commitaf0951ed3d361214645283bc85865872754f8f66 (patch)
tree45fa14580f103f9fbaf6291941afc19fa3b00f87 /src/corelib
parent68f87b31ae4b49a69686e4ecedeea1b9839debfd (diff)
parente5df3b4eeaf5943f5170dda781c3c589fa35a15a (diff)
downloadQt-af0951ed3d361214645283bc85865872754f8f66.zip
Qt-af0951ed3d361214645283bc85865872754f8f66.tar.gz
Qt-af0951ed3d361214645283bc85865872754f8f66.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: QIODevice - disallow setTextMode when not open
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qiodevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index dae4e82..56fff90 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -468,11 +468,17 @@ void QIODevice::setOpenMode(OpenMode openMode)
otherwise the \l Text flag is removed. This feature is useful for classes
that provide custom end-of-line handling on a QIODevice.
+ The IO device should be opened before calling this function.
+
\sa open(), setOpenMode()
*/
void QIODevice::setTextModeEnabled(bool enabled)
{
Q_D(QIODevice);
+ if (!isOpen()) {
+ qWarning("QIODevice::setTextModeEnabled: The device is not open");
+ return;
+ }
if (enabled)
d->openMode |= Text;
else