summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-11-23 11:03:43 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-11-23 11:03:46 (GMT)
commit366af17676a87943c8a7c2380a8819bdd3815878 (patch)
tree378efb9fe91abd68be687780276dbcffbf6eb457
parent9619f5e27cbed9b45188112c934733e9f069b8ca (diff)
parentb7692016f282251002b3e85dfcb5567bd91a12c0 (diff)
downloadQt-366af17676a87943c8a7c2380a8819bdd3815878.zip
Qt-366af17676a87943c8a7c2380a8819bdd3815878.tar.gz
Qt-366af17676a87943c8a7c2380a8819bdd3815878.tar.bz2
Merge commit 'b7692016f282251002b3e85dfcb5567bd91a12c0' of oslo-staging-1 into 4.6
-rw-r--r--doc/src/getting-started/known-issues.qdoc15
-rw-r--r--src/corelib/io/qiodevice.cpp6
-rw-r--r--src/gui/image/qnativeimage.cpp2
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
-rw-r--r--tests/auto/qiodevice/tst_qiodevice.cpp112
5 files changed, 132 insertions, 5 deletions
diff --git a/doc/src/getting-started/known-issues.qdoc b/doc/src/getting-started/known-issues.qdoc
index 2752676..b8c2192 100644
--- a/doc/src/getting-started/known-issues.qdoc
+++ b/doc/src/getting-started/known-issues.qdoc
@@ -61,27 +61,33 @@
\section2 Installing the Source Package on Unix systems
+ \list
+
\o If you download a Zip source package, you will need to convert
Windows-style line endings (CR/LF) to Unix-style line-endings (LF) when
you uncompress the package. To do this, give the "-a" option when you
run the "unzip' command.
-
- If you fail to supply the "-a" option when unzipping the package, you
+
+ \o If you fail to supply the "-a" option when unzipping the package, you
will see the following error message when you attempt to execute the
configure command:
"bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory"
+
\endlist
\section2 Installing on Mac OS X 10.6 "Snow Leopard"
+
\list
+
\o Performing a new install of the Qt 4.6 beta on Snow Leopard
triggers a bug in the installer that causes the install to fail.
Updating an existing Qt installation works fine.
- There are two workarounds, either disable spotlight for the target
+ \o There are two workarounds, either disable spotlight for the target
drive during the install, or do a custom install where you deselect
documentation and examples. Run the installer again as a full
install to get the documentation and examples installed.
+
\endlist
\section1 Issues with Third Party Software
@@ -107,6 +113,7 @@
\section2 Windows
\list
+
\o When using version 6.14.11.6921 of the NVIDIA drivers for the GeForce
6600 GT under Windows XP, Qt applications which use drag and drop will
display reduced size drag and drop icons when run alongside
@@ -132,9 +139,11 @@
\section2 Mac OS X
\list
+
\o If a sheet is opened for a given window, clicking the title bar of that
window will cause it to flash. This behavior has been reported to Apple
(bug number 5827676).
+
\endlist
\section2 Symbian
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index b84961f..0e5a2de 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1157,6 +1157,10 @@ QByteArray QIODevice::readLine(qint64 maxSize)
// If resize fails or maxSize == 0, read incrementally
if (maxSize == 0)
maxSize = INT_MAX;
+
+ // The first iteration needs to leave an extra byte for the terminating null
+ result.resize(1);
+
qint64 readResult;
do {
result.resize(int(qMin(maxSize, result.size() + QIODEVICE_BUFFERSIZE)));
@@ -1164,7 +1168,7 @@ QByteArray QIODevice::readLine(qint64 maxSize)
if (readResult > 0 || readBytes == 0)
readBytes += readResult;
} while (readResult == QIODEVICE_BUFFERSIZE
- && result[int(readBytes)] != '\n');
+ && result[int(readBytes - 1)] != '\n');
} else
readBytes = readLine(result.data(), result.size());
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index e4ea2e9..3b43ab6 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -178,6 +178,8 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /*
if (ok) {
xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0);
xshminfo.shmaddr = xshmimg->data;
+ if (shmctl(xshminfo.shmid, IPC_RMID, 0) == -1)
+ qWarning() << "Error while marking the shared memory segment to be destroyed";
ok = (xshminfo.shmaddr != (char*)-1);
if (ok)
image = QImage((uchar *)xshmimg->data, width, height, systemFormat());
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index a16d1f8..72eedad 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1451,7 +1451,7 @@ Qt::DropAction QDragManager::drag(QDrag *o)
[image release];
dragPrivate()->executed_action = Qt::IgnoreAction;
object = 0;
- Qt::DropAction performedAction(qt_mac_mapNSDragOperation(dndParams.performedAction));
+ Qt::DropAction performedAction(qt_mac_mapNSDragOperation(qMacDnDParams()->performedAction));
// do post drag processing, if required.
if(performedAction != Qt::IgnoreAction) {
// check if the receiver points us to a file location.
diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp
index 056ad6a..84fd8ad 100644
--- a/tests/auto/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/qiodevice/tst_qiodevice.cpp
@@ -77,6 +77,9 @@ private slots:
void readLine_data();
void readLine();
+
+ void readLine2_data();
+ void readLine2();
};
// Testing get/set functions
@@ -453,5 +456,114 @@ void tst_QIODevice::readLine()
QCOMPARE(line.size(), linelen);
}
+void tst_QIODevice::readLine2_data()
+{
+ QTest::addColumn<QByteArray>("line");
+
+ QTest::newRow("1024 - 4") << QByteArray(1024 - 4, 'x');
+ QTest::newRow("1024 - 3") << QByteArray(1024 - 3, 'x');
+ QTest::newRow("1024 - 2") << QByteArray(1024 - 2, 'x');
+ QTest::newRow("1024 - 1") << QByteArray(1024 - 1, 'x');
+ QTest::newRow("1024" ) << QByteArray(1024 , 'x');
+ QTest::newRow("1024 + 1") << QByteArray(1024 + 1, 'x');
+ QTest::newRow("1024 + 2") << QByteArray(1024 + 2, 'x');
+
+ QTest::newRow("4096 - 4") << QByteArray(4096 - 4, 'x');
+ QTest::newRow("4096 - 3") << QByteArray(4096 - 3, 'x');
+ QTest::newRow("4096 - 2") << QByteArray(4096 - 2, 'x');
+ QTest::newRow("4096 - 1") << QByteArray(4096 - 1, 'x');
+ QTest::newRow("4096" ) << QByteArray(4096 , 'x');
+ QTest::newRow("4096 + 1") << QByteArray(4096 + 1, 'x');
+ QTest::newRow("4096 + 2") << QByteArray(4096 + 2, 'x');
+
+ QTest::newRow("8192 - 4") << QByteArray(8192 - 4, 'x');
+ QTest::newRow("8192 - 3") << QByteArray(8192 - 3, 'x');
+ QTest::newRow("8192 - 2") << QByteArray(8192 - 2, 'x');
+ QTest::newRow("8192 - 1") << QByteArray(8192 - 1, 'x');
+ QTest::newRow("8192" ) << QByteArray(8192 , 'x');
+ QTest::newRow("8192 + 1") << QByteArray(8192 + 1, 'x');
+ QTest::newRow("8192 + 2") << QByteArray(8192 + 2, 'x');
+
+ QTest::newRow("16384 - 4") << QByteArray(16384 - 4, 'x');
+ QTest::newRow("16384 - 3") << QByteArray(16384 - 3, 'x');
+ QTest::newRow("16384 - 2") << QByteArray(16384 - 2, 'x');
+ QTest::newRow("16384 - 1") << QByteArray(16384 - 1, 'x');
+ QTest::newRow("16384" ) << QByteArray(16384 , 'x');
+ QTest::newRow("16384 + 1") << QByteArray(16384 + 1, 'x');
+ QTest::newRow("16384 + 2") << QByteArray(16384 + 2, 'x');
+
+ QTest::newRow("20000") << QByteArray(20000, 'x');
+
+ QTest::newRow("32768 - 4") << QByteArray(32768 - 4, 'x');
+ QTest::newRow("32768 - 3") << QByteArray(32768 - 3, 'x');
+ QTest::newRow("32768 - 2") << QByteArray(32768 - 2, 'x');
+ QTest::newRow("32768 - 1") << QByteArray(32768 - 1, 'x');
+ QTest::newRow("32768" ) << QByteArray(32768 , 'x');
+ QTest::newRow("32768 + 1") << QByteArray(32768 + 1, 'x');
+ QTest::newRow("32768 + 2") << QByteArray(32768 + 2, 'x');
+
+ QTest::newRow("40000") << QByteArray(40000, 'x');
+}
+
+void tst_QIODevice::readLine2()
+{
+ QFETCH(QByteArray, line);
+
+ int length = line.size();
+
+ QByteArray data("First line.\r\n");
+ data.append(line);
+ data.append("\r\n");
+ data.append(line);
+ data.append("\r\n");
+ data.append("\r\n0123456789");
+
+ {
+ QBuffer buffer(&data);
+ buffer.open(QIODevice::ReadOnly);
+
+ buffer.seek(0);
+ QByteArray temp;
+ temp.resize(64536);
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(13));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 2));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 2));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(2));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(10));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(-1));
+
+ buffer.seek(0);
+ QCOMPARE(buffer.readLine().size(), 13);
+ QCOMPARE(buffer.readLine().size(), length + 2);
+ QCOMPARE(buffer.readLine().size(), length + 2);
+ QCOMPARE(buffer.readLine().size(), 2);
+ QCOMPARE(buffer.readLine().size(), 10);
+ QVERIFY(buffer.readLine().isNull());
+ }
+
+ {
+ QBuffer buffer(&data);
+ buffer.open(QIODevice::ReadOnly | QIODevice::Text);
+
+ buffer.seek(0);
+ QByteArray temp;
+ temp.resize(64536);
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(12));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 1));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(length + 1));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(1));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(10));
+ QCOMPARE(buffer.readLine(temp.data(), temp.size()), qint64(-1));
+
+ buffer.seek(0);
+ QCOMPARE(buffer.readLine().size(), 12);
+ QCOMPARE(buffer.readLine().size(), length + 1);
+ QCOMPARE(buffer.readLine().size(), length + 1);
+ QCOMPARE(buffer.readLine().size(), 1);
+ QCOMPARE(buffer.readLine().size(), 10);
+ QVERIFY(buffer.readLine().isNull());
+ }
+}
+
QTEST_MAIN(tst_QIODevice)
#include "tst_qiodevice.moc"