From 4620b0fc7a48c643400a42eb9e9cc0a82ad0be9a Mon Sep 17 00:00:00 2001 From: Robin Helgelin Date: Wed, 21 Apr 2010 12:14:02 +0200 Subject: Keep support for maximum pending connections in derived QTcpServer By adding a new function to the class QTcpServer it's now possible to extend QTcpserver functionality with for instance SSL capabilities and still keep the support for maximum pending connections. Task-number: QTBUG-1875 Reviewed-by: Peter Hartmann Reviewed-by: Markus Goetz Merge-Request: 568 --- src/network/socket/qtcpserver.cpp | 15 +++++++++++++++ src/network/socket/qtcpserver.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index 932126d..a259eee 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -572,6 +572,21 @@ void QTcpServer::incomingConnection(int socketDescriptor) QTcpSocket *socket = new QTcpSocket(this); socket->setSocketDescriptor(socketDescriptor); + addPendingConnection(socket); +} + +/*! + This function is called by QTcpServer::incomingConnection() + to add a socket to the list of pending incoming connections. + + \note Don't forget to call this member from reimplemented + incomingConnection() if you do not want to break the + Pending Connections mechanism. + + \sa incomingConnection() +*/ +void QTcpServer::addPendingConnection(QTcpSocket* socket) +{ d_func()->pendingConnections.append(socket); } diff --git a/src/network/socket/qtcpserver.h b/src/network/socket/qtcpserver.h index 7aebffe..b206678 100644 --- a/src/network/socket/qtcpserver.h +++ b/src/network/socket/qtcpserver.h @@ -93,6 +93,7 @@ public: protected: virtual void incomingConnection(int handle); + void addPendingConnection(QTcpSocket* socket); Q_SIGNALS: void newConnection(); -- cgit v0.12 From efb26a325dcea5e60d7801fef00e650bd028c16d Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 6 May 2010 09:57:19 +0200 Subject: QTcpServer: Fix documentation for previous commit --- src/network/socket/qtcpserver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index a259eee..55f926d 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -562,7 +562,7 @@ QTcpSocket *QTcpServer::nextPendingConnection() to the other thread and create the QTcpSocket object there and use its setSocketDescriptor() method. - \sa newConnection(), nextPendingConnection() + \sa newConnection(), nextPendingConnection(), addPendingConnection() */ void QTcpServer::incomingConnection(int socketDescriptor) { @@ -584,6 +584,7 @@ void QTcpServer::incomingConnection(int socketDescriptor) Pending Connections mechanism. \sa incomingConnection() + \since 4.7 */ void QTcpServer::addPendingConnection(QTcpSocket* socket) { -- cgit v0.12 From ae786d63683db1aea1a4ad7eea2c4e20d5c1752d Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Tue, 4 May 2010 16:03:27 +0200 Subject: isOnActiveSpace is available from 10.6. The fix for qtcreatorbug-827 included a call to isOnActiveSpace, which is only available from 10.6 so this patch adds a runtime check for it. Since it is a runtime check there is no need for multiple builds. Notice that the fix for qtcreatorbug-827 will work only on 10.6+ Task-number: QTCREATORBUG-827 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwidget_mac.mm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 81dd746..f12c956 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3835,13 +3835,20 @@ void QWidgetPrivate::raise_sys() // required we will introduce special handling for some of them. if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) { OSWindowRef window = qt_mac_window_for(q); - if(![window isOnActiveSpace]) { - QWidget *parentWidget = q->parentWidget(); - if(parentWidget) { - OSWindowRef parentWindow = qt_mac_window_for(parentWidget); - if(parentWindow && [parentWindow isOnActiveSpace]) { - recreateMacWindow(); - window = qt_mac_window_for(q); + // isOnActiveSpace is available only from 10.6 onwards, so we need to check if it is + // available before calling it. + if([window respondsToSelector:@selector(isOnActiveSpace)]) { + if(![window performSelector:@selector(isOnActiveSpace)]) { + QWidget *parentWidget = q->parentWidget(); + if(parentWidget) { + OSWindowRef parentWindow = qt_mac_window_for(parentWidget); + if(parentWindow && [parentWindow isOnActiveSpace]) { + // The window was created in a different space. Therefore if we want + // to show it in the current space we need to recreate it in the new + // space. + recreateMacWindow(); + window = qt_mac_window_for(q); + } } } } -- cgit v0.12 From fdee454d73c2a1c255e8315d35df663ab726e4db Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 14:08:07 +0200 Subject: cosmetics: change enum value the existing values are fixed-point representations of the msvc versions, so adhere to it. --- qmake/generators/win32/msvc_objectmodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 3f60a13..97f8570 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -59,7 +59,7 @@ enum DotNET { NET2003 = 0x71, NET2005 = 0x80, NET2008 = 0x90, - NET2010 = 0x91 + NET2010 = 0xa0 }; /* -- cgit v0.12 From 1c79ac10db1cf2b413ea3872641faec134664b8e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 14:08:46 +0200 Subject: remove extraneous return statement --- qmake/generators/win32/msvc_vcxproj.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index da93fe3..05c1511 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -89,7 +89,6 @@ bool VcxprojGenerator::writeMakefile(QTextStream &t) return true; } return project->isActiveConfig("build_pass"); - return true; } -- cgit v0.12 From 106d8714fa9e09ef7e71c71c02a226c9a91d09f2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 May 2010 14:09:34 +0200 Subject: fix qmake project file following msvc2010 addition this is relevant only for maintainers, but still. --- qmake/qmake.pri | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 0163839..6e0f8a2 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -13,7 +13,8 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ generators/xmloutput.cpp generators/win32/borland_bmake.cpp \ generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \ generators/win32/msvc_vcproj.cpp \ - generators/win32/msvc_objectmodel.cpp \ + generators/win32/msvc_vcxproj.cpp \ + generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp \ generators/symbian/symbiancommon.cpp \ generators/symbian/symmake.cpp \ generators/symbian/symmake_abld.cpp \ @@ -24,11 +25,12 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \ HEADERS += project.h property.h generators/makefile.h \ generators/unix/unixmake.h meta.h option.h cachekeys.h \ - generators/win32/winmakefile.h generators/projectgenerator.h \ + generators/win32/winmakefile.h generators/win32/mingw_make.h generators/projectgenerator.h \ generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \ generators/xmloutput.h generators/win32/borland_bmake.h generators/win32/msvc_nmake.h \ generators/win32/msvc_vcproj.h \ - generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h \ + generators/win32/msvc_vcxproj.h \ + generators/win32/msvc_objectmodel.h generators/win32/msbuild_objectmodel.h \ generators/symbian/symbiancommon.h \ generators/symbian/symmake.h \ generators/symbian/symmake_abld.h \ -- cgit v0.12 From 86260a117c9ce64d3dee71ab241559c0529f2ef5 Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Thu, 6 May 2010 14:11:32 +0200 Subject: Fix syntax error in configure script ./configure: line 5883: [: missing `]' ./configure: line 5883: no: command not found It's either if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then or if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then but not if [ "$CFG_OPENGL" = "es1" || "$CFG_OPENGL" = "es2" ]; then Merge-request: 616 Reviewed-by: Oswald Buddenhagen --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 47eec92..3ed017d 100755 --- a/configure +++ b/configure @@ -5880,7 +5880,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then fi CFG_EGL=no # If QtOpenGL would be built against OpenGL ES, disable it as we can't to that if EGL is missing - if [ "$CFG_OPENGL" = "es1" || "$CFG_OPENGL" = "es2" ]; then + if [ "$CFG_OPENGL" = "es1" -o "$CFG_OPENGL" = "es2" ]; then CFG_OPENGL=no fi fi -- cgit v0.12