summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-06-15 14:49:10 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-06-15 14:49:10 (GMT)
commite19b6451796d136f1b5796c3afc5fd5492f3dac0 (patch)
treeebdd6df672a483d2afd88a1aab2570c29285e11e
parent77a41bfb4f1ce5e3fa52412e72c69b4397011fc1 (diff)
parentce409be66b8e62f36f210818e7fcaffcf29935ce (diff)
downloadQt-e19b6451796d136f1b5796c3afc5fd5492f3dac0.zip
Qt-e19b6451796d136f1b5796c3afc5fd5492f3dac0.tar.gz
Qt-e19b6451796d136f1b5796c3afc5fd5492f3dac0.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
-rw-r--r--demos/embedded/fluidlauncher/config_s60/config.xml1
-rw-r--r--demos/embedded/fluidlauncher/fluidlauncher.pro23
-rw-r--r--demos/embedded/fluidlauncher/screenshots/softkeys.pngbin0 -> 42853 bytes
-rw-r--r--examples/network/ftp/ftp.pro2
-rw-r--r--examples/network/ftp/main.cpp99
-rw-r--r--src/gui/kernel/qeventdispatcher_s60.cpp8
6 files changed, 94 insertions, 39 deletions
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 @@
<example filename="desktopservices" name="Desktop Services" image="screenshots/desktopservices.png"/>
<example filename="fridgemagnets" name="Fridge Magnets" image="screenshots/fridgemagnets.png" args="-small-screen"/>
<example filename="drilldown" name="Drilldown" image="screenshots/drilldown.png"/>
+ <example filename="softkeys" name="Softkeys" image="screenshots/softkeys.png"/>
</demos>
<slideshow timeout="60000" interval="10000">
<imagedir dir="slides"/>
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
--- /dev/null
+++ b/demos/embedded/fluidlauncher/screenshots/softkeys.png
Binary files differ
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 <es_sock.h>
#include <sys/socket.h>
+#include <rconnmon.h>
#include <net/if.h>
-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();
}
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;