From da0303d1ba6acc58f60c7448fefeffc88e8e331b Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 12 Aug 2010 16:32:11 +1000 Subject: QAudioOutput(ALSA); Fix check for available devices. ALSA can return a list of one empty item when no devices are available. Task-number: QTBUG-12690 Reviewed-by: Andrew den Exter --- src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 31 +++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp index f663dd2..633b309 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp @@ -431,21 +431,24 @@ QList QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode) while (*n != NULL) { name = snd_device_name_get_hint(*n, "NAME"); - descr = snd_device_name_get_hint(*n, "DESC"); - io = snd_device_name_get_hint(*n, "IOID"); - if((name != NULL) && (descr != NULL) && ((io == NULL) || (io == filter))) { - QString deviceName = QLatin1String(name); - QString deviceDescription = QLatin1String(descr); - allDevices.append(deviceName.toLocal8Bit().constData()); - if(deviceDescription.contains(QLatin1String("Default Audio Device"))) - devices.append(deviceName.toLocal8Bit().constData()); - } - if(name != NULL) + if (name != 0 && qstrcmp(name, "null") != 0) { + descr = snd_device_name_get_hint(*n, "DESC"); + io = snd_device_name_get_hint(*n, "IOID"); + + if ((descr != NULL) && ((io == NULL) || (io == filter))) { + QString deviceName = QLatin1String(name); + QString deviceDescription = QLatin1String(descr); + allDevices.append(deviceName.toLocal8Bit().constData()); + if (deviceDescription.contains(QLatin1String("Default Audio Device"))) + devices.append(deviceName.toLocal8Bit().constData()); + } + free(name); - if(descr != NULL) - free(descr); - if(io != NULL) - free(io); + if (descr != NULL) + free(descr); + if (io != NULL) + free(io); + } ++n; } snd_device_name_free_hint(hints); -- cgit v0.12 From 12f129eb1e1472e5eec561ab780ed709e5b66987 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 12 Aug 2010 17:29:29 +0200 Subject: QNAM HTTP: Fix crash related to aborted uploads Task-number: QTBUG-12285 --- src/network/access/qhttpnetworkconnection.cpp | 2 ++ src/network/access/qhttpnetworkconnectionchannel.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index def4c34..5de199e 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -651,6 +651,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // is the reply associated the currently processing of this channel? if (channels[i].reply == reply) { channels[i].reply = 0; + channels[i].request = QHttpNetworkRequest(); + channels[i].resendCurrent = false; if (!reply->isFinished() && !channels[i].alreadyPipelinedRequests.isEmpty()) { // the reply had to be prematurely removed, e.g. it was not finished diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 6a13669..ddc5d05 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -644,8 +644,10 @@ void QHttpNetworkConnectionChannel::allDone() // finished request. // Note that this may trigger a segfault at some other point. But then we can fix the underlying // problem. - if (!resendCurrent) + if (!resendCurrent) { + request = QHttpNetworkRequest(); reply = 0; + } // move next from pipeline to current request if (!alreadyPipelinedRequests.isEmpty()) { -- cgit v0.12 From 6155050f68cc86c445552da61a5f240c16f5e2cd Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 13 Aug 2010 10:50:31 +1000 Subject: Don't define highp/mediump/lowp if desktop GL has them OpenGL 4.0 systems now have compatibility with ES2, including support for the precision qualifiers. If the GL_ARB_ES2_compatibility extension is present, then we don't define highp/mediump/lowp to the empty string. Task-number: QTBUG-12862 Reviewed-by: Sarah Smith --- dist/changes-4.6.4 | 5 +++-- src/opengl/qgl.cpp | 3 +++ src/opengl/qgl_p.h | 3 ++- src/opengl/qglshaderprogram.cpp | 10 ++++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index 381023f..ab59dc5 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -63,8 +63,9 @@ QtNetwork QtOpenGL -------- - - foo - * bar + - QGLShaderProgram + * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL + implementation has the GL_ARB_ES2_compatibility extension. QtScript -------- diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0521bab..0137c85 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4923,6 +4923,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= FragmentProgram; if (extensions.match("GL_ARB_fragment_shader")) glExtensions |= FragmentShader; + if (extensions.match("GL_ARB_ES2_compatibility")) + glExtensions |= ES2Compatibility; if (extensions.match("GL_ARB_texture_mirrored_repeat")) glExtensions |= MirroredRepeat; if (extensions.match("GL_EXT_framebuffer_object")) @@ -4941,6 +4943,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= FramebufferObject; glExtensions |= GenerateMipmap; glExtensions |= FragmentShader; + glExtensions |= ES2Compatibility; #endif #if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) if (extensions.match("GL_OES_framebuffer_object")) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 4facb65..1603ca1 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -291,7 +291,8 @@ public: DDSTextureCompression = 0x00008000, ETC1TextureCompression = 0x00010000, PVRTCTextureCompression = 0x00020000, - FragmentShader = 0x00040000 + FragmentShader = 0x00040000, + ES2Compatibility = 0x00080000 }; Q_DECLARE_FLAGS(Extensions, Extension) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index edbb635..9bfe027 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -97,6 +97,10 @@ QT_BEGIN_NAMESPACE to just features that are present in GLSL/ES, and avoid standard variable names that only work on the desktop. + If the \c{GL_ARB_ES2_compatibility} extension is present, + then the above prefix is not added because the desktop OpenGL + implementation supports precision qualifiers. + \section1 Simple shader example \snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 1 @@ -390,8 +394,10 @@ bool QGLShader::compileSourceCode(const char *source) srclen.append(GLint(headerLen)); } #ifdef QGL_DEFINE_QUALIFIERS - src.append(qualifierDefines); - srclen.append(GLint(sizeof(qualifierDefines) - 1)); + if (!(QGLExtensions::glExtensions() & QGLExtensions::ES2Compatibility)) { + src.append(qualifierDefines); + srclen.append(GLint(sizeof(qualifierDefines) - 1)); + } #endif #ifdef QGL_REDEFINE_HIGHP if (d->shaderType == Fragment) { -- cgit v0.12 From 36a98407ce53e2d7ae6f1ef3b65794b113ae1606 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 13 Aug 2010 11:25:55 +1000 Subject: Update changes-4.6.4 with recent shader program changes --- dist/changes-4.6.4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index ab59dc5..dbb2189 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -64,6 +64,8 @@ QtOpenGL -------- - QGLShaderProgram + * [QTBUG-12478] Don't resolve GLSL extensions if no shaders. + * [QTBUG-12591] setUniformValue(QSize) was setting (w,w) not (w,h). * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL implementation has the GL_ARB_ES2_compatibility extension. -- cgit v0.12 From 0a94e2af3c29afa6e8d7ae3041bed4f187b3c1ca Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 16 Aug 2010 12:19:06 +1000 Subject: Fix OpenGLVersionFlags on OpenGL 4.0 systems If the OpenGL version was 4.0 or higher, the flags for 1.1, 1.5, 2.0, and so on were not being set. This lead to the flags indicating that older OpenGL versions were not supported when they clearly were. Back port parts of 28659c21d12a267b10e5b441bf4c776e04d69bdc from Qt 4.7 to fix this in Qt 4.6. Task-number: QTBUG-12554 Reviewed-by: Sarah Smith --- dist/changes-4.6.4 | 1 + src/opengl/qgl.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index dbb2189..389aa3a 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -68,6 +68,7 @@ QtOpenGL * [QTBUG-12591] setUniformValue(QSize) was setting (w,w) not (w,h). * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL implementation has the GL_ARB_ES2_compatibility extension. + * [QTBUG-12554] Wrong OpenGLVersionFlags on OpenGL 4.0 systems. QtScript -------- diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0137c85..81e55b3 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1173,8 +1173,16 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co QGLFormat::OpenGL_Version_2_1 | QGLFormat::OpenGL_Version_3_0; } - else - qWarning("Unrecognised OpenGL version"); + else { + versionFlags |= QGLFormat::OpenGL_Version_1_1 | + QGLFormat::OpenGL_Version_1_2 | + QGLFormat::OpenGL_Version_1_3 | + QGLFormat::OpenGL_Version_1_4 | + QGLFormat::OpenGL_Version_1_5 | + QGLFormat::OpenGL_Version_2_0 | + QGLFormat::OpenGL_Version_2_1 | + QGLFormat::OpenGL_Version_3_0; + } } return versionFlags; } -- cgit v0.12 From f087ad801b19ffa32a538269cd1475ead963f013 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 17 Aug 2010 16:00:17 +0200 Subject: qmake: fix assertion on Windows when DESTDIR is empty in static libs Basically replacing project->values("foo").first() with project->first("foo") which does a null check. Task-number: QTBUG-12851 Reviewed-by: ossi --- qmake/generators/win32/winmakefile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index c36cc9c..4944d06 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -472,10 +472,13 @@ void Win32MakefileGenerator::processRcFileVar() resFile.replace(".rc", Option::res_ext); project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); if (!project->values("OBJECTS_DIR").isEmpty()) { - if(project->isActiveConfig("staticlib")) - project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep); + QString resDestDir; + if (project->isActiveConfig("staticlib")) + resDestDir = fileInfo(project->first("DESTDIR")).absoluteFilePath(); else - project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep); + resDestDir = project->first("OBJECTS_DIR"); + resDestDir.append(Option::dir_sep); + project->values("RES_FILE").first().prepend(resDestDir); } project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false); project->values("POST_TARGETDEPS") += project->values("RES_FILE"); -- cgit v0.12 From aa664a9d193f450134540ef285a0e1ac755984e8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 18 Aug 2010 14:05:55 +0200 Subject: fix epic fail from 4ba6646 Reviewed-by: ossi --- bin/syncqt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/syncqt b/bin/syncqt index d665e87..cee5398 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -961,7 +961,7 @@ if($check_includes) { my $lib = $_; my $dir = "$modules{$lib}"; { - my $current_dir = "$_"; + my $current_dir = $dir; #calc subdirs my @subdirs = ($current_dir); foreach (@subdirs) { -- cgit v0.12 From 0f8498584fe3f3c5e200076c0a3b7fbe33db4b52 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 20 Aug 2010 17:04:23 +0200 Subject: fix shadow build of configure.exe Reviewed-by: ossi --- tools/configure/configure.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/configure/configure.pro b/tools/configure/configure.pro index 91de7c2..ab4b155 100644 --- a/tools/configure/configure.pro +++ b/tools/configure/configure.pro @@ -27,7 +27,7 @@ INCPATH += $$QT_SOURCE_TREE/src/corelib/arch/generic \ $$QT_SOURCE_TREE/src/corelib/global \ $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ - $$QT_BUILD_TREE/tools/shared + $$QT_SOURCE_TREE/tools/shared HEADERS = configureapp.h environment.h tools.h\ $$QT_SOURCE_TREE/src/corelib/tools/qbytearray.h \ -- cgit v0.12 From 8c47746c8da6d9d431e69fb2a828e151c36318d0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 20 Aug 2010 17:05:01 +0200 Subject: fix Norwegian Breakfast Network warnings in configure Reviewed-by: ossi --- tools/configure/configureapp.cpp | 16 ++++++++-------- tools/configure/environment.cpp | 7 +++---- tools/configure/tools.cpp | 10 +++++----- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b35f454..5de4f27 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -313,7 +313,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENVG" ] = "no"; - dictionary[ "IPV6" ] = "yes"; // Always, dynamicly loaded + dictionary[ "IPV6" ] = "yes"; // Always, dynamically loaded dictionary[ "OPENSSL" ] = "auto"; dictionary[ "DBUS" ] = "auto"; dictionary[ "S60" ] = "yes"; @@ -2094,7 +2094,7 @@ bool Configure::checkAvailability(const QString &part) available = (paths.size() == 0); if (!available) { - if (epocRoot.isNull() || epocRoot == "") + if (epocRoot.isEmpty()) epocRoot = ""; cout << endl << "The QtMultimedia audio backend will not be built because required" << endl @@ -2625,7 +2625,7 @@ void Configure::generateOutputVars() QString set_config = dictionary["QCONFIG"]; if (possible_configs.contains(set_config)) { - foreach(QString cfg, possible_configs) { + foreach (const QString &cfg, possible_configs) { qtConfig += (cfg + "-config"); if (cfg == set_config) break; @@ -2736,7 +2736,7 @@ void Configure::generateCachefile() QStringList buildParts; buildParts << "libs" << "tools" << "examples" << "demos" << "docs" << "translations"; - foreach(QString item, disabledBuildParts) { + foreach (const QString &item, disabledBuildParts) { buildParts.removeAll(item); } cacheStream << "QT_BUILD_PARTS = " << buildParts.join( " " ) << endl; @@ -3041,7 +3041,7 @@ void Configure::generateConfigfiles() QStringList kbdDrivers = dictionary["KBD_DRIVERS"].split(" ");; QStringList allKbdDrivers; allKbdDrivers<<"tty"<<"usb"<<"sl5000"<<"yopy"<<"vr41xx"<<"qvfb"<<"um"; - foreach(QString kbd, allKbdDrivers) { + foreach (const QString &kbd, allKbdDrivers) { if( !kbdDrivers.contains(kbd)) tmpStream<<"#define QT_NO_QWS_KBD_"< &dictionary, QMap &dictionary, QMap &dictionary, QMap &dictionary, QMap Date: Mon, 23 Aug 2010 16:49:08 +0200 Subject: QNAM HTTP: Prepare a compression auto test related to a future bugfix Task-number: QTBUG-12908 --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index ca563ef..2ff02d4 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -281,6 +281,8 @@ private Q_SLOTS: void symbianOpenCDataUrlCrash(); + void qtbug12908compressedHttpReply(); + // NOTE: This test must be last! void parentingRepliesToTheApp(); }; @@ -4171,6 +4173,30 @@ void tst_QNetworkReply::symbianOpenCDataUrlCrash() QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(598)); } +// TODO: +// Prepare a gzip that has one chunk that expands to the size mentioned in the bugreport. +// Then have a custom HTTP server that waits after this chunk so the returning gets +// triggered. +void tst_QNetworkReply::qtbug12908compressedHttpReply() +{ + QString header("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: 63\r\n\r\n"); + + // dd if=/dev/zero of=qtbug-12908 bs=16384 count=1 && gzip qtbug-12908 && base64 -w 0 qtbug-12908.gz + QString encodedFile("H4sICDdDaUwAA3F0YnVnLTEyOTA4AO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA"); + QByteArray decodedFile = QByteArray::fromBase64(encodedFile.toAscii()); + + MiniHttpServer server(header.toAscii() + decodedFile); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(reply->error(), QNetworkReply::NoError); +} // NOTE: This test must be last testcase in tst_qnetworkreply! -- cgit v0.12 From 67ddb9cca2b638b1cf71eb98e906260b83a38677 Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Tue, 24 Aug 2010 15:15:29 +1000 Subject: Fix the broken unicode detection of ODBC driver. the unicode flag is entirely overrided by mistake. Task-number:QTBUG-13109 Reviewed-by:Michael Goddard --- src/sql/drivers/odbc/qsql_odbc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index f41a914..b06970c 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -2132,7 +2132,7 @@ void QODBCDriverPrivate::checkSqlServer() serverType = QString::fromUtf8((const char *)serverString.constData(), t); #endif isFreeTDSDriver = serverType.contains(QLatin1String("tdsodbc"), Qt::CaseInsensitive); - unicode = isFreeTDSDriver == false; + unicode = unicode && !isFreeTDSDriver; } } -- cgit v0.12 From 3c2dc7f652996d1f3b504b42d872734df2e9234f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 25 Aug 2010 10:53:06 +0200 Subject: WGL_COLOR_BITS_ARB should not take the alpha bits into account. The WGL_COLOR_BITS_ARB attribute is only supposed to specify the number of color bits in each buffer, *excluding* the alpha bits. Task-number: QTBUG-13141 Reviewed-by: Samuel --- src/opengl/qgl_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index ed4814f..55f224a 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -920,7 +920,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc) iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB; iAttributes[i++] = TRUE; iAttributes[i++] = WGL_COLOR_BITS_ARB; - iAttributes[i++] = 32; + iAttributes[i++] = 24; iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB; iAttributes[i++] = d->glFormat.doubleBuffer(); if (d->glFormat.stereo()) { -- cgit v0.12