From 00690dbb12af3a7cf20480571bef85565af00517 Mon Sep 17 00:00:00 2001 From: Markku Luukkainen Date: Mon, 15 Jun 2009 16:12:15 +0200 Subject: Added Softkeys example to fluidlauncher --- demos/embedded/fluidlauncher/config_s60/config.xml | 1 + demos/embedded/fluidlauncher/fluidlauncher.pro | 23 ++++++++++++--------- .../fluidlauncher/screenshots/softkeys.png | Bin 0 -> 42853 bytes 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 demos/embedded/fluidlauncher/screenshots/softkeys.png diff --git a/demos/embedded/fluidlauncher/config_s60/config.xml b/demos/embedded/fluidlauncher/config_s60/config.xml index 41b3b6d..b543fa2 100644 --- a/demos/embedded/fluidlauncher/config_s60/config.xml +++ b/demos/embedded/fluidlauncher/config_s60/config.xml @@ -12,6 +12,7 @@ + diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 9c08801..341b321 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -71,10 +71,11 @@ symbian { saxbookmarks.exe \ desktopservices.exe \ fridgemagnets.exe \ - drilldown.exe + drilldown.exe \ + softkeys.exe executables.path = /sys/bin - + reg_resource.sources = \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc \ @@ -83,14 +84,15 @@ symbian { $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/ftp_reg.rsc\ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc \ $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc \ - $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc - + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/drilldown_reg.rsc \ + $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc + reg_resource.path = $$REG_RESOURCE_IMPORT_DIR - + resource.sources = \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc \ @@ -102,10 +104,11 @@ symbian { $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc \ - $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc - + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/drilldown.rsc \ + $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc + resource.path = $$APP_RESOURCE_DIR - + mifs.sources = \ $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/0xA000C611.mif mifs.path = $$APP_RESOURCE_DIR @@ -131,7 +134,7 @@ symbian { saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel saxbookmarks.path = /data/qt/saxbookmarks - DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \ + DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \ mifs desktopservices_music desktopservices_images TARGET.EPOCHEAPSIZE = 100000 20000000 diff --git a/demos/embedded/fluidlauncher/screenshots/softkeys.png b/demos/embedded/fluidlauncher/screenshots/softkeys.png new file mode 100644 index 0000000..99681b9 Binary files /dev/null and b/demos/embedded/fluidlauncher/screenshots/softkeys.png differ -- cgit v0.12 From df82f57bf7b2194a798e10a8b375c07d33dde925 Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 15 Jun 2009 15:16:45 +0100 Subject: undeclared variable when exceptions disabled --- src/gui/kernel/qeventdispatcher_s60.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp index fcf572e..51878df 100644 --- a/src/gui/kernel/qeventdispatcher_s60.cpp +++ b/src/gui/kernel/qeventdispatcher_s60.cpp @@ -70,12 +70,14 @@ bool QEventDispatcherS60::processEvents ( QEventLoop::ProcessEventsFlags flags ) m_noInputEvents = false; ret = sendDeferredInputEvents() || ret; } - + ret = QEventDispatcherSymbian::processEvents(flags) || ret; - + m_noInputEvents = oldNoInputEventsValue; } QT_CATCH (const std::exception& ex) { - CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex)); +#ifndef QT_NO_EXCEPTIONS + CActiveScheduler::Current()->Error(qt_translateExceptionToSymbianError(ex)); +#endif } return ret; -- cgit v0.12 From ce409be66b8e62f36f210818e7fcaffcf29935ce Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Mon, 15 Jun 2009 16:11:48 +0200 Subject: Improving the code for setting the default IAP. First we ask if there is already active IAP. If yes, we will use that one, if not IAP dialog will pop-up. This strategy should save us from some dialogs when accessing the network. --- examples/network/ftp/ftp.pro | 2 +- examples/network/ftp/main.cpp | 99 ++++++++++++++++++++++++++++++++----------- 2 files changed, 75 insertions(+), 26 deletions(-) diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro index b958f6a..0fb9934 100644 --- a/examples/network/ftp/ftp.pro +++ b/examples/network/ftp/ftp.pro @@ -15,5 +15,5 @@ include($$QT_SOURCE_TREE/examples/examplebase.pri) symbian { TARGET.CAPABILITY="NetworkServices" TARGET.UID3 = 0xA000A648 - LIBS+=-lesock # For IAP selection + LIBS+=-lesock -lconnmon # For IAP selection } \ No newline at end of file diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index a92a8b2..118dcfc 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -48,32 +48,82 @@ #include #include +#include #include -static void setDefaultIapL() -{ - TInt err = KErrNone; - RSocketServ serv; - CleanupClosePushL(serv); - User::LeaveIfError(serv.Connect()); +QString qt_TDesC2QStringL(const TDesC& aDescriptor) { +#ifdef QT_NO_UNICODE + return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length()); +#else + return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length()); +#endif +} - RConnection conn; - CleanupClosePushL(conn); - User::LeaveIfError(conn.Open(serv)); - User::LeaveIfError(conn.Start()); - - _LIT(KIapNameSetting, "IAP\\Name"); - TBuf8<50> iapName; - User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName)); - iapName.ZeroTerminate(); - - conn.Stop(); - CleanupStack::PopAndDestroy(&conn); - CleanupStack::PopAndDestroy(&serv); +static void setDefaultIapL() { + RConnectionMonitor monitor; + CleanupClosePushL(monitor); + monitor.ConnectL(); + TUint count; + TRequestStatus status; + TUint ids[ 15 ]; - struct ifreq ifReq; - strcpy( ifReq.ifr_name, (char*)iapName.Ptr()); - User::LeaveIfError(setdefaultif( &ifReq )); + monitor.GetConnectionCount( count, status ); + User::WaitForRequest( status ); + if(status.Int() != KErrNone) { + User::Leave(status.Int()); + } + + TUint numSubConnections; + + if(count > 0) { + for ( TInt i = 1; i <= count; i++ ) { + User::LeaveIfError(monitor.GetConnectionInfo( i, ids[ i-1 ], numSubConnections )); + } + /* + * get IAP value for first active connection + */ + TBuf< 50 > iapName; + monitor.GetStringAttribute( ids[ 0 ], 0, KIAPName, iapName, status ); + User::WaitForRequest( status ); + if ( status.Int() != KErrNone ) { + User::Leave(status.Int()); + } else { + QString strIapName = qt_TDesC2QStringL(iapName); + struct ifreq ifReq; + strcpy( ifReq.ifr_name, strIapName.toLatin1().data()); + User::LeaveIfError(setdefaultif( &ifReq )); + } + } else { + /* + * no active connections yet + * use IAP dialog to select one + */ + RSocketServ serv; + CleanupClosePushL(serv); + User::LeaveIfError(serv.Connect()); + + RConnection conn; + CleanupClosePushL(conn); + User::LeaveIfError(conn.Open(serv)); + User::LeaveIfError(conn.Start()); + + _LIT(KIapNameSetting, "IAP\\Name"); + TBuf8<50> iap8Name; + User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iap8Name)); + iap8Name.ZeroTerminate(); + + struct ifreq ifReq; + strcpy( ifReq.ifr_name, (char*)iap8Name.Ptr()); + User::LeaveIfError(setdefaultif( &ifReq )); + + conn.Stop(); + conn.Close(); + serv.Close(); + CleanupStack::PopAndDestroy(&conn); + CleanupStack::PopAndDestroy(&serv); + } + monitor.Close(); + CleanupStack::PopAndDestroy(&monitor); } static int setDefaultIap() @@ -86,13 +136,12 @@ static int setDefaultIap() int main(int argc, char *argv[]) { Q_INIT_RESOURCE(ftp); - #ifdef Q_OS_SYMBIAN setDefaultIap(); // Change current directory from default private to c:\data // in order that user can access the downloaded content QDir::setCurrent( "c:\\data" ); -#endif +#endif QApplication app(argc, argv); FtpWindow ftpWin; #ifdef Q_OS_SYMBIAN @@ -100,6 +149,6 @@ int main(int argc, char *argv[]) ftpWin.showMaximized(); #else ftpWin.show(); -#endif +#endif return ftpWin.exec(); } -- cgit v0.12 From 77a41bfb4f1ce5e3fa52412e72c69b4397011fc1 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 15 Jun 2009 16:49:04 +0200 Subject: export qBadAlloc only if exceptions are on --- src/corelib/global/qglobal.cpp | 2 ++ src/corelib/global/qglobal.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index e53fd2d..88f845a 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1929,6 +1929,7 @@ void qt_check_pointer(const char *n, int l) qWarning("In file %s, line %d: Out of memory", n, l); } +#ifndef QT_NO_EXCEPTIONS /* \internal Allows you to throw an exception without including Called internally from Q_CHECK_PTR on certain OS combinations @@ -1937,6 +1938,7 @@ void qBadAlloc() { QT_THROW(std::bad_alloc()); } +#endif /* The Q_ASSERT macro calls this function when the test fails. diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 825b7e8..361c038 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1605,7 +1605,10 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char * #endif Q_CORE_EXPORT void qt_check_pointer(const char *, int); + +#ifndef QT_NO_EXCEPTIONS Q_CORE_EXPORT void qBadAlloc(); +#endif #ifdef QT_NO_EXCEPTIONS # if defined(QT_NO_DEBUG) -- cgit v0.12