From fea7c172500811c7ab69f25b8d317890712cf5e8 Mon Sep 17 00:00:00 2001 From: Jani Hyvonen Date: Tue, 22 Nov 2011 16:26:32 +0200 Subject: Fixing memory leak in QtGui qt_cleanup In qt_cleanup() the S60->setButtonGroupContainer(0) - which sets the QS60Data::cba to zero - is called before calling delete S60->buttonGroupContainer(). Because of this the currently set QS60Data::cba gets never deleted. A call S60->setButtonGroupContainer(0) which sets the QS60Data::cba pointer to zero is now called after calling the delete S60->buttonGroupContainer(). Task-number: QTBUG-22741 Reviewed-by: Murray Read --- src/gui/kernel/qapplication_s60.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index bb84491..ca9c3a3 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -2069,9 +2069,6 @@ extern void qt_cleanup_symbianFontDatabase(); // qfontdatabase_s60.cpp *****************************************************************************/ void qt_cleanup() { -#ifdef Q_WS_S60 - S60->setButtonGroupContainer(0); -#endif if(qt_S60Beep) { delete qt_S60Beep; qt_S60Beep = 0; -- cgit v0.12 From b233fb15f66b7c9e7bff782aa05e543eb45e52e7 Mon Sep 17 00:00:00 2001 From: Satyam Bandarapu Date: Fri, 25 Nov 2011 00:25:38 +0200 Subject: New API to set AVKON flag to inputcontext in Qt/Symbian. This API is to pass any AVKON FEP flag to QCoeFepInputContext. Implemented as an exported private API, which is available only in Qt/Symbian. If latin keyboard flag is passed to this API and editor is Email/Url, virtual keyboard launches always with latin characters regardless of input language. Reviewed by: Sami Merila --- src/gui/inputmethod/qcoefepinputcontext_p.h | 1 + src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 10 ++++++++++ src/gui/kernel/qt_s60_p.h | 4 +++- src/s60installs/bwins/QtGuiu.def | 1 + src/s60installs/eabi/QtGuiu.def | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index b17d9c7..d9d577a 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -225,6 +225,7 @@ private: Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable); Q_GUI_EXPORT void qt_s60_setPartialScreenAutomaticTranslation(bool enable); +Q_GUI_EXPORT void qt_s60_setEditorFlags(int flags); QT_END_NAMESPACE diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 44e0df0..3bcac62 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -367,6 +367,11 @@ Q_GUI_EXPORT void qt_s60_setPartialScreenAutomaticTranslation(bool enable) S60->partial_keyboardAutoTranslation = enable; } +Q_GUI_EXPORT void qt_s60_setEditorFlags(int flags) +{ + S60->editorFlags |= flags; +} + QCoeFepInputContext::QCoeFepInputContext(QObject *parent) : QInputContext(parent), m_fepState(q_check_ptr(new CAknEdwinState)), // CBase derived object needs check on new @@ -1160,6 +1165,11 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) if (hints & ImhNoPredictiveText || hints & ImhHiddenText) { flags |= EAknEditorFlagNoT9; } + + if ((hints & (ImhEmailCharactersOnly | ImhUrlCharactersOnly)) && (S60->editorFlags & EAknEditorFlagLatinInputModesOnly)){ + flags |= EAknEditorFlagLatinInputModesOnly; + } + if (needsCharMap) flags |= EAknEditorFlagUseSCTNumericCharmap; m_fepState->SetFlags(flags); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 5b5d5ce..c75b20e 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -230,6 +230,7 @@ public: int beginFullScreenCalled : 1; int endFullScreenCalled : 1; + int editorFlags; }; Q_AUTOTEST_EXPORT QS60Data* qGlobalS60Data(); @@ -390,7 +391,8 @@ inline QS60Data::QS60Data() ,s60InstalledTrapHandler(0) #endif ,beginFullScreenCalled(0), - endFullScreenCalled(0) + endFullScreenCalled(0), + editorFlags(0) { } diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index cf6b0da..375f3a2 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -13990,3 +13990,4 @@ EXPORTS ?resetFontEngineCache@QTextEngine@@QAEXXZ @ 13989 NONAME ; void QTextEngine::resetFontEngineCache(void) ?symbianHandleLiteModeStartup@QApplicationPrivate@@QAEXXZ @ 13990 NONAME ; void QApplicationPrivate::symbianHandleLiteModeStartup(void) ?_q_cleanupWinIds@QWidgetPrivate@@QAEXXZ @ 13991 NONAME ; void QWidgetPrivate::_q_cleanupWinIds(void) + ?qt_s60_setEditorFlags@@YAXH@Z @ 13992 NONAME ; void qt_s60_setEditorFlags(int) diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index f667bab..07f0929 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12803,3 +12803,4 @@ EXPORTS _ZN11QTextEngine20resetFontEngineCacheEv @ 12802 NONAME _ZN14QWidgetPrivate16_q_cleanupWinIdsEv @ 12803 NONAME _ZN19QApplicationPrivate28symbianHandleLiteModeStartupEv @ 12804 NONAME + _Z21qt_s60_setEditorFlagsi @ 12805 NONAME -- cgit v0.12 From e4bdb5d8144f62d803f1d904275db91c155d3561 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 24 Nov 2011 13:15:18 +0100 Subject: SSL: fix build when compiled with -openssl-linked ... and only resolve the functions when the methods are available. SSL 2 functionality is not always available in OpenSSL anymore. Change-Id: Ia3178685b26c67ac55447476789e06710b596181 Reviewed-by: Richard J. Moore Reviewed-by: Shane Kearns (cherry picked from commit 09404c072fec2e195d8114dc4d95ce3683c341cf) --- src/network/ssl/qsslsocket_openssl.cpp | 4 ++++ src/network/ssl/qsslsocket_openssl_symbols.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 5f520f7..872b19c 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -254,7 +254,11 @@ bool QSslSocketBackendPrivate::initSslContext() init_context: switch (configuration.protocol) { case QSsl::SslV2: +#ifndef OPENSSL_NO_SSL2 ctx = q_SSL_CTX_new(client ? q_SSLv2_client_method() : q_SSLv2_server_method()); +#else + ctx = 0; // SSL 2 not supported by the system, but chosen deliberately -> error +#endif break; case QSsl::SslV3: ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method()); diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 90a840f..51ecf5d 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -222,11 +222,15 @@ DEFINEFUNC(void, SSL_set_accept_state, SSL *a, a, return, DUMMYARG) DEFINEFUNC(void, SSL_set_connect_state, SSL *a, a, return, DUMMYARG) DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, return) #if OPENSSL_VERSION_NUMBER >= 0x10000000L +#ifndef OPENSSL_NO_SSL2 DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return) +#endif DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return) +#ifndef OPENSSL_NO_SSL2 DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return) +#endif DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return) @@ -741,11 +745,15 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(SSL_set_connect_state) RESOLVEFUNC(SSL_shutdown) RESOLVEFUNC(SSL_write) +#ifndef OPENSSL_NO_SSL2 RESOLVEFUNC(SSLv2_client_method) +#endif RESOLVEFUNC(SSLv3_client_method) RESOLVEFUNC(SSLv23_client_method) RESOLVEFUNC(TLSv1_client_method) +#ifndef OPENSSL_NO_SSL2 RESOLVEFUNC(SSLv2_server_method) +#endif RESOLVEFUNC(SSLv3_server_method) RESOLVEFUNC(SSLv23_server_method) RESOLVEFUNC(TLSv1_server_method) -- cgit v0.12