diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/accessible/widgets/qaccessiblemenu.cpp | 79 | ||||
-rw-r--r-- | src/plugins/accessible/widgets/qaccessiblemenu.h | 14 | ||||
-rw-r--r-- | src/plugins/bearer/corewlan/corewlan.pro | 3 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.cpp | 3 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/symbianengine.cpp | 88 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/symbianengine.h | 1 | ||||
-rw-r--r-- | src/plugins/generic/tslib/tslib.pro | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/eglconvenience/qeglplatformcontext.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xlib/qxlibwindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/sqldrivers/symsql/main.cpp | 81 | ||||
-rw-r--r-- | src/plugins/sqldrivers/symsql/symsql.pro | 13 |
13 files changed, 275 insertions, 20 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp index 1454c7c..e9e5ca8 100644 --- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp +++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp @@ -93,7 +93,7 @@ int QAccessibleMenu::childAt(int x, int y) const QString QAccessibleMenu::text(Text t, int child) const { QString tx = QAccessibleWidgetEx::text(t, child); - if (tx.size()) + if (!child && tx.size()) return tx; switch (t) { @@ -433,6 +433,8 @@ QString QAccessibleMenuItem::actionText(int action, Text text, int child ) const switch (action) { case Press: case DefaultAction: + if (m_action->menu()) + return QMenu::tr("Open"); return QMenu::tr("Execute"); break; default: @@ -444,11 +446,41 @@ QString QAccessibleMenuItem::actionText(int action, Text text, int child ) const bool QAccessibleMenuItem::doAction(int action, int child, const QVariantList & /*params = QVariantList()*/ ) { - if ((action == Press || action == DefaultAction) && child == 0) { - m_action->trigger(); - return true; + if ((child) || ((action != DefaultAction) && (action != Press))) + return false; + + // if the action has a menu, expand/hide it + if (m_action->menu()) { + if (m_action->menu()->isVisible()) { + m_action->menu()->hide(); + return true; + } else { + if (QMenuBar *bar = qobject_cast<QMenuBar*>(owner())) { + bar->setActiveAction(m_action); + return true; + } else if (QMenu *menu = qobject_cast<QMenu*>(owner())){ + menu->setActiveAction(m_action); + return true; + } + } } - return false; + // no menu + m_action->trigger(); + return true; +} + +// action interface +int QAccessibleMenuItem::actionCount() +{ + return 1; +} + +void QAccessibleMenuItem::doAction(int actionIndex) +{ + if (actionIndex) + return; + + doAction(DefaultAction, 0); } int QAccessibleMenuItem::indexOfChild( const QAccessibleInterface * child ) const @@ -618,7 +650,7 @@ QAccessible::State QAccessibleMenuItem::state(int child ) const delete iface; } } - return s; + return s | HasInvokeExtension;; } QString QAccessibleMenuItem::text ( Text t, int child ) const @@ -654,17 +686,50 @@ QString QAccessibleMenuItem::text ( Text t, int child ) const return str; } +// action interface int QAccessibleMenuItem::userActionCount ( int /*child*/ ) const { return 0; } - QAction *QAccessibleMenuItem::action() const { return m_action; } +QString QAccessibleMenuItem::description(int) +{ + return text(QAccessible::Description, 0); +} + +QString QAccessibleMenuItem::name(int) +{ + return actionText(DefaultAction, QAccessible::Name, 0); +} + +QString QAccessibleMenuItem::localizedName(int) +{ + return text(QAccessible::Name, 0); +} + +QStringList QAccessibleMenuItem::keyBindings(int) +{ + QStringList keys; +#ifndef QT_NO_SHORTCUT + QKeySequence key = m_action->shortcut(); + if (!key.isEmpty()) { + keys.append(key.toString()); + } +#endif + return keys; +} + + +QVariant QAccessibleMenuItem::invokeMethodEx(Method, int, const QVariantList &) +{ + return QVariant(); +} + QWidget *QAccessibleMenuItem::owner() const { return m_owner; diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.h b/src/plugins/accessible/widgets/qaccessiblemenu.h index 680594d..47f42cb 100644 --- a/src/plugins/accessible/widgets/qaccessiblemenu.h +++ b/src/plugins/accessible/widgets/qaccessiblemenu.h @@ -43,6 +43,7 @@ #define QACCESSIBLEMENU_H #include <QtGui/qaccessiblewidget.h> +#include <QtGui/qaccessible2.h> QT_BEGIN_NAMESPACE @@ -101,8 +102,9 @@ protected: -class QAccessibleMenuItem : public QAccessibleInterface +class QAccessibleMenuItem : public QAccessibleActionInterface, public QAccessibleInterfaceEx { + Q_ACCESSIBLE_OBJECT public: explicit QAccessibleMenuItem(QWidget *owner, QAction *w); @@ -123,9 +125,17 @@ public: virtual QString text ( Text t, int child ) const; virtual int userActionCount ( int child ) const; - QWidget *owner() const; + // action interface + virtual int actionCount(); + virtual void doAction(int actionIndex); + virtual QString description(int); + virtual QString name(int); + virtual QString localizedName(int); + virtual QStringList keyBindings(int); + virtual QVariant invokeMethodEx(Method, int, const QVariantList &); + QWidget *owner() const; protected: QAction *action() const; private: diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index 90078e9..590a85b 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -5,9 +5,8 @@ QT = core network LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { - isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") { + isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk") { LIBS += -framework CoreWLAN -framework Security - DEFINES += MAC_SDK_10_6 } } diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index fc65b86..a7dad2b 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -1377,6 +1377,9 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne newState(QNetworkSession::Closing,accessPointId); break; + // Connection stopped + case KConfigDaemonFinishedDeregistrationStop: //this comes if this is the last session, instead of KLinkLayerClosed + case KConfigDaemonFinishedDeregistrationPreserve: // Connection closed case KConnectionClosed: case KLinkLayerClosed: diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index fc2791a..ee80297 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -329,7 +329,27 @@ void SymbianEngine::updateConfigurationsL() cpPriv->connectionId = 0; cpPriv->state = QNetworkConfiguration::Defined; cpPriv->type = QNetworkConfiguration::ServiceNetwork; - cpPriv->purpose = QNetworkConfiguration::UnknownPurpose; + + // determine purpose of this SNAP + TUint32 purpose = CMManager::ESnapPurposeUnknown; + TRAP_IGNORE(purpose = destination.MetadataL(CMManager::ESnapMetadataPurpose)); + switch (purpose) { + case CMManager::ESnapPurposeInternet: + cpPriv->purpose = QNetworkConfiguration::PublicPurpose; + break; + case CMManager::ESnapPurposeIntranet: + cpPriv->purpose = QNetworkConfiguration::PrivatePurpose; + break; + case CMManager::ESnapPurposeMMS: + case CMManager::ESnapPurposeOperator: + cpPriv->purpose = QNetworkConfiguration::ServiceSpecificPurpose; + break; + case CMManager::ESnapPurposeUnknown: + default: + cpPriv->purpose = QNetworkConfiguration::UnknownPurpose; + break; + } + cpPriv->roamingSupported = false; QNetworkConfigurationPrivatePointer ptr(cpPriv); @@ -482,9 +502,39 @@ void SymbianEngine::updateConfigurationsL() #ifdef SNAP_FUNCTIONALITY_AVAILABLE updateStatesToSnaps(); + updatePurposeToIaps(); #endif } +//copy purpose from SNAP to child IAPs, unless child is contained in more than one SNAP with conflicting purposes. +void SymbianEngine::updatePurposeToIaps() +{ + QMutexLocker lock(&mutex); + QHash<QString,int> purposes; + foreach (QNetworkConfigurationPrivatePointer snap, snapConfigurations.values()) { + QMutexLocker snaplock(&snap->mutex); + foreach (QNetworkConfigurationPrivatePointer iap, snap->serviceNetworkMembers.values()) { + QMutexLocker iaplock(&iap->mutex); + QString id = iap->id; + if (purposes.contains(id) && purposes.value(id) != snap->purpose) + purposes[id] = -1; //conflict detected + else + purposes[id] = snap->purpose; + } + } + + for (QHash<QString,int>::const_iterator it = purposes.constBegin(); it != purposes.constEnd(); ++it) { + if (accessPointConfigurations.contains(it.key())) { + QNetworkConfigurationPrivatePointer iap = accessPointConfigurations.value(it.key()); + QMutexLocker iaplock(&iap->mutex); + int purpose = it.value(); + if (purpose == -1) //resolve conflicts as unknown + purpose = QNetworkConfiguration::UnknownPurpose; + iap->purpose = (QNetworkConfiguration::Purpose)purpose; + } + } +} + #ifdef SNAP_FUNCTIONALITY_AVAILABLE SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL( RCmConnectionMethod& connectionMethod) @@ -505,8 +555,33 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL( cpPriv->bearerType = QNetworkConfiguration::Bearer2G; break; case KCommDbBearerWcdma: - cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; - break; + { + //This is ambiguous, check the network status to find out what the expected connection will be + TUint mode; + TRequestStatus status; + iConnectionMonitor.GetUintAttribute(0, 0, KMobilePhoneNetworkMode, mode, status); + User::WaitForRequest(status); + if (status != KErrNone) + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; + else switch (mode) { + case EConnMonNetworkModeCdma2000: + cpPriv->bearerType = QNetworkConfiguration::BearerCDMA2000; + break; + case EConnMonNetworkModeWcdma: + case EConnMonNetworkModeTdcdma: + cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; //includes HSDPA, as this API can't detect it + break; + case EConnMonNetworkModeGsm: + case EConnMonNetworkModeAmps: + case EConnMonNetworkModeCdma95: + cpPriv->bearerType = QNetworkConfiguration::Bearer2G; //includes GPRS and EDGE, Qt API treats them both as 2G + break; + default: + cpPriv->bearerType = QNetworkConfiguration::BearerUnknown; + break; + } + break; + } case KCommDbBearerLAN: cpPriv->bearerType = QNetworkConfiguration::BearerEthernet; break; @@ -1122,6 +1197,13 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent) } ); } + + //update bearer type for 2G/3G connections + TInt bearer; + iConnectionMonitor.GetIntAttribute(connectionId, 0, KBearerInfo, bearer, status); + User::WaitForRequest(status); + if (status == KErrNone) + updateMobileBearerToConfigs(TConnMonBearerInfo(bearer)); } else if (connectionStatus == KConfigDaemonStartingDeregistration) { TUint connectionId = realEvent->ConnectionId(); QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId); diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h index a205c97..b75f27e 100644 --- a/src/plugins/bearer/symbian/symbianengine.h +++ b/src/plugins/bearer/symbian/symbianengine.h @@ -155,6 +155,7 @@ public Q_SLOTS: private: void updateStatesToSnaps(); + void updatePurposeToIaps(); bool changeConfigurationStateTo(QNetworkConfigurationPrivatePointer ptr, QNetworkConfiguration::StateFlags newState); bool changeConfigurationStateAtMinTo(QNetworkConfigurationPrivatePointer ptr, diff --git a/src/plugins/generic/tslib/tslib.pro b/src/plugins/generic/tslib/tslib.pro index 74c7fd2..760fbae 100644 --- a/src/plugins/generic/tslib/tslib.pro +++ b/src/plugins/generic/tslib/tslib.pro @@ -1,4 +1,4 @@ -TARGET = qlinuxinputplugin +TARGET = qtslibplugin include(../../qpluginbase.pri) QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/generic diff --git a/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp b/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp index 4d1d63e..d733cd6 100644 --- a/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp +++ b/src/plugins/platforms/eglconvenience/qeglplatformcontext.cpp @@ -48,7 +48,7 @@ #include <EGL/egl.h> -QEGLPlatformContext::QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi) +QEGLPlatformContext::QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi, QEGLPlatformContext *shareContext) : QPlatformGLContext() , m_eglDisplay(display) , m_eglSurface(surface) @@ -59,7 +59,8 @@ QEGLPlatformContext::QEGLPlatformContext(EGLDisplay display, EGLConfig config, E } eglBindAPI(m_eglApi); - m_eglContext = eglCreateContext(m_eglDisplay,config, 0,contextAttrs); + EGLContext shareEglContext = shareContext ? shareContext->eglContext() : 0; + m_eglContext = eglCreateContext(m_eglDisplay,config, shareEglContext, contextAttrs); if (m_eglContext == EGL_NO_CONTEXT) { qWarning("Could not create the egl context\n"); eglTerminate(m_eglDisplay); diff --git a/src/plugins/platforms/eglconvenience/qeglplatformcontext.h b/src/plugins/platforms/eglconvenience/qeglplatformcontext.h index 9be1480..614b3cb 100644 --- a/src/plugins/platforms/eglconvenience/qeglplatformcontext.h +++ b/src/plugins/platforms/eglconvenience/qeglplatformcontext.h @@ -48,7 +48,7 @@ class QEGLPlatformContext : public QPlatformGLContext { public: - QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi); + QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi, QEGLPlatformContext *shareContext = 0); ~QEGLPlatformContext(); void makeCurrent(); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 0a02c7e..ed88138 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -516,7 +516,7 @@ QPlatformGLContext *QXcbWindow::glContext() const EGLSurface eglSurface = eglCreateWindowSurface(display,config,(EGLNativeWindowType)m_window,0); QXcbWindow *that = const_cast<QXcbWindow *>(this); - that->m_context = new QEGLPlatformContext(display, config, eglContextAttrs.data(), eglSurface, EGL_OPENGL_ES_API); + that->m_context = new QEGLPlatformContext(display, config, eglContextAttrs.data(), eglSurface, EGL_OPENGL_ES_API, static_cast<QEGLPlatformContext *>(widget()->platformWindowFormat().sharedGLContext())); #elif defined(XCB_USE_DRI2) QXcbWindow *that = const_cast<QXcbWindow *>(this); that->m_context = new QDri2Context(that); diff --git a/src/plugins/platforms/xlib/qxlibwindow.cpp b/src/plugins/platforms/xlib/qxlibwindow.cpp index 823fae9..16c5ed5 100644 --- a/src/plugins/platforms/xlib/qxlibwindow.cpp +++ b/src/plugins/platforms/xlib/qxlibwindow.cpp @@ -687,7 +687,7 @@ QPlatformGLContext *QXlibWindow::glContext() const eglContextAttrs.append(EGL_NONE); EGLSurface eglSurface = eglCreateWindowSurface(display,config,(EGLNativeWindowType)x_window,0); - that->mGLContext = new QEGLPlatformContext(display, config, eglContextAttrs.data(), eglSurface, EGL_OPENGL_ES_API); + that->mGLContext = new QEGLPlatformContext(display, config, eglContextAttrs.data(), eglSurface, EGL_OPENGL_ES_API, static_cast<QEGLPlatformContext *>(windowFormat.sharedGLContext())); #endif #endif } diff --git a/src/plugins/sqldrivers/symsql/main.cpp b/src/plugins/sqldrivers/symsql/main.cpp new file mode 100644 index 0000000..5dfa9f4 --- /dev/null +++ b/src/plugins/sqldrivers/symsql/main.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtSql module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <qsqldriverplugin.h> +#include <QStringList> +#include "../../../sql/drivers/symsql/qsql_symsql.h" + +QT_BEGIN_NAMESPACE + +class QSymSQLDriverPlugin : public QSqlDriverPlugin +{ +public: + QSymSQLDriverPlugin(); + + QSqlDriver* create(const QString &); + QStringList keys() const; +}; + +QSymSQLDriverPlugin::QSymSQLDriverPlugin() + : QSqlDriverPlugin() +{ +} + +QSqlDriver* QSymSQLDriverPlugin::create(const QString &name) +{ + if (name == QLatin1String("QSYMSQL")) { + QSymSQLDriver* driver = new QSymSQLDriver(); + return driver; + } + return 0; +} + +QStringList QSymSQLDriverPlugin::keys() const +{ + QStringList l; + l.append(QLatin1String("QSYMSQL")); + return l; +} + +Q_EXPORT_STATIC_PLUGIN(QSymSQLDriverPlugin) +Q_EXPORT_PLUGIN2(qsymsql, QSymSQLDriverPlugin) + +QT_END_NAMESPACE diff --git a/src/plugins/sqldrivers/symsql/symsql.pro b/src/plugins/sqldrivers/symsql/symsql.pro new file mode 100644 index 0000000..8b8434c --- /dev/null +++ b/src/plugins/sqldrivers/symsql/symsql.pro @@ -0,0 +1,13 @@ +TARGET = qsymsql +PLUGIN_TYPE = sqldrivers +SOURCES = main.cpp + +include(../../../sql/drivers/symsql/qsql_symsql.pri) +include(../qsqldriverbase.pri) + +symbian: { +pluginDep.sources = $${TARGET}.dll +pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE} +DEPLOYMENT += pluginDep +} + |