diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-10-28 03:34:36 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-10-28 03:34:36 (GMT) |
commit | af0951ed3d361214645283bc85865872754f8f66 (patch) | |
tree | 45fa14580f103f9fbaf6291941afc19fa3b00f87 /src/corelib | |
parent | 68f87b31ae4b49a69686e4ecedeea1b9839debfd (diff) | |
parent | e5df3b4eeaf5943f5170dda781c3c589fa35a15a (diff) | |
download | Qt-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.cpp | 6 |
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 |