Revision: 201019
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 13:42:11 +0300
changeset 8 71781823f776
parent 5 453da2cfceef
child 11 06b8e2af4411
Revision: 201019 Kit: 2010121
.hgtags
VERSION.SHA1
group/bld.inf
qtecomplugins/mkspecs/features/ecomplugin.prf
qtecomplugins/qtecomplugins.pro
qtecomplugins/supplements/xqecom/NOTE.txt
qtecomplugins/supplements/xqecom/xqecom.exe
qtecomplugins/supplements/xqecom/xqecom.py
qtecomplugins/xqecom/README.txt
qtecomplugins/xqecom/build.bat
qtecomplugins/xqecom/main.cpp
qtecomplugins/xqecom/xqecom.pro
qthighway/bin/README.txt
qthighway/bin/service2.prf
qthighway/bin/setserviceprf.cmd
qthighway/bin/setserviceprf2.cmd
qthighway/bwins/xqserviceutilu.def
qthighway/eabi/xqserviceutilu.def
qthighway/examples/appmgrclient/src/appmgrclient.cpp
qthighway/examples/serviceapp/service_conf_long.xml
qthighway/examples/serviceapp/serviceapp.pro
qthighway/examples/serviceapp/src/serviceapp.cpp
qthighway/inc/xqrequestutil.h
qthighway/inc/xqserviceipcconst.h
qthighway/xqservice/src/api_headers.pri
qthighway/xqservice/src/xqaiwdecl.h
qthighway/xqservice/src/xqaiwdeclplat.h
qthighway/xqservice/src/xqappmgr_p.cpp
qthighway/xqservice/src/xqserviceipcclient.cpp
qthighway/xqservice/src/xqservicerequest.cpp
qthighway/xqservice/src/xqservicethreaddata.cpp
qthighway/xqserviceutil/src/xqrequestutil.cpp
qthighway/xqserviceutil/src/xqrequestutil.h
qthighway/xqserviceutil/src/xqservicemanager.cpp
qthighway/xqserviceutil/src/xqservicemanager.h
qthighway/xqserviceutil/xqserviceutil.pro
qtmobileextensions/examples/examples.pro
qtmobileextensions/examples/rom/qtmobileextensionsexamples.iby
qtmobileextensions/examples/systemtoneserviceex/sis/stsqt.pkg
qtmobileextensions/examples/systemtoneserviceex/ststest.cpp
qtmobileextensions/examples/systemtoneserviceex/ststest.h
qtmobileextensions/examples/systemtoneserviceex/systemtoneserviceex.pro
qtmobileextensions/include/XQSystemToneService
qtmobileextensions/install/keycapture.pro
qtmobileextensions/install/systemtoneservice.pro
qtmobileextensions/qtmobileextensions.pro
qtmobileextensions/rom/qtmobileextensions.iby
qtmobileextensions/src/bwins/xqsystemtoneserviceu.def
qtmobileextensions/src/eabi/xqsystemtoneserviceu.def
qtmobileextensions/src/systemtoneservice/systemtoneservice.pri
qtmobileextensions/src/systemtoneservice/systemtoneservice.pro
qtmobileextensions/src/systemtoneservice/xqsystemtoneservice.cpp
qtmobileextensions/src/systemtoneservice/xqsystemtoneservice.h
qtmobileextensions/src/systemtoneservice/xqsystemtoneservice_p.cpp
qtmobileextensions/src/systemtoneservice/xqsystemtoneservice_p.h
qtmobility/.gitignore
qtmobility/common.pri
qtmobility/config.pri
qtmobility/config.tests/sensord/main.cpp
qtmobility/config.tests/sensord/sensord.pro
qtmobility/config.tests/symbiancntsim/main.cpp
qtmobility/configure
qtmobility/configure.bat
qtmobility/dist/changes-1.0.0
qtmobility/dist/changes-1.0.0-beta1
qtmobility/dist/changes-1.0.1
qtmobility/examples/keepintouch/addressfinder.cpp
qtmobility/examples/qmlcontacts/example.qml
qtmobility/examples/qmlcontacts/qmlcontact.cpp
qtmobility/examples/qmlcontacts/qmlcontact.h
qtmobility/examples/sensors/cubehouse/view.cpp
qtmobility/examples/sensors/grueplugin/grueplugin.pro
qtmobility/examples/sensors/sensor_explorer/explorer.cpp
qtmobility/examples/serviceactions/mainwindow.cpp
qtmobility/examples/servicebrowser/servicebrowser.cpp
qtmobility/examples/sysinfo/dialog.ui
qtmobility/examples/sysinfo/dialog_landscape.ui
qtmobility/examples/sysinfo/dialog_s60.ui
qtmobility/examples/writemessage/messagesender.cpp
qtmobility/features/mobility.prf
qtmobility/features/mobility.prf.template
qtmobility/plugins/contacts/maemo5/maemo5.pro
qtmobility/plugins/contacts/qtcontacts-tracker/qtcontacts-tracker.pro
qtmobility/plugins/contacts/symbian/inc/cntsymbianengine.h
qtmobility/plugins/contacts/symbian/inc/filtering/cntsymbianfilterdbms.h
qtmobility/plugins/contacts/symbian/inc/transform/cnttransformcontact.h
qtmobility/plugins/contacts/symbian/src/cntsymbiandatabase.cpp
qtmobility/plugins/contacts/symbian/src/cntsymbianengine.cpp
qtmobility/plugins/contacts/symbian/src/filtering/cntsymbianfilterdbms.cpp
qtmobility/plugins/contacts/symbian/src/transform/cnttransformcontact.cpp
qtmobility/plugins/contacts/symbian/symbian.pro
qtmobility/plugins/contacts/symbian/tsrc/tsrc.pri
qtmobility/plugins/contacts/symbian/tsrc/tst_qcontactmanagersymbian/tst_qcontactmanagersymbian.cpp
qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_cntrelationship.cpp
qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_cntsymbianengine.cpp
qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_transformcontactdata.cpp
qtmobility/plugins/contacts/symbiansim/symbiansim.pro
qtmobility/plugins/contacts/wince/wince.pro
qtmobility/plugins/multimedia/audiocapture/audiocapture.pro
qtmobility/plugins/multimedia/directshow/directshow.pro
qtmobility/plugins/multimedia/gstreamer/gstreamer.pro
qtmobility/plugins/multimedia/m3u/m3u.pro
qtmobility/plugins/multimedia/qt7/qt7.pro
qtmobility/plugins/multimedia/symbian/common/s60videooutputcontrol.h
qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocaptureservice.h
qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocapturesession.h
qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocontainercontrol.h
qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audioencodercontrol.h
qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audioendpointselector.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediametadataprovider.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayeraudioendpointselector.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayercontrol.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayersession.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videooverlay.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videorenderer.h
qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videowidget.h
qtmobility/plugins/multimedia/symbian/mmf/mmf.pro
qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunercontrol_31.h
qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunercontrol_since32.h
qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunerservice.h
qtmobility/plugins/multimedia/symbian/mmf/s60mediaserviceplugin.h
qtmobility/plugins/multimedia/symbian/openmaxal/mediarecorder/mediarecorder.pro
qtmobility/plugins/multimedia/v4l/v4l.pro
qtmobility/plugins/multimedia/wmp/wmp.pro
qtmobility/plugins/sensors/dummy/dummy.pro
qtmobility/plugins/sensors/generic/generic.pro
qtmobility/plugins/sensors/maemo6/maemo6.pri
qtmobility/plugins/sensors/maemo6/maemo6.pro
qtmobility/plugins/sensors/maemo6/maemo6accelerometer.cpp
qtmobility/plugins/sensors/maemo6/maemo6als.cpp
qtmobility/plugins/sensors/maemo6/maemo6compass.cpp
qtmobility/plugins/sensors/maemo6/maemo6magnetometer.cpp
qtmobility/plugins/sensors/maemo6/maemo6orientationsensor.cpp
qtmobility/plugins/sensors/maemo6/maemo6proximitysensor.cpp
qtmobility/plugins/sensors/maemo6/maemo6rotationsensor.cpp
qtmobility/plugins/sensors/maemo6/maemo6sensorbase.cpp
qtmobility/plugins/sensors/maemo6/maemo6tapsensor.cpp
qtmobility/plugins/sensors/maemo6/version.pri
qtmobility/plugins/sensors/n900/n900.pro
qtmobility/plugins/sensors/s60_sensor_api/s60_sensor_api.pro
qtmobility/plugins/sensors/sensors.pro
qtmobility/plugins/sensors/symbian/symbian.pro
qtmobility/qtmobility.pro
qtmobility/src/contacts/qcontactmanager.cpp
qtmobility/src/contacts/qcontactmanager_p.cpp
qtmobility/src/contacts/qcontactmanagerengine.cpp
qtmobility/src/contacts/qcontactmanagerenginefactory.cpp
qtmobility/src/global/qmobilityglobal.h
qtmobility/src/global/qmobilitypluginsearch.h
qtmobility/src/location/dbuscomm_maemo.cpp
qtmobility/src/location/dbuscomm_maemo_p.h
qtmobility/src/location/dbusserver_maemo.cpp
qtmobility/src/location/dbusserver_maemo_p.h
qtmobility/src/location/gconfitem.cpp
qtmobility/src/location/gconfitem.h
qtmobility/src/location/gconfitem_p.h
qtmobility/src/location/liblocationwrapper_p.h
qtmobility/src/location/location.pro
qtmobility/src/location/qgeopositioninfosource_maemo.cpp
qtmobility/src/location/qgeopositioninfosource_maemo_p.h
qtmobility/src/location/qgeosatelliteinfosource_maemo.cpp
qtmobility/src/location/qgeosatelliteinfosource_maemo_p.h
qtmobility/src/messaging/eventloggerengine_maemo.cpp
qtmobility/src/messaging/eventloggerengine_maemo_p.h
qtmobility/src/messaging/messaging.pro
qtmobility/src/messaging/messagingutil.cpp
qtmobility/src/messaging/messagingutil_p.h
qtmobility/src/messaging/qmessage.cpp
qtmobility/src/messaging/qmessageaccount.cpp
qtmobility/src/messaging/qmessageaccountfilter.cpp
qtmobility/src/messaging/qmessageaccountid.cpp
qtmobility/src/messaging/qmessageaccountid.h
qtmobility/src/messaging/qmessageaccountid_symbian.cpp
qtmobility/src/messaging/qmessageaccountid_win.cpp
qtmobility/src/messaging/qmessageaccountsortorder.cpp
qtmobility/src/messaging/qmessageaddress.cpp
qtmobility/src/messaging/qmessagecontentcontainer.cpp
qtmobility/src/messaging/qmessagecontentcontainer_p.h
qtmobility/src/messaging/qmessagecontentcontainer_symbian.cpp
qtmobility/src/messaging/qmessagecontentcontainerid.cpp
qtmobility/src/messaging/qmessagecontentcontainerid_symbian.cpp
qtmobility/src/messaging/qmessagecontentcontainerid_win.cpp
qtmobility/src/messaging/qmessagefilter.cpp
qtmobility/src/messaging/qmessagefolder.cpp
qtmobility/src/messaging/qmessagefolderfilter.cpp
qtmobility/src/messaging/qmessagefolderid.cpp
qtmobility/src/messaging/qmessagefolderid.h
qtmobility/src/messaging/qmessagefolderid_symbian.cpp
qtmobility/src/messaging/qmessagefolderid_win.cpp
qtmobility/src/messaging/qmessagefoldersortorder.cpp
qtmobility/src/messaging/qmessageglobal.h
qtmobility/src/messaging/qmessageid.cpp
qtmobility/src/messaging/qmessageid.h
qtmobility/src/messaging/qmessageid_symbian.cpp
qtmobility/src/messaging/qmessageid_win.cpp
qtmobility/src/messaging/qmessagemanager.cpp
qtmobility/src/messaging/qmessageservice.cpp
qtmobility/src/messaging/qmessageservice_maemo.cpp
qtmobility/src/messaging/qmessageservice_maemo_p.h
qtmobility/src/messaging/qmessagesortorder.cpp
qtmobility/src/messaging/qmtmengine_symbian.cpp
qtmobility/src/messaging/qmtmengine_symbian_p.h
qtmobility/src/messaging/win32wce/qmailcodec.cpp
qtmobility/src/messaging/win32wce/qmailid.cpp
qtmobility/src/messaging/win32wce/qmailmessage.cpp
qtmobility/src/messaging/win32wce/qmailmessagefwd.cpp
qtmobility/src/messaging/winhelpers.cpp
qtmobility/src/messaging/winhelpers_p.h
qtmobility/src/multimedia/multimedia.pro
qtmobility/src/multimedia/qmediapluginloader.cpp
qtmobility/src/publishsubscribe/GConfItem
qtmobility/src/s60installs/bwins/QtContactsu.def
qtmobility/src/s60installs/eabi/QtContactsu.def
qtmobility/src/s60installs/qtmobility.iby
qtmobility/src/s60installs/qtmobility_stub.pkg
qtmobility/src/s60installs/qtmobility_stub.sis
qtmobility/src/s60installs/s60installs.pro
qtmobility/src/sensors/make_sensor.pl
qtmobility/src/sensors/qaccelerometer.cpp
qtmobility/src/sensors/qambientlightsensor.cpp
qtmobility/src/sensors/qcompass.cpp
qtmobility/src/sensors/qmagnetometer.cpp
qtmobility/src/sensors/qorientationsensor.cpp
qtmobility/src/sensors/qproximitysensor.cpp
qtmobility/src/sensors/qrotationsensor.cpp
qtmobility/src/sensors/qsensor.cpp
qtmobility/src/sensors/qsensorbackend.cpp
qtmobility/src/sensors/qsensormanager.cpp
qtmobility/src/sensors/qsensorpluginloader.cpp
qtmobility/src/sensors/qtapsensor.cpp
qtmobility/src/sensors/sensors.pro
qtmobility/src/serviceframework/servicedatabase.cpp
qtmobility/src/systeminfo/gconfitem.cpp
qtmobility/src/systeminfo/gconfitem.h
qtmobility/src/systeminfo/gconfitem_p.h
qtmobility/src/systeminfo/qsysteminfo.cpp
qtmobility/src/systeminfo/qsysteminfo_linux_common.cpp
qtmobility/src/systeminfo/qsysteminfo_maemo.cpp
qtmobility/src/systeminfo/qsysteminfo_s60.cpp
qtmobility/src/systeminfo/systeminfo.pro
qtmobility/src/versit/qversitcontactexporter.cpp
qtmobility/src/versit/qversitcontactexporter_p.cpp
qtmobility/src/versit/qversitcontactimporter.cpp
qtmobility/src/versit/qversitcontactimporter_p.cpp
qtmobility/src/versit/qversitdefs_p.h
qtmobility/src/versit/qversitdocument.cpp
qtmobility/src/versit/qversitproperty.cpp
qtmobility/src/versit/qversitreader.cpp
qtmobility/src/versit/qversitreader_p.cpp
qtmobility/src/versit/qversitreader_p.h
qtmobility/src/versit/qversitresourcehandler.cpp
qtmobility/src/versit/qversitwriter.cpp
qtmobility/tests/auto/auto.pro
qtmobility/tests/auto/qmessagestore/tst_qmessagestore.cpp
qtmobility/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp
qtmobility/tests/auto/qvcard21writer/tst_qvcard21writer.cpp
qtmobility/tests/auto/qvcard21writer/tst_qvcard21writer.h
qtmobility/tests/auto/qvcard30writer/tst_qvcard30writer.cpp
qtmobility/tests/auto/qvcard30writer/tst_qvcard30writer.h
qtmobility/tests/auto/qversit/testdata/test1.vcf
qtmobility/tests/auto/qversit/tst_qversit.cpp
qtmobility/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp
qtmobility/tests/auto/qversitreader/tst_qversitreader.cpp
qtmobility/tests/auto/qversitreader/tst_qversitreader.h
qtmobility/tests/auto/support/support.pri
qtmobility/tests/auto/support/support_symbian.cpp
qtmobility/tests/auto/support/support_win.cpp
qtmobility/tests/auto/symbian/qmediaplayer_s60/tst_qmediaplayer_s60.cpp
qtmobility/tests/auto/symbian/symbian.pro
qtmobility/tests/messagingex/messagingex.cpp
--- a/.hgtags	Fri May 14 16:41:33 2010 +0300
+++ b/.hgtags	Thu May 27 13:42:11 2010 +0300
@@ -31,3 +31,7 @@
 e2211009c3b2ac59feba403cb2a44333f2a03b38 rel-1014-2
 c555635e12cbde91384eae046da7b13a8009e20d rel-1014-3
 111b06c4b3c73e0c11d59d060dcb81be4b4857aa rel-1016
+391ed54a0c5f52a4604291d176852a6cebb042f9 rel-1018
+8efb64d7d2f74e77bc1e6002fe5d8fedd45d0cfe rel-1018-1
+bd857121e75382047a96c3b5942d83fc9828cc4b rel-1018-2
+824172531d783ab1c6d1173b77ebeb284a680092 rel-1018-3
--- a/VERSION.SHA1	Fri May 14 16:41:33 2010 +0300
+++ b/VERSION.SHA1	Thu May 27 13:42:11 2010 +0300
@@ -1,1 +1,1 @@
-e5e2775c6cda698f5d10741ed16f00de19248412
+f7095fa7e088766f37122918eadd488da8938fe2
--- a/group/bld.inf	Fri May 14 16:41:33 2010 +0300
+++ b/group/bld.inf	Thu May 27 13:42:11 2010 +0300
@@ -29,7 +29,7 @@
 qtextensions_pre_targetdep.flm /epoc32/tools/makefile_templates/qt/qtextensions_pre_targetdep.flm
 
 ../qtecomplugins/mkspecs/features/ecomplugin.prf /epoc32/tools/qt/mkspecs/features/symbian/ecomplugin.prf
-../qtecomplugins/supplements/xqecom/xqecom.exe   /epoc32/tools/xqecom.exe
+../qtecomplugins/supplements/xqecom/xqecom.py    /epoc32/tools/xqecom.py
 ../qthighway/bin/service.prf                     /epoc32/tools/qt/mkspecs/features/symbian/service.prf
 ../qthighway/bin/xqsreg.exe                      /epoc32/tools/xqsreg.exe
 
--- a/qtecomplugins/mkspecs/features/ecomplugin.prf	Fri May 14 16:41:33 2010 +0300
+++ b/qtecomplugins/mkspecs/features/ecomplugin.prf	Thu May 27 13:42:11 2010 +0300
@@ -11,11 +11,11 @@
 
 TARGET.UID2 = 0x10009d8d
 #generated files needs TARGET.UID3 to be set
-isEmpty(TARGET.UID3):error(Plugiin has to has TARGET.UID3 assigned explicitly!)
+isEmpty(TARGET.UID3):error(Plugin has to has TARGET.UID3 assigned explicitly!)
 
 
 #Generate additional files
-XQECOMAPP = xqecom.exe 
+XQECOMAPP = "python $${EPOCROOT}epoc32/tools/xqecom.py"
 #XQECOMAPP = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}xqecom.exe
 
 XQ_FILE_RSS_TAIL=.rss
--- a/qtecomplugins/qtecomplugins.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtecomplugins/qtecomplugins.pro	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,7 @@
 ecompluginprfdestdir = "$$[QMAKE_MKSPECS]\features"
 
 tooldir = "supplements\xqecom\\"
-toolfile = "xqecom.exe"
+toolfile = "xqecom.py"
 tooldestdir = "$$[QT_INSTALL_BINS]"
 
 installprf.commands += $${QMAKE_COPY} $$myNativePath($$ecompluginprfdir$$ecompluginprffile) $$myNativePath($$ecompluginprfdestdir)
--- a/qtecomplugins/supplements/xqecom/NOTE.txt	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-For those who cant compile original sources (eg. QT 4.5 has problems here, use 4.6 if you want to build it for yourself).
\ No newline at end of file
Binary file qtecomplugins/supplements/xqecom/xqecom.exe has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtecomplugins/supplements/xqecom/xqecom.py	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,259 @@
+#!/usr/bin/env python
+"""
+This is part of qtextensions/qtecomplugins extension. It pregenerates few files needed during compilation of ecom plugins.
+Those includes:
+  * registration resource file
+  * stubs
+  * pkg file
+  * iby file
+"""
+
+import logging
+import datetime
+import sys
+from optparse import OptionParser
+
+class Generator(object):
+	def __init__(self, args):
+		if len(args)==5:
+			if args[2]=="":
+				interfaceValue = args[0]+".dll"
+			else:
+				interfaceValue = args[2]
+			self.args = {
+			'target': args[0],
+			'uid3': args[1],
+			'interface': interfaceValue,
+			'configuration': args[3],
+			'configurationFile': args[4],
+			'timestamp': datetime.datetime.now()
+			}
+		else:
+			logging.fatal("illegal number of arguments: %d" % len(args))
+			sys.exit(1)
+	def generate(self):
+		logging.warning("%s is not generating anything useful" % self.__class__.__name__)
+	def strip(self, s):
+		l = len(s) - len(s.lstrip())
+		def stripOrNot(x):
+			if l>=len(x):
+				return x
+			else:
+				return x[l:]
+		return ''.join(map(stripOrNot, s.splitlines(True)))
+		
+class RssGenerator(Generator):
+	"""
+	RSS generator.
+	"""
+	def __init__(self, args):
+		super(self.__class__, self).__init__(args)
+	def generate(self):
+		fileName = self.args['target'] + ".rss"
+		dllName = self.args['target'] + ".dll"
+		
+		if self.args['interface'] == "":
+			self.args['interface'] = dllName
+
+		if self.args['configurationFile'] != "":
+			opaqueDataFile = file(self.args['configurationFile'])
+			self.args['opaqueData'] = ((''.join(opaqueDataFile.readlines())).replace('\n', '').replace('"', '\\"'))[:255];
+		else:
+			self.args['opaqueData'] = self.args['configuration']
+
+		output = file(fileName, "w")
+		header = """\
+		// ==============================================================================
+		// Generated by xqecom on %(timestamp)s
+		// This file is generated by xqecom and should not be modified by the user.
+		// Name        : %(target)s.rss
+		// Part of     : 
+		// Description : Fixes common plugin symbols to known ordinals
+		// Version     : 
+		// ==============================================================================
+		
+		
+		#include <registryinfov2.rh>
+		
+		#include <xqtecom.hrh>
+		
+		#include <ecomstub_%(uid3)s.hrh>
+		
+		RESOURCE REGISTRY_INFO theInfo
+		{
+		resource_format_version = RESOURCE_FORMAT_VERSION_2;
+		dll_uid = %(uid3)s;
+		interfaces =
+			{
+			INTERFACE_INFO
+				{
+				interface_uid = KQtEcomPluginInterfaceUID;
+				implementations =
+					{
+					IMPLEMENTATION_INFO
+						{
+						implementation_uid = KQtEcomPluginImplementationUid;
+						version_no = 1;
+						display_name = "%(target)s.dll";
+						// SERVICE.INTERFACE_NAME
+						default_data = "%(interface)s";
+						// SERVICE.CONFIGURATION
+						opaque_data = "%(opaqueData)s";
+						}
+					};
+				}
+			};
+		} 		
+		"""
+		
+		output.write(self.strip(header) % self.args )
+		
+
+class PkgGenerator(Generator):
+	"""
+	PKG generator.
+	"""
+	def __init__(self, args):
+		super(self.__class__, self).__init__(args)
+	def generate(self):
+		content="""\
+		// ============================================================================
+		// Generated by xqecom on %(timestamp)s
+		// This file is generated by xqecom and should not be modified by the user.
+		// ============================================================================
+
+		; Language
+		&EN
+
+		; SIS header: name, uid, version
+		#{%(target)s},(%(uid3)s),1,0,0
+
+		; Localised Vendor name
+		%%{"Nokia, Qt Software"}
+
+		; Unique Vendor name
+		:"Nokia, Qt Software"
+
+		; Dependencies
+		[0x101F7961],0,0,0,{"S60ProductID"}
+		[0x102032BE],0,0,0,{"S60ProductID"}
+		[0x102752AE],0,0,0,{"S60ProductID"}
+		[0x1028315F],0,0,0,{"S60ProductID"}
+		(0x2001E61C), 4, 5, 0, {"QtLibs pre-release"}
+
+		;files
+		"\\epoc32\\release\\armv5\\urel\\%(target)s.dll"    - "!:\\sys\\bin\\%(target)s.dll"
+		"\\epoc32\\data\\Z\\resource\\plugins\\%(target)s.rsc" - "!:\\resource\\plugins\\%(target)s.rsc" 		
+		"""
+		
+		fileName = self.args['target'] + ".pkg"
+		output = file(fileName, "w")
+		output.write(self.strip(content) % self.args)
+	
+
+class IbyGenerator(Generator):
+	"""
+	IBY generator.
+	"""
+	def __init__(self, args):
+		super(self.__class__, self).__init__(args)
+	def generate(self):
+		self.args['TARGET']=self.args['target'].upper()
+		content="""\
+		// ============================================================================
+		// Generated by xqecom on %(timestamp)s
+		// This file is generated by xqecom and should not be modified by the user.
+		// ============================================================================
+
+		#ifndef %(TARGET)s_IBY
+		#define %(TARGET)s_IBY
+
+		#include <bldvariant.hrh>
+
+		ECOM_PLUGIN( %(target)s.dll, %(target)s.rsc )
+
+		#endif //%(TARGET)s_IBY 		
+		"""
+		
+		fileName = self.args['target'] + ".iby"
+		output = file(fileName, "w")
+		output.write(self.strip(content) % self.args)
+	
+class StubsGenerator(Generator):
+	"""
+	Stubs generator.
+	"""
+	def __init__(self, args):
+		super(self.__class__, self).__init__(args)
+	def generate(self):
+		contentHrh="""\
+		// ============================================================================
+		// Generated by xqecom on %(timestamp)s
+		// This file is generated by xqecom and should not be modified by the user.
+		// ============================================================================
+
+		#ifndef ECOMSTUB_%(uid3)s_HRH
+		#define ECOMSTUB_%(uid3)s_HRH
+		#define KQtEcomPluginImplementationUid %(uid3)s
+		#endif //ECOMSTUB_%(uid3)s_HRH 
+		"""
+
+		fileName = "ecomstub_" + self.args['uid3'] + ".hrh"
+		output = file(fileName, "w")
+		output.write(self.strip(contentHrh) % self.args)
+
+		contentCpp="""\
+		// ============================================================================
+		// Generated by xqecom on %(timestamp)s
+		// This file is generated by xqecom and should not be modified by the user.
+		// ============================================================================
+
+		#include <xqplugin.h>
+		#include <ecomstub_%(uid3)s.hrh>
+		#include <ecom/implementationproxy.h>
+		XQ_PLUGIN_ECOM_HEADER(%(target)s)
+		const TImplementationProxy implementationTable[] = 
+			{
+			IMPLEMENTATION_PROXY_ENTRY(%(uid3)s, C%(target)sFactory::NewL)
+			};
+
+		EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+			{
+			aTableCount = sizeof( implementationTable ) / sizeof( TImplementationProxy );
+			return implementationTable;
+			} 
+		"""		
+
+		fileName = "ecomstub_" + self.args['uid3'] + ".cpp"
+		output = file(fileName, "w")
+		output.write(self.strip(contentCpp) % self.args)
+	
+
+def runGenerators(generators, args):
+	for g in generators:
+		logging.debug("about to run generator: %s" % g.__name__)
+		try:
+			instance = g(args)
+			instance.generate()
+		except Exception, ex:
+			logging.error("Exception in %s: '%s'" % (g.__name__, ex))
+			logging.error("Exception in %s: '%s'" % (g.__name__, ex))
+			raise
+
+if (__name__=="__main__"):
+	arguments = sys.argv[1:]
+
+	op = OptionParser()
+	op.usage="%prog [options] [<target> <uid3> <interface> <configuration> <configurationFile>]"
+	
+#	op.add_option("-t", "--target", help="plugin target name")
+#	op.add_option("-u", "--uid3", help="plugin uid3")
+#	op.add_option("-i", "--interface", help="interface name")
+#	op.add_option("-c", "--configuration", help="configuration")
+#	op.add_option("-f", "--configuration-file", help="configuration file")
+	
+	(options, args) = op.parse_args(arguments)
+	
+	generators = [RssGenerator, PkgGenerator, IbyGenerator, StubsGenerator]
+	runGenerators(generators, args)
+
--- a/qtecomplugins/xqecom/README.txt	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-============= BUILD STEPS: =============
-
-1. Copy WHOLE xqsreg directory (one containing this README file)
-   to: 
-
-     [QTDIR]\src\tools
-
-   where QTDIR is path to your qt sources (typically for SDK release: \sf\mw\qt\)
-
-
-2. Ensure that QT is properly configured. In just-downoladed SDK one
-   need to run such command in qt directory:
-
-   # configure.exe -platform win32-g++ -make make -xplatform symbian-abld -nokia-developer -dont-process -no-qmake
-
-
-3. Rebuild project in [QTDIR]\src\tools\bootstrap library:
-
-   # qmake -platform win32-g++ -spec \sf\mw\qt\mkspecs\win32-g++    
-   # make
-
-
-4. Rebuild project in [QTDIR]\src\tools\xqsreg directory:
-
-   # qmake -platform win32-g++ -spec \sf\mw\qt\mkspecs\win32-g++ 
-   # make
-
-
-5. Check if xqsreg.exe tool is in proper bin directory:
-
-   # dir \epoc32\tools\xqecom.exe
-
-   (exact path depends on where QT_INSTALL_BINS points to, during compilation)
--- a/qtecomplugins/xqecom/build.bat	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-@rem All rights reserved.
-@rem
-@rem This program is free software: you can redistribute it and/or modify
-@rem it under the terms of the GNU Lesser General Public License as published by
-@rem the Free Software Foundation, version 2.1 of the License.
-@rem 
-@rem This program is distributed in the hope that it will be useful,
-@rem but WITHOUT ANY WARRANTY; without even the implied warranty of
-@rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-@rem GNU Lesser General Public License for more details.
-@rem
-@rem You should have received a copy of the GNU Lesser General Public License
-@rem along with this program.  If not, 
-@rem see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
-@rem
-@rem Description:
-@rem
-
-qmake -platform win32-g++ -spec /sf/mw/qt/mkspecs/win32-g++
-call make release
--- a/qtecomplugins/xqecom/main.cpp	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-*
-* This program is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License as published by
-* the Free Software Foundation, version 2.1 of the License.
-* 
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public License
-* along with this program.  If not, 
-* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
-*
-* Description:
-*
-*/
-
-#include <QString>
-#include <QStringList>
-#include <QFile>
-#include <QIODevice>
-#include <QTextStream>
-#include <QDateTime>
-#include <QFileInfo>
-
-#define IMPLEMENTATION_UID_LIT "KQtEcomPluginImplementationUid"
-
-void runRSSFileGenerator(QStringList params)
-{
-    QString appName = params[1];
-	QString uid3 = params[2];
-	QString interfacename = params[3];
-	QString configuration = params[4];
-	QString configurationFile = params[5];
-	
-	QString rssFilename = appName;
-    rssFilename.append(QString::fromLatin1(".rss"));
-
-    QFile ft(rssFilename);
-	if(!ft.exists()){
-		if(ft.open(QIODevice::WriteOnly)) {
-			QTextStream t(&ft);
-
-			t << "// ==============================================================================" << endl;
-	        t << "// Generated by xqecom on " << QDateTime::currentDateTime().toString() << endl;
-	        t << "// This file is generated by xqecom and should not be modified by the user." << endl;
-			t << "//  Name        : " << rssFilename << endl;
-			t << "//  Part of     : " << endl;
-			t << "//  Description : Fixes common plugin symbols to known ordinals" << endl;
-			t << "//  Version     : " << endl;
-			t << "//" << endl;
-			t << "// ==============================================================================" << "\n" << endl;
-			t << endl;
-
-	        if (interfacename.isEmpty()) {
-	            interfacename = QString(appName).append(QString::fromLatin1(".dll"));
-	        }
-			
-	        QTextStream configStream;
-	        QFile cfgFile;
-			
-			if (!configurationFile.isEmpty()) {
-				cfgFile.setFileName(configurationFile);
-				if (cfgFile.open(QIODevice::ReadOnly)) {
-					configStream.setDevice( &cfgFile );
-				} else {
-					printf("Not generated: ");
-					printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-					printf(" - Cannot open file: %s\n", configurationFile.toLocal8Bit().data());						
-					ft.remove();
-					return;
-				}
-	        } else {
-				configStream.setString( &configuration, QIODevice::ReadOnly );
-	        }
-
-			
-	        t << "#include <registryinfov2.rh>" << endl << endl;
-	        t << "#include <xqtecom.hrh>" << endl << endl;
-	        t << "#include <ecomstub_" << uid3 << ".hrh>" << endl << endl;
-	        t << "RESOURCE REGISTRY_INFO theInfo" << endl << "{" << endl;
-	        t << "resource_format_version = RESOURCE_FORMAT_VERSION_2;" << endl;
-	        t << "dll_uid = " << uid3 << ";" << endl;
-	        t << "interfaces =" << endl << "\t{" << endl << "\tINTERFACE_INFO" << endl << "\t\t{" << endl;
-	        t << "\t\tinterface_uid = KQtEcomPluginInterfaceUID;" << endl;
-	        t << "\t\timplementations =" << endl << "\t\t\t{" << endl;
-	        t << "\t\t\tIMPLEMENTATION_INFO" << endl << "\t\t\t\t{" << endl;
-	        t << "\t\t\t\timplementation_uid = " << IMPLEMENTATION_UID_LIT << ";" << endl;
-	        t << "\t\t\t\tversion_no = 1;" << endl;
-	        t << "\t\t\t\tdisplay_name = \"" << appName+QString(QString::fromLatin1(".dll")) << "\";" << endl;
-	        t << "\t\t\t\t// SERVICE.INTERFACE_NAME" << endl;
-	        t << "\t\t\t\tdefault_data = \"" << interfacename << "\";" << endl;
-	        t << "\t\t\t\t// SERVICE.CONFIGURATION" << endl;
-	        t << "\t\t\t\topaque_data = \""; 
-			while( !configStream.atEnd() ) {
-				configStream.skipWhiteSpace();
-				t << configStream.readLine( 255 ).replace(QString::fromLatin1("\""), QString::fromLatin1("\\\""));
-			};
-			t << "\";" << endl;
-	        t << "\t\t\t\t}" << endl << "\t\t\t};" << endl << "\t\t}" << endl << "\t};" << endl << "}" << endl;
-			printf("Generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf("\n");
-	    }else{
-			printf("Not generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf(" - Error %d\n",ft.error());
-		}
-	}else{
-		printf("Not generated: ");
-		printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-		printf(" - File exists\n");					
-	}
-}
-
-void runXQPkgGenerator(QStringList params)
-{
-    QString appName = params[1];
-    QString uid3=params[2];
-	
-    QString outputFileName=appName+QString(QString::fromLatin1(".pkg"));
-
-    QFile ft(outputFileName);
-	if(!ft.exists()){
-	    if(ft.open(QIODevice::WriteOnly)) {
-	        QTextStream t(&ft);
-	        t << "// ============================================================================" << endl;
-	        t << "// Generated by xqecom on " << QDateTime::currentDateTime().toString() << endl;
-	        t << "// This file is generated by xqecom and should not be modified by the user." << endl;
-	        t << "// ============================================================================" << endl;
-	        t << endl;
-	        t << "; Language" << endl;
-	        t << "&EN" << endl;
-	        t << endl;
-	        t << "; SIS header: name, uid, version" << endl;
-	        t << "#{"<< appName <<"},(" << uid3 << "),1,0,0" << endl;
-	        t << endl;
-	        t << "; Localised Vendor name" << endl;
-	        t << "%{\"Nokia, Qt Software\"}" << endl;
-	        t << endl;
-	        t << "; Unique Vendor name" << endl;
-	        t << ":\"Nokia, Qt Software\"" << endl;
-	        t << endl;
-	        t << "; Dependencies" << endl;
-	        t << "[0x101F7961],0,0,0,{\"S60ProductID\"}" << endl;
-	        t << "[0x102032BE],0,0,0,{\"S60ProductID\"}" << endl;
-	        t << "[0x102752AE],0,0,0,{\"S60ProductID\"}" << endl;
-	        t << "[0x1028315F],0,0,0,{\"S60ProductID\"}" << endl;
-	        t << "(0x2001E61C), 4, 5, 0, {\"QtLibs pre-release\"}" << endl;
-	        t << endl;
-	        t << ";files" << endl;
-	        t << "\"\\epoc32\\release\\armv5\\urel\\"<< appName <<".dll\"    - \"!:\\sys\\bin\\"<< appName <<".dll\"" << endl;
-	        t << "\"\\epoc32\\data\\Z\\resource\\plugins\\"<< appName <<".rsc\" - \"!:\\resource\\plugins\\"<< appName <<".rsc\"" << endl;
-			printf("Generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf("\n");
-	    }else{
-			printf("Not generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf(" - Error %d\n",ft.error());
-		}
-	}else{
-		printf("Not generated: ");
-		printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-		printf(" - File exists\n");					
-	}
-}
-
-void runXQIbyGenerator(QStringList params)
-{
-    QString appName = params[1];
-	
-    QString outputFileName=appName+QString(QString::fromLatin1(".iby"));
-	QString headerGuard = appName+QString(QString::fromLatin1("_IBY"));
-	headerGuard=headerGuard.toUpper();
-
-    QFile ft(outputFileName);
-	if(!ft.exists()){
-	    if(ft.open(QIODevice::WriteOnly)) {
-	        QTextStream t(&ft);
-	        t << "// ============================================================================" << endl;
-	        t << "// Generated by xqecom on " << QDateTime::currentDateTime().toString() << endl;
-	        t << "// This file is generated by xqecom and should not be modified by the user." << endl;
-	        t << "// ============================================================================" << endl;
-	        t << endl;
-	        t << "#ifndef " << headerGuard << endl;
-	        t << "#define " << headerGuard << endl;
-	        t << endl;
-	        t << "#include <bldvariant.hrh>" << endl;
-	        t << endl;
-			t << "ECOM_PLUGIN( " << appName << ".dll, " << appName << ".rsc )" << endl;
-	        t << endl;
-	        t << "#endif //" << headerGuard << endl;
-			printf("Generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf("\n");
-	    }else{
-			printf("Not generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf(" - Error %d\n",ft.error());
-		}
-	}else{
-		printf("Not generated: ");
-		printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-		printf(" - File exists\n");					
-	}
-}
-
-void runXQStubGenerator(QStringList params)
-{
-    QString appName = params[1];
-    QString uid3 = params[2];	
-	
-	QString outputHeaderFileName=QString::fromLatin1("ecomstub_") + uid3 + QString::fromLatin1(".hrh");
-	QString outputSourceFileName=QString::fromLatin1("ecomstub_") + uid3 + QString::fromLatin1(".cpp");
-	QString headerGuard = QString::fromLatin1("ECOMSTUB_%1_HRH").arg(uid3);
-
-    QFile fth(outputHeaderFileName);
-	if(!fth.exists()){
-	    if(fth.open(QIODevice::WriteOnly)) {
-	        QTextStream t(&fth);
-	        t << "// ============================================================================" << endl;
-	        t << "// Generated by xqecom on " << QDateTime::currentDateTime().toString() << endl;
-	        t << "// This file is generated by xqecom and should not be modified by the user." << endl;
-	        t << "// ============================================================================" << endl;
-	        t << endl;
-			t << "#ifndef " << headerGuard << endl;
-			t << "#define " << headerGuard << endl;
-			
-			t << "#define " << IMPLEMENTATION_UID_LIT << " " << uid3 << endl;
-			t << "#endif //" << headerGuard << endl;
-			printf("Generated: ");
-			printf((QFileInfo(fth).absoluteFilePath()).toLocal8Bit().data() );
-			printf("\n");
-	    }else{
-			printf("Not generated: ");
-			printf((QFileInfo(fth).absoluteFilePath()).toLocal8Bit().data() );
-			printf(" - Error %d\n",fth.error());
-		}
-	}else{
-		printf("Not generated: ");
-		printf((QFileInfo(fth).absoluteFilePath()).toLocal8Bit().data() );
-		printf(" - File exists\n");					
-	}
-	
-    QFile ft(outputSourceFileName);
-	if(!ft.exists()){
-	    if(ft.open(QIODevice::WriteOnly)) {
-	        QTextStream t(&ft);
-	        t << "// ============================================================================" << endl;
-	        t << "// Generated by xqecom on " << QDateTime::currentDateTime().toString() << endl;
-	        t << "// This file is generated by xqecom and should not be modified by the user." << endl;
-	        t << "// ============================================================================" << endl;
-	        t << endl;
-	        
-			t << "#include <xqplugin.h>" << endl;
-	        t << "#include <" << outputHeaderFileName << ">" << endl;
-	        t << "#include <ecom/implementationproxy.h>" << endl;
-	        t << "XQ_PLUGIN_ECOM_HEADER(" << appName << ")" << endl;
-	        //t << "const TImplementationProxy implementationTable[] = \n\t{\n\tIMPLEMENTATION_PROXY_ENTRY( " << IMPLEMENTATION_UID_LIT << ", C" 
-			
-			t << "const TImplementationProxy implementationTable[] = \n\t{\n\tIMPLEMENTATION_PROXY_ENTRY(" << uid3 << ", C" 
-			  << appName
-	          <<"Factory::NewL)\n\t};" << endl << endl;
-			  
-	        t << "EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)"
-	          << endl <<"\t{\n\taTableCount = sizeof( implementationTable ) / sizeof( TImplementationProxy );"
-	          << endl <<"\treturn implementationTable;"
-	          << endl <<"\t}" << endl;
-			printf("Generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf("\n");
-	    }else{
-			printf("Not generated: ");
-			printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-			printf(" - Error %d\n",ft.error());
-		}
-	}else{
-		printf("Not generated: ");
-		printf((QFileInfo(ft).absoluteFilePath()).toLocal8Bit().data() );
-		printf(" - File exists\n");					
-	}
-}
-
-int main(int argc, char *argv[])
-{
-    QStringList params;
-    for (int i=0 ; i < argc ; i++) {
-        params << QString::fromLatin1(argv[i]);
-//		printf(argv[i]);
-//		printf("\n");
-//		fprintf(stderr, "%s\n",argv[i]);
-   }
-	if (params.count() < 6) {
-        fprintf(stderr, "xqecom error: invalid parameters(%d)! ",params.count());
-        fprintf(stderr, "Usage: xqecom <app name> <uid3> <interface name> <configuration> <configuration-filename>\n");
-        return 1;
-    }
-	
-	if ( !params[2].startsWith(QString::fromLatin1("0x")) ){ //fix uid if incorrect
-		params[2].insert( 0, QString::fromLatin1("0x"));
-	}
-
-    printf("xqecom:\n");
-	runRSSFileGenerator(params);
-	runXQPkgGenerator(params);
-	runXQIbyGenerator(params);
-	runXQStubGenerator(params);
-	
-	printf("\n");	
-	return 0;
-}
--- a/qtecomplugins/xqecom/xqecom.pro	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-# All rights reserved.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, version 2.1 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program.  If not, 
-# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
-#
-# Description:
-#
-
-TARGET = xqecom
-CONFIG += console
-CONFIG -= app_bundle
-TEMPLATE = app
-
-QT -= gui
-QT -= core
-
-QPRO_PWD   = $$PWD
-
-DESTDIR = /epoc32/tools/
-#$$[QT_INSTALL_BINS]$${DIR_SEPARATOR}
-#QTSOURCEDIR = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}..$${DIR_SEPARATOR}src
-#QTINCLUDEDIR = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}..$${DIR_SEPARATOR}include
-
-QTSOURCEDIR = $${DIR_SEPARATOR}sf$${DIR_SEPARATOR}mw$${DIR_SEPARATOR}qt$${DIR_SEPARATOR}src
-QTINCLUDEDIR = $${DIR_SEPARATOR}sf$${DIR_SEPARATOR}mw$${DIR_SEPARATOR}qt$${DIR_SEPARATOR}include
-
-
-# QT_BUILD_QMAKE QT_BOOTSTRAPPED
-
-DEFINES += 	QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_PCRE \
-	       	  QT_NODLL QT_NO_STL QT_NO_COMPRESS HAVE_QCONFIG_CPP \
-	       	  QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT QT_NO_DATASTREAM \
-		        QT_NO_LIBRARY QT_BOOTSTRAPPED
-
-INCPATH += $$QTINCLUDEDIR $$QTINCLUDEDIR/QtCore
-
-SOURCES += main.cpp 
-
-include(../bootstrap/bootstrap.pri)
-      
-DEFINES *= QT_NO_QOBJECT
-    
\ No newline at end of file
--- a/qthighway/bin/README.txt	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/bin/README.txt	Thu May 27 13:42:11 2010 +0300
@@ -1,5 +1,11 @@
-XQ Service registration application
+XQ Service registration
+
+For original SERVICE_INFO's opaque_data format (Deprecated starting from wk20)
+- Copy service.prf file in the folder \epoc32\tools\qt\mkspecs\features\symbian.
+The setserviceprf.cmd does this for you.
 
-Copy service.prf file in the folder \epoc32\tools\qt\mkspecs\features\symbian.
-Copy xqsreg.exe file in the foldet \epoc32\tools or whatever folder that is in the envriromen variable PATH.
+For new SERVICE_INFO's opaque_data format
+- Copy service2.prf file to \epoc32\tools\qt\mkspecs\features\symbian\service.prf
+The setserviceprf2.cmd does this for you.
 
+Note !  The QtHighway MCL wk20 supports both the formats.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/bin/service2.prf	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,21 @@
+!exists($$_PRO_FILE_PWD_/$$SERVICE.FILE) {
+    error("Missing service configuration file '$$_PRO_FILE_PWD_/$$SERVICE.FILE'")
+} else {
+    XQSRESOURCE_FILE_TAIL = _reg.rss
+    XQSRESOURCE_FILE = $$TARGET$$XQSRESOURCE_FILE_TAIL
+
+    SERVICE_DETAILS = $$cat( $$_PRO_FILE_PWD_/$$SERVICE.FILE)
+    SERVICE_DETAILS = $$escape_expand($$SERVICE_DETAILS)
+    SERVICE_DETAILS ~= s/\"/\\\"/
+
+    # The below four section will be removed in the nearest future
+    contains (SERVICE.OPTIONS, embeddable) { RSS_RULES *= "embeddability = KAppEmbeddable;" }	
+    contains (SERVICE.OPTIONS, hidden)     { RSS_RULES *= "hidden = KAppIsHidden;" }
+
+    RSS_RULES *= "newfile = KAppDoesNotSupportNewFile;"
+
+    RSS_RULES.header *= "$${LITERAL_HASH}include <xqserviceipcconst.h>"
+    RSS_RULES.header *= "$${LITERAL_HASH}include <eikon.rh>"
+    RSS_RULES.service_list += "uid = KXQServiceUid2; datatype_list = {}; opaque_data = r_service_configuration_reg;"
+    RSS_RULES.footer += "RESOURCE TBUF r_service_configuration_reg " {" buf = \"$$SERVICE_DETAILS\""; " }" 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/bin/setserviceprf.cmd	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,2 @@
+rem Switch to service.prf
+copy /y service.prf \epoc32\tools\qt\mkspecs\features\symbian
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/bin/setserviceprf2.cmd	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,2 @@
+rem Switch to service2.prf
+copy /y service2.prf \epoc32\tools\qt\mkspecs\features\symbian\service.prf
--- a/qthighway/bwins/xqserviceutilu.def	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/bwins/xqserviceutilu.def	Thu May 27 13:42:11 2010 +0300
@@ -77,4 +77,7 @@
 	?isRunning@XQServiceManager@@QBE_NABVXQAiwInterfaceDescriptor@@@Z @ 76 NONAME ; bool XQServiceManager::isRunning(class XQAiwInterfaceDescriptor const &) const
 	?setForeground@XQRequestInfo@@QAEX_N@Z @ 77 NONAME ; void XQRequestInfo::setForeground(bool)
 	?isForeground@XQRequestInfo@@QBE_NXZ @ 78 NONAME ; bool XQRequestInfo::isForeground(void) const
+	?channelName@XQRequestUtil@@SA?AVQString@@ABV2@@Z @ 79 NONAME ; class QString XQRequestUtil::channelName(class QString const &)
+	?findFirstInterface@XQServiceManager@@QBE?AV?$QList@VXQAiwInterfaceDescriptor@@@@ABVQString@@@Z @ 80 NONAME ; class QList<class XQAiwInterfaceDescriptor> XQServiceManager::findFirstInterface(class QString const &) const
+	?findFirstInterface@XQServiceManager@@QBE?AV?$QList@VXQAiwInterfaceDescriptor@@@@ABVQString@@0@Z @ 81 NONAME ; class QList<class XQAiwInterfaceDescriptor> XQServiceManager::findFirstInterface(class QString const &, class QString const &) const
 
--- a/qthighway/eabi/xqserviceutilu.def	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/eabi/xqserviceutilu.def	Thu May 27 13:42:11 2010 +0300
@@ -92,4 +92,7 @@
 	_ZNK16XQServiceManager9isRunningERK24XQAiwInterfaceDescriptor @ 91 NONAME
 	_ZN13XQRequestInfo13setForegroundEb @ 92 NONAME
 	_ZNK13XQRequestInfo12isForegroundEv @ 93 NONAME
+	_ZN13XQRequestUtil11channelNameERK7QString @ 94 NONAME
+	_ZNK16XQServiceManager18findFirstInterfaceERK7QString @ 95 NONAME
+	_ZNK16XQServiceManager18findFirstInterfaceERK7QStringS2_ @ 96 NONAME
 
--- a/qthighway/examples/appmgrclient/src/appmgrclient.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/examples/appmgrclient/src/appmgrclient.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,6 +45,8 @@
 
 #include <XQSharableFile.h>
 
+// Include declarations to see if any compilation issues
+#include <xqaiwdecl.h>
 #include <xqaiwdeclplat.h>
 
 #include "appmgrservices.h"
@@ -212,6 +214,7 @@
         *req = appmgr.create(interface, operation);
         if (!*req)
         {
+            qDebug() << mAppName << " Last error=" << appmgr.lastError();
             return;
         }
         connectSignals(*req);        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qthighway/examples/serviceapp/service_conf_long.xml	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+  <name>serviceapp</name>
+  <filepath>No path</filepath>
+  <description>Telephony service</description>
+  <interface>
+     <name>Dialer</name>
+     <version>1.0</version>
+     <description>Interface which may do something</description>
+     <customproperty key="aiw_status">0x00000001</customproperty>
+     <customproperty key="deprecatedsn">com.nokia.services.serviceapp</customproperty>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.IUriView</name>
+     <version>1.0</version>
+     <description>Interface for showing URIs</description>
+     <customproperty key="schemes">testto</customproperty>
+     <customproperty key="deprecatedsn">com.nokia.services.serviceapp</customproperty>
+  </interface>
+  <interface>
+     <name>com.nokia.symbian.IFileView</name>
+     <version>1.0</version>
+     <description>Interface for showing Files</description>
+     <customproperty key="deprecatedsn">com.nokia.services.serviceapp</customproperty>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.ITest1</name>
+     <version>1.0</version>
+     <description>Interface for testing</description>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.ITest2</name>
+     <version>1.0</version>
+     <description>Interface for testing</description>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.ITest3</name>
+     <version>1.0</version>
+     <description>Interface for testing</description>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.ITest4</name>
+     <version>1.0</version>
+     <description>Interface for testing</description>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.ITest5</name>
+     <version>1.0</version>
+     <description>Interface for testing</description>
+   </interface>
+  <interface>
+     <name>com.nokia.symbian.ITest6</name>
+     <version>1.0</version>
+     <description>Interface for testing</description>
+   </interface>
+</service>
\ No newline at end of file
--- a/qthighway/examples/serviceapp/serviceapp.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/examples/serviceapp/serviceapp.pro	Thu May 27 13:42:11 2010 +0300
@@ -23,7 +23,7 @@
 
 CONFIG += service
 
-symbian:TARGET.UID3 = 0xE0022E73
+symbian:TARGET.UID3 = 0xE0022E78
 
 XQSERVICE_ROOT=../..
 include(../../xqservicebase.pri)
@@ -50,4 +50,3 @@
   "          type = \"text/plain\";" \
   "          }" \
   "      };" \
-
--- a/qthighway/examples/serviceapp/src/serviceapp.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/examples/serviceapp/src/serviceapp.cpp	Thu May 27 13:42:11 2010 +0300
@@ -148,6 +148,10 @@
     {
         mDialService->complete(mNumber->text());
     }
+    if (mNewDialService && mNewDialService->asyncAnswer())
+    {
+        mNewDialService->complete(mNumber->text());
+    }
 }
 
 
@@ -158,6 +162,10 @@
     {
         mUriService->complete(true);
     }
+    if (mNewUriService && mNewUriService->asyncAnswer())
+    {
+        mNewUriService->complete(true);
+    }
 }
 
 void ServiceApp::answerFile()
@@ -167,6 +175,10 @@
     {
         mFileService->complete(true);
     }
+    if (mNewFileService && mNewFileService->asyncAnswer())
+    {
+        mNewFileService->complete(true);
+    }
 }
 
 
@@ -237,7 +249,7 @@
     int ret = 0;
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
     else
@@ -453,7 +465,7 @@
     int ret = 0;
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
     else
@@ -672,7 +684,7 @@
     mServiceApp->setLabelNumber(label,param);
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
     
@@ -748,7 +760,7 @@
     mServiceApp->setLabelNumber(label,param);
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
 
@@ -816,7 +828,7 @@
     mServiceApp->setLabelNumber(label,param);
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
     
@@ -849,7 +861,7 @@
     mServiceApp->setLabelNumber(label,param);
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
     return true;
@@ -918,7 +930,7 @@
     mServiceApp->setLabelNumber(label,param);
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
 
@@ -951,7 +963,7 @@
     mServiceApp->setLabelNumber(label,param);
     if (asyncAnswer)
     {
-        mAsyncReqIds.insert(info.clientSecureId(), setCurrentRequestAsync());
+        mAsyncReqIds.insertMulti(info.clientSecureId(), setCurrentRequestAsync());
         connect(this, SIGNAL(clientDisconnected()), this, SLOT(handleClientDisconnect()));
     }
     return true;
--- a/qthighway/inc/xqrequestutil.h	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/inc/xqrequestutil.h	Thu May 27 13:42:11 2010 +0300
@@ -67,6 +67,7 @@
     void setSecurityInfo(const quint32 sid, const quint32 vid, const quint32 caps );
     const XQSharableFile *getSharableFile(int index) const;
     static int mapError(int error);
+    static QString channelName(const QString &connectionName);
         
     public:
         XQAiwInterfaceDescriptor mDescriptor;  // Contains e.g. service and interface name 
--- a/qthighway/inc/xqserviceipcconst.h	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/inc/xqserviceipcconst.h	Thu May 27 13:42:11 2010 +0300
@@ -22,7 +22,10 @@
 #ifndef XQ_SERVICEIPCCONST_H
 #define XQ_SERVICEIPCCONST_H
 
-// This UID has been officially allocated
+// The UID for the service.prf (old format needing xqsreg tool)
 #define KXQServiceUid    0x2002A535
 
+// UID for the new service2.prf  (new format)
+#define KXQServiceUid2 0x2002EAD4
+
 #endif //XQ_SERVICEIPCCONST_H
--- a/qthighway/xqservice/src/api_headers.pri	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/api_headers.pri	Thu May 27 13:42:11 2010 +0300
@@ -22,10 +22,10 @@
 				src/xqservicerequest.h \
 				src/xqserviceprovider.h \
 				src/xqserviceipcmarshal.h \
-				src/../../inc/xqserviceglobal.h \
-				src/../../inc/xqserviceipcconst.h \
-				src/../../inc/xqserviceclientinfo.h \
-				src/../../inc/xqserviceerrdefs.h \
+				../inc/xqserviceglobal.h \
+				../inc/xqserviceipcconst.h \
+				../inc/xqserviceclientinfo.h \
+				../inc/xqserviceerrdefs.h \
 				src/xqaiwglobal.h \
 				src/xqaiwrequest.h \
 				src/xqappmgr.h \
--- a/qthighway/xqservice/src/xqaiwdecl.h	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/xqaiwdecl.h	Thu May 27 13:42:11 2010 +0300
@@ -49,19 +49,32 @@
  Image fetching interface and related operations
 */
 #define XQI_IMAGE_FETCH QLatin1String("com.nokia.symbian.IImageFetch")
-#define XQOP_IMAGE_FETCH QLatin1String("fetch(void)")
+#define XQOP_IMAGE_FETCH QLatin1String("fetch()")
 
 /*!
  Music fetching interface and related operations
 */
 #define XQI_MUSIC_FETCH QLatin1String("com.nokia.symbian.IMusicFetch")
-#define XQOP_MUSIC_FETCH QLatin1String("fetch(void)")
+#define XQOP_MUSIC_FETCH QLatin1String("fetch()")
+
+/*!
+ Tones fetching interface and related operations
+*/
+#define XQI_TONE_FETCH QLatin1String("com.nokia.symbian.IToneFetch")
+#define XQOP_TONE_FETCH QLatin1String("fetch()")
 
 /*!
  Video fetching interface and related operations
 */
 #define XQI_VIDEO_FETCH QLatin1String("com.nokia.symbian.IVideoFetch")
-#define XQOP_VIDEO_FETCH QLatin1String("fetch(void)")
+#define XQOP_VIDEO_FETCH QLatin1String("fetch()")
+
+/*!
+ Video collection browser interface and related operations
+*/
+#define XQI_VIDEO_BROWSE QLatin1String("com.nokia.symbian.IVideoBrowse")
+#define XQOP_VIDEO_BROWSE QLatin1String("browseVideos(int, int)")
+
 
 /*!
  Camera capture interface and related operations
@@ -82,6 +95,16 @@
 #define XQCAMERA_INDEX_SWITCH QLatin1String("AllowCameraSwitch")
 #define XQCAMERA_QUALITY_CHANGE QLatin1String("AllowQualityChange")
 
+/*!
+ Incomplete list of interfaces.
+ To be completed with operation signatures and related declarations.
+*/
+#define XQI_LOG_VIEW QLatin1String("com.nokia.symbian.ILogView")
+#define XQI_CONTACT_VIEW QLatin1String("com.nokia.symbian.IContactView")
+#define XQI_CONTACT_FETCH QLatin1String("com.nokia.symbian.IContactFetch")
+#define XQI_FILE_FETCH QLatin1String("com.nokia.symbian.IFileFetch")
+#define XQI_FILE_SHARE QLatin1String("com.nokia.symbian.IFileShare")
+
 // Public URI related constants
 /*!
  The scheme of the activity URI
--- a/qthighway/xqservice/src/xqaiwdeclplat.h	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/xqaiwdeclplat.h	Thu May 27 13:42:11 2010 +0300
@@ -44,6 +44,38 @@
 #define XQI_RADIO_MONITOR QLatin1String("com.nokia.symbian.IRadioMonitor")
 #define XQOP_RADIO_MONITOR QLatin1String("requestNotifications(void)")
 
+/*!
+ WLAN sniffer interface and operations for
+ the WLAN Sniffer list view. 
+*/
+#define XQI_WLAN_SNIFFER  QLatin1String("com.nokia.symbian.IWlanSniffer")
+#define XQOP_WLAN_SNIFFER  QLatin1String("listView(void)")
+
+
+/*!
+ Incomplete list of interfaces.
+ To be completed with operation signatures and related declarations.
+*/
+#define XQI_EMAIL_INBOX_VIEW  QLatin1String("com.nokia.symbian.IEmailInboxView")
+#define XQOP_EMAIL_INBOX_VIEW  QLatin1String("displayInboxByMailboxId(QVariant)")
+
+#define XQI_EMAIL_MESSAGE_VIEW   QLatin1String("com.nokia.symbian.IEmailMessageView")
+#define XQOP_EMAIL_MESSAGE_VIEW   QLatin1String("viewMessage(QVariant,QVariant,QVariant)")
+
+#define XQI_EMAIL_MESSAGE_SEND   QLatin1String("com.nokia.symbian.IEmailMessageSend")
+#define XQOP_EMAIL_MESSAGE_SEND   QLatin1String("send(QMap)")
+
+#define XQI_EMAIL_REGISTER_ACCOUNT   QLatin1String("com.nokia.symbian.IEmailRegisterAccount")
+#define XQOP_EMAIL_REGISTER_ACCOUNT   QLatin1String("registerNewMailbox(quint64,QString,QString)")
+#define XQOP_EMAIL_UPDATE_MAILBOX   QLatin1String("updateMailboxName(quint64,QString)")
+#define XQOP_EMAIL_UNREGISTER_MAILBOX   QLatin1String("unregisterMailbox(quint64)")
+
+#define XQI_EMAIL_MAILBOX_CONFIGURE   QLatin1String("com.nokia.symbian.IEmailMailboxConfigure")
+#define XQOP_EMAIL_MAILBOX_CONFIGURE   QLatin1String("launchWizard(QVariant)")
+
+#define XQI_CALL_DIAL   QLatin1String("com.nokia.symbian.ICallDial")
+#define XQI_DTMF_PLAY   QLatin1String("com.nokia.symbian.IDtmfPlay ")
+
 // Platform service related constants
 
 #endif
--- a/qthighway/xqservice/src/xqappmgr_p.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/xqappmgr_p.cpp	Thu May 27 13:42:11 2010 +0300
@@ -61,9 +61,9 @@
 
     QList<XQAiwInterfaceDescriptor> impls;
     if (service.isEmpty())
-        impls = serviceMgr->findInterfaces(interface);
+        impls = serviceMgr->findFirstInterface(interface);
     else
-        impls = serviceMgr->findInterfaces(service, interface);
+        impls = serviceMgr->findFirstInterface(service, interface);
 
     // Pick up the first implementation
     if (impls.count())
--- a/qthighway/xqservice/src/xqserviceipcclient.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/xqserviceipcclient.cpp	Thu May 27 13:42:11 2010 +0300
@@ -134,9 +134,16 @@
         return true;
         }
 #endif
-		
+
+    // Attension.
+    // The 'mIpcConName' may contai the unique session identifier to separate connections using the same
+    // By default server name is the same as the channel name.
+    // When embedded launch, we add the server process ID to name to make it unique
+    QString serverName = XQRequestUtil::channelName(mIpcConName);
+    
     if (!serviceIpc) {
-        XQSERVICE_DEBUG_PRINT("New serviceIpc:mIpcConName=%s", qPrintable(mIpcConName));
+        XQSERVICE_DEBUG_PRINT("New serviceIpc:mIpcConName=%s,serverName=%s",
+                              qPrintable(mIpcConName), qPrintable(serverName));
         
         serviceIpc = new ServiceFwIPC(this, ESymbianApaServer);
         serviceIpc->setUserData(mUserData); // Attach user data, if any, to request
@@ -145,30 +152,36 @@
         
         connect(serviceIpc, SIGNAL(error(int)), this, SLOT(clientError(int)));
         connect(serviceIpc, SIGNAL(readyRead()), this, SLOT(readyRead()));
-        XQSERVICE_DEBUG_PRINT("embedded: %d", embedded);
+        XQSERVICE_DEBUG_PRINT("\tembedded: %d", embedded);
         if (embedded) {
-            // You can have only one embedded service in use at a time !!!
-            // Start application in embedded mode (add process ID to connection name !)
             quint64 processId=0;
-            bool ret = serviceIpc->startServer(mIpcConName,"", processId, ServiceFwIPC::EStartInEmbeddedMode);
+            // Embedded server launch.
+            // Server executable is always started with common name.
+            // The server has to add the it's process ID to server names when creating Symbian server names to
+            // be connected to. That's how client and server can establish unique connection.
+            // 
+            bool ret = serviceIpc->startServer(serverName,"", processId, ServiceFwIPC::EStartInEmbeddedMode);
             XQSERVICE_DEBUG_PRINT("ret: %d", ret);
             if (ret && (processId > 0)) {
-                QString conName = mIpcConName + "." + QString::number(processId);
-                XQSERVICE_DEBUG_PRINT("conName: %s", qPrintable(conName));
+                // 
+                // Start application in embedded mode. Add process ID to server name to make
+                // server connection unique.
+                serverName  = serverName  + "." + QString::number(processId);
+                XQSERVICE_DEBUG_PRINT("Try connect to embedded service: %s", qPrintable(serverName));
                 retryCount = 0;
-                while (!serviceIpc->connect(conName) && retryCount < retryToServerMax) {
+                while (!serviceIpc->connect(serverName) && retryCount < retryToServerMax) {
                     XQSERVICE_DEBUG_PRINT("retryCount: %d", retryCount+1);
                     ++retryCount;
                     wait(200);
                 }
                 if (retryCount == retryToServerMax) {
-                    XQSERVICE_DEBUG_PRINT("Couldn't connect new");
+                    XQSERVICE_DEBUG_PRINT("Couldn't connect to embedded server");
                     XQService::serviceThreadData()->setLatestError(ServiceFwIPC::EConnectionError);  // Set error also
                     processId = 0;
                 }
             }
             if (!processId) {
-                XQSERVICE_WARNING_PRINT("Could not connect to the service %s", qPrintable(mIpcConName));
+                XQSERVICE_WARNING_PRINT("Could not connect to embedded service %s", qPrintable(serverName));
                 delete serviceIpc;
                 serviceIpc = NULL;
                 return false;                
@@ -176,26 +189,29 @@
             XQSERVICE_DEBUG_PRINT("Embedded connection created");
         }
         else {
-            if (!serviceIpc->connect(mIpcConName)) {
-                XQSERVICE_DEBUG_PRINT("Trying to start server");
+            // Not embedded 
+            XQSERVICE_DEBUG_PRINT("Use existing serviceIpc:mIpcConName=%s, serverName=%s",
+                                  qPrintable(mIpcConName), qPrintable(serverName));
+            if (!serviceIpc->connect(serverName)) {
+                XQSERVICE_DEBUG_PRINT("Trying to start server %s", qPrintable(serverName));
                 quint64 processId=0;
-                bool ret=serviceIpc->startServer(mIpcConName,"",processId);
-                XQSERVICE_DEBUG_PRINT("ret: %d", ret);
+                bool ret=serviceIpc->startServer(serverName,"",processId);
+                XQSERVICE_DEBUG_PRINT("starServer ret=%d", ret);
                 if (ret && (processId > 0)) {
                     retryCount = 0;
-                    while (!serviceIpc->connect(mIpcConName) && retryCount < retryToServerMax) {
+                    while (!serviceIpc->connect(serverName) && retryCount < retryToServerMax) {
                         XQSERVICE_DEBUG_PRINT("retryCount: %d", retryCount+1);
                         ++retryCount;
                         wait(200);
                     }
                     if (retryCount == retryToServerMax) {
-                        XQSERVICE_DEBUG_PRINT("Couldn't connect");
+                        XQSERVICE_DEBUG_PRINT("Couldn't connect to server");
                         XQService::serviceThreadData()->setLatestError(ServiceFwIPC::EConnectionError);  // Set error also
                         processId = 0;
                     }
                 }
                 if (!processId) {
-                    XQSERVICE_WARNING_PRINT("Could not connect to the service %s", qPrintable(mIpcConName));
+                    XQSERVICE_WARNING_PRINT("Could not connect to the service %s", qPrintable(serverName));
                     delete serviceIpc;
                     serviceIpc = NULL;
                     return false;                
@@ -280,7 +296,7 @@
         // Valid only upon sendCommand call
         cancelledRequest = aRequest; 
         
-        //Attention! At the moment channel name and connection name are the same
+        //Attention! At the moment in server side channel name and connection name are the same
         // it might be that in the future will be different then this is not valid anymore.
         XQServiceChannel::sendCommand(mIpcConName,XQServiceChannel::ClientDisconnected);
 
@@ -373,8 +389,16 @@
                               int cmd)
 {
     XQSERVICE_DEBUG_PRINT("XQServiceIpcClient::send, isServer?=%d", server);
-    XQSERVICE_DEBUG_PRINT("\tch: %s, msg: %s", qPrintable(ch), qPrintable(msg));
+    
+    // Attension. The 'ch' name may contain unique session identifier to separate requests going
+    // the same channel. Before real IPC calls need to get the normalized channel name.
+    // The 'mIpcConName' contains the same session identifier to separate connections using the same
+    // channel name.
+    QString channel = XQRequestUtil::channelName(ch);
+    
+    XQSERVICE_DEBUG_PRINT("\tchannel: %s, msg: %s", qPrintable(channel), qPrintable(msg));
     XQSERVICE_DEBUG_PRINT("\tdata: %s, cmd: %d", data.constData(), cmd);
+    
     XQService::serviceThreadData()->setLatestError(KErrNone);
     if (!connectToServer()){
         XQSERVICE_DEBUG_PRINT("\tCouldn't connect to the server");
@@ -383,12 +407,12 @@
 
 #ifdef QT_S60_AIW_PLUGIN
     if (plugin) {     
-        QVariant ret=XQServiceChannel::sendLocally(ch, msg, data);     
+        QVariant ret=XQServiceChannel::sendLocally(channel, msg, data);     
         retData = XQServiceThreadData::serializeRetData(ret, XQService::serviceThreadData()->latestError());
         return true;
         }
 #endif
-    int len = ch.length() * 2 + msg.length() * 2 + data.length();
+    int len = channel.length() * 2 + msg.length() * 2 + data.length();
     len += sizeof(XQServicePacketHeader);
     XQSERVICE_DEBUG_PRINT("\tcmd: %d", len);
     int writelen;
@@ -407,12 +431,12 @@
     XQServicePacketHeader *header = (XQServicePacketHeader *)buf;
     header->command = cmd;
     header->totalLength = len;
-    header->chLength = ch.length();
+    header->chLength = channel.length();
     header->msgLength = msg.length();
     header->dataLength = data.length();
     char *ptr = buf + sizeof(XQServicePacketHeader);
-    memcpy(ptr, ch.constData(), ch.length() * 2);
-    ptr += ch.length() * 2;
+    memcpy(ptr, channel.constData(), channel.length() * 2);
+    ptr += channel.length() * 2;
     memcpy(ptr, msg.constData(), msg.length() * 2);
     ptr += msg.length() * 2;
     memcpy(ptr, data.constData(), data.length());
@@ -431,7 +455,7 @@
             {
                 // No point to send channel command on error. Error could be also
                 // caused by server exit without completing the actual request
-                sendChannelCommand(XQServiceCmd_ReturnValueDelivered,ch);
+                sendChannelCommand(XQServiceCmd_ReturnValueDelivered,channel);
             }
             else
                 ret = false;
@@ -461,6 +485,7 @@
  */
 bool XQServiceIpcClient::cancelPendingSend(const QString& ch)
 {
+    Q_UNUSED(ch);  // 
     XQSERVICE_DEBUG_PRINT("XQServiceIpcClient::cancelPendingSend, isServer?=%d", server);
     if (serviceIpc) {
         // Close the client connection silently
@@ -506,7 +531,6 @@
             delete serviceIpcServer;
             serviceIpcServer = NULL;
             XQSERVICE_DEBUG_PRINT("\tXQServiceIpcClient deleteLater");
-            deleteLater();
             wait(200);
             XQSERVICE_DEBUG_PRINT("\tXQServiceIpcClient deleteLater over");
         }
@@ -522,6 +546,7 @@
             serviceIpc = NULL;
         }
     }
+    deleteLater();
     XQSERVICE_DEBUG_PRINT("XQServiceIpcClient::disconnected END");
 }
 
@@ -593,9 +618,10 @@
             XQSERVICE_DEBUG_PRINT("before compelete async request");
             
             //should this send before compete the request ?
-            //attention at the moment channel name and connection name are the same
-            // it might be that in the future will be different then this is not valid anymore.
-            sendChannelCommand(XQServiceCmd_ReturnValueDelivered, mIpcConName);
+            //Attention ! Map mIpcConName name may contain unique identifier to separate connections using the same
+            //            channel name. So need to get channel name.
+            QString channel = XQRequestUtil::channelName(mIpcConName);
+            sendChannelCommand(XQServiceCmd_ReturnValueDelivered, channel);
             
             callBackRequestComplete->requestCompletedAsync( retValue );
             XQSERVICE_DEBUG_PRINT("After complete async request");
--- a/qthighway/xqservice/src/xqservicerequest.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/xqservicerequest.cpp	Thu May 27 13:42:11 2010 +0300
@@ -77,7 +77,7 @@
     XQServiceRequest* m_Parent;
     XQRequestUtil m_RequestUtil;
     XQServiceManager* serviceManager;
-
+    QString m_uniqueChannelName;
     
 };
 
@@ -172,8 +172,8 @@
 */
 XQServiceRequest::~XQServiceRequest()
 {
-    XQSERVICE_DEBUG_PRINT("XQServiceRequest::~XQServiceRequest=");
-    XQServiceAdaptor::cancelPendingSend(m_data->m_Service);
+    XQSERVICE_DEBUG_PRINT("XQServiceRequest::~XQServiceRequest %s", qPrintable(m_data->m_uniqueChannelName));
+    XQServiceAdaptor::cancelPendingSend(m_data->m_uniqueChannelName);
     delete m_data;
 }
 
@@ -247,13 +247,16 @@
     // This shall be removed by the server
     // !!!
     addArg(qVariantFromValue(m_data->m_RequestUtil.mInfo));
-
-    XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2):mDescriptor");
-        
+       
     // Pass always the util instance onwards as user data.
     // It can be utilized by the XQServiceManager::startServer
     // e.g. to optimize startup of a service server
-    return XQServiceAdaptor::send(m_data->m_Service,  message(), m_data->m_arguments, retData, m_data->m_Synchronous,m_data,
+
+    // Create unique channel name to separate multiple client requests to same channel name.
+    quint32 handle = (unsigned int)m_data;
+    m_data->m_uniqueChannelName = QString("%1:").arg(handle) + m_data->m_Service;
+    XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2):uniqueChannel=%s", qPrintable(m_data->m_uniqueChannelName));
+    return XQServiceAdaptor::send(m_data->m_uniqueChannelName,  message(), m_data->m_arguments, retData, m_data->m_Synchronous,m_data,
                                  (const void *)&m_data->m_RequestUtil);
 }
 /*!
--- a/qthighway/xqservice/src/xqservicethreaddata.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqservice/src/xqservicethreaddata.cpp	Thu May 27 13:42:11 2010 +0300
@@ -57,6 +57,7 @@
 XQServiceThreadData::~XQServiceThreadData()
 {
     XQSERVICE_DEBUG_PRINT("XQServiceThreadData::~XQServiceThreadData");
+    qDeleteAll(ipcConnMap);
     ipcConnMap.clear();
 }
 
--- a/qthighway/xqserviceutil/src/xqrequestutil.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqrequestutil.cpp	Thu May 27 13:42:11 2010 +0300
@@ -118,3 +118,20 @@
     return mappedError;
 
 }
+
+// connectionName=[requesthandle:]channel
+QString XQRequestUtil::channelName(const QString &connectionName)
+{
+    XQSERVICE_DEBUG_PRINT("XQRequestUtil::channelName %s", qPrintable(connectionName));
+    QString ret = connectionName;
+    QStringList l = ret.split(":");
+    if (l.count() > 1)
+    {
+        ret = l.at(1);
+    }
+
+    XQSERVICE_DEBUG_PRINT("XQRequestUtil::channelName ret=%s", qPrintable(ret));
+    return ret;
+    
+}
+   
--- a/qthighway/xqserviceutil/src/xqrequestutil.h	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqrequestutil.h	Thu May 27 13:42:11 2010 +0300
@@ -67,6 +67,7 @@
     void setSecurityInfo(const quint32 sid, const quint32 vid, const quint32 caps );
     const XQSharableFile *getSharableFile(int index) const;
     static int mapError(int error);
+    static QString channelName(const QString &connectionName);
         
     public:
         XQAiwInterfaceDescriptor mDescriptor;  // Contains e.g. service and interface name 
--- a/qthighway/xqserviceutil/src/xqservicemanager.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqservicemanager.cpp	Thu May 27 13:42:11 2010 +0300
@@ -19,17 +19,9 @@
 *
 */
 
-#include "xqservicelog.h"
-#include <xqserviceglobal.h>
-
-#include "xqrequestutil.h"
-
-#include "xqservicemanager.h"
-#include "xqserviceipcconst.h"
-#include <QCoreApplication>
 #include <e32std.h>
 #include <w32std.h>
-
+#include <apaidpartner.h>
 #include <apparc.h>
 #include <apgcli.h>
 #include <apacln.h>
@@ -39,17 +31,26 @@
 #include <coemain.h>
 
 #include <QBuffer>
+#include <QString>
+#include <QCoreApplication>
+
+#include "xqservicelog.h"
+#include <xqserviceglobal.h>
+#include "xqrequestutil.h"
+#include "xqservicemanager.h"
+#include "xqserviceipcconst.h"
+
 #include "xqservicemetadata/xqservicemetadata_p.h"
 #include <xqservicemetadata/xqaiwinterfacedescriptor.h>
+#include "xqconversions.h"
 
-#include <QString>
 
 
 class XQServiceManagerPrivate 
     {
     public:
-        XQServiceManagerPrivate() {iLatestError = 0;};
-        ~XQServiceManagerPrivate() {};
+        XQServiceManagerPrivate();
+        ~XQServiceManagerPrivate();
 
         enum matchMode
         {
@@ -59,20 +60,28 @@
         
         int StartServer(const QString& aService,  bool embedded, int& applicationUid, quint64& processId,
                        XQRequestUtil *util);
-        TInt Discover(const QString& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces, int matchMode);
+        TInt Discover(const QString& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces, int matchMode,
+                      bool findFirst=false);
         int  LatestError() const {return iLatestError;};
         bool IsRunning(const XQAiwInterfaceDescriptor& implementation) const;
         
     private:
         void StartServerL(const TUid& uid, bool embedded, TUint64& processId, XQRequestUtil *util);
-        TInt Discover(const TDesC& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces, int matchMode);
-        CApaAppServiceInfoArray* AvailableServiceImplementationsL();
+        TInt Discover(const TDesC& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces, int matchMode,
+                      bool findFirst=false);
+        TInt Discover1(const TDesC& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces, int matchMode,
+                       bool findFirst=false);
+        TInt Discover2(const TDesC& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces, int matchMode,
+                       bool findFirst=false);
+        CApaAppServiceInfoArray* AvailableServiceImplementations1L();
+        CApaAppServiceInfoArray* AvailableServiceImplementations2L();
         TUint64 getAppPid(const TUid& aAppUid);   
         int doMapErrors(TInt aError);
         
         TVersion iVersion;
         TApaAppInfo  iAppInfo;
         int iLatestError;
+        RApaLsSession iApaSession;
     };
 
 XQServiceManager::XQServiceManager()
@@ -126,7 +135,7 @@
 */
 QList<XQAiwInterfaceDescriptor>  XQServiceManager::findInterfaces ( const QString &interfaceName ) const
     {
-    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::findInterfaces");
+    XQSERVICE_DEBUG_PRINT("XQServiceManager::findInterfaces 1");
     QList<XQAiwInterfaceDescriptor> interfaces;
     TUid appUid;
     interfaces.clear();
@@ -142,7 +151,7 @@
 */
 QList<XQAiwInterfaceDescriptor>  XQServiceManager::findInterfaces ( const QString &serviceName, const QString &interfaceName ) const
 {
-    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::findInterfaces 2");
+    XQSERVICE_DEBUG_PRINT("XQServiceManager::findInterfaces 2");
     QList<XQAiwInterfaceDescriptor> interfaces;
     TUid appUid;
     interfaces.clear(); 
@@ -154,6 +163,41 @@
 
 
 /*!
+    Finds implementations for the given interface
+    \param interfaceName Interfacename to match
+    \return List of implementations
+*/
+QList<XQAiwInterfaceDescriptor>  XQServiceManager::findFirstInterface ( const QString &interfaceName ) const
+{
+    XQSERVICE_DEBUG_PRINT("XQServiceManager::findFirstInterface 1");
+    QList<XQAiwInterfaceDescriptor> interfaces;
+    TUid appUid;
+    interfaces.clear();
+    TInt error=d->Discover(interfaceName, appUid, interfaces, XQServiceManagerPrivate::MatchInterfaceName, true);
+    return interfaces;
+}
+
+/*!
+    Finds implementations for the given interface implemented by given service
+    \param serviceName Service name
+    \param interfaceName Interfacename to match
+    \return List of implementations
+*/
+QList<XQAiwInterfaceDescriptor>  XQServiceManager::findFirstInterface ( const QString &serviceName, const QString &interfaceName ) const
+{
+    XQSERVICE_DEBUG_PRINT("XQServiceManager::findFirstInterface 2");
+    QList<XQAiwInterfaceDescriptor> interfaces;
+    TUid appUid;
+    interfaces.clear(); 
+    // Catenate to get full name
+    TInt error=d->Discover(serviceName + "." + interfaceName, appUid, interfaces,
+                           XQServiceManagerPrivate::MatchServiceAndInterfaceName, true);
+    return interfaces;
+}
+
+
+
+/*!
     Returns the latest error occured
 */
 int XQServiceManager::latestError() const
@@ -170,6 +214,20 @@
     return d->IsRunning(implementation);
 }
 
+// ====== Private part ==============
+
+XQServiceManagerPrivate::XQServiceManagerPrivate()
+{
+    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::XQServiceManagerPrivate");
+    iLatestError = 0;
+    iApaSession.Connect();    
+}
+
+XQServiceManagerPrivate::~XQServiceManagerPrivate()
+{
+    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::~XQServiceManagerPrivate");
+    iApaSession.Close();
+};
 
 // aService is here the full name (service + interface)
 int XQServiceManagerPrivate::StartServer(const QString& aService,  bool embedded, int& applicationUid, quint64& processId,
@@ -194,7 +252,8 @@
     // Otherwise, go directly starting the service server
     if (appUid.iUid == 0)
     {
-        error = Discover(serverName,appUid,interfaces, XQServiceManagerPrivate::MatchServiceAndInterfaceName);
+        // Find the first implementation
+        error = Discover(serverName,appUid,interfaces, XQServiceManagerPrivate::MatchServiceAndInterfaceName, true);
     }
     if (error)
         {
@@ -215,11 +274,6 @@
     XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::StartServerL");
     Q_UNUSED(embedded);  // Not used any more. XQRequestUtil applied instead
     
-    RApaLsSession apa;
-    User::LeaveIfError( apa.Connect() );
-    CleanupClosePushL( apa );
-
-
     bool toBackground = false;
     // Apply the utility's option for embedding  instead
     bool embed = util->mInfo.isEmbedded();
@@ -229,10 +283,10 @@
     XQSERVICE_DEBUG_PRINT("\tbackground got from utility=%d", toBackground);
 
     // retrieve application information
-    User::LeaveIfError( apa.GetAppInfo( iAppInfo, uid ) );
+    User::LeaveIfError( iApaSession.GetAppInfo( iAppInfo, uid ) );
 
     TApaAppCapabilityBuf caps;
-    User::LeaveIfError(apa.GetAppCapability(caps, uid));
+    User::LeaveIfError(iApaSession.GetAppCapability(caps, uid));
     if (!toBackground)
     {
         // If service wants to be launched to background.. respect it
@@ -293,7 +347,7 @@
         TRequestStatus requestStatusForRendezvous;
         
         // start application with command line parameters
-        //User::LeaveIfError( apa.StartApp( *cmdLine, threadId, &requestStatusForRendezvous) );
+        //User::LeaveIfError( iApaSession.StartApp( *cmdLine, threadId, &requestStatusForRendezvous) );
         QString startupArgs = QString::fromLatin1(XQServiceUtils::StartupArgService);
         if (embed)
         {
@@ -336,7 +390,6 @@
         XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::Done"); 
         }
     
-    CleanupStack::PopAndDestroy( &apa ); // ap
 }
 
 
@@ -357,39 +410,69 @@
     }
     return pid;
 }
-CApaAppServiceInfoArray* XQServiceManagerPrivate::AvailableServiceImplementationsL()
+
+CApaAppServiceInfoArray* XQServiceManagerPrivate::AvailableServiceImplementations1L()
 {
-    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::AvailableServiceImplementationsL");
-    RApaLsSession ls;
-    User::LeaveIfError( ls.Connect() );
-    CleanupClosePushL( ls );
+    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::AvailableServiceImplementations1L");
     // retrieve list of available services implementations from apparc
     CApaAppServiceInfoArray* apaInfo = 
-                    ls.GetServiceImplementationsLC(TUid::Uid(KXQServiceUid));
+                    iApaSession.GetServiceImplementationsLC(TUid::Uid(KXQServiceUid));
     CleanupStack::Pop( apaInfo );
-    CleanupStack::PopAndDestroy( &ls );
+    return apaInfo;
+}
+
+CApaAppServiceInfoArray* XQServiceManagerPrivate::AvailableServiceImplementations2L()
+{
+    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::AvailableServiceImplementations2L");
+    // retrieve list of available services implementations from apparc
+    CApaAppServiceInfoArray* apaInfo = 
+                    iApaSession.GetServiceImplementationsLC(TUid::Uid(KXQServiceUid2));
+    CleanupStack::Pop( apaInfo );
     return apaInfo;
 }
 
 TInt XQServiceManagerPrivate::Discover(const QString& aService,TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces,
-                                      int matchMode)
+                                      int matchMode, bool findFirst)
     {
     TPtrC serverName( reinterpret_cast<const TUint16*>(aService.utf16()) );
-    TInt error=Discover(serverName, aAppUid, interfaces, matchMode);
+    TInt error=Discover(serverName, aAppUid, interfaces, matchMode, findFirst);
     XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::Discover (1)");
     return error;
     }
 
-
 TInt XQServiceManagerPrivate::Discover( const TDesC& aService,
                                       TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces,
-                                      int matchMode)
+                                      int matchMode, bool findFirst)
     {
     XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::Discover (2)");
+    TInt discoverResult1 = KErrNotFound;
+    TInt discoverResult2 = KErrNotFound;
+
+    // Discover first possible reg files with old format
+    discoverResult1 = Discover1(aService, aAppUid, interfaces, matchMode, findFirst);
+    // Discover then  reg files with new format (add results)
+    discoverResult2 = Discover2(aService, aAppUid, interfaces, matchMode, findFirst);
+    
+    if (discoverResult1 == KErrNone || discoverResult2 == KErrNone)
+        {
+        // Results merged
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+
+TInt XQServiceManagerPrivate::Discover1( const TDesC& aService,
+                                      TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces,
+                                      int matchMode, bool findFirst)
+    {
+    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::Discover1");
         
     CApaAppServiceInfoArray* apaInfo = NULL;
     TInt error = KErrNone;
-    TRAP(error, apaInfo = AvailableServiceImplementationsL());
+    TRAP(error, apaInfo = AvailableServiceImplementations1L());
     XQSERVICE_DEBUG_PRINT("Discover status=%d", error);
     if (error)
         {
@@ -406,6 +489,8 @@
     TBool found( EFalse );
     QString serviceName = QString::fromUtf16(aService.Ptr(),aService.Length());
     XQSERVICE_DEBUG_PRINT("serviceName: %s", qPrintable(serviceName));
+    TBool firstUidPicked(EFalse);
+    
     for ( TInt ii = 0; ii < implArray.Count(); ii++ )  
         {
 
@@ -480,7 +565,6 @@
             // Go through all interfaces and pick the UI for the first matching one.
             // THIS NEED TO BE FIXED IF SOMEONE WANTS DEDICATED IMPLEMENTATION
             // Fill in the implementationId for all interfaces
-            TBool firstUidPicked(EFalse);
             foreach (XQAiwInterfaceDescriptor interface,results.interfaces)
                 {
                 QString sn;
@@ -547,12 +631,21 @@
         else
             {
              error = metaData->getLatestError();
+             iLatestError = error;
              XQSERVICE_DEBUG_PRINT("metadata error: %d", error); 
             }  
         
         delete metaData;
         metaData = NULL;
         res.Close();
+
+
+        // If only first found needed, quit the loop.
+        if (findFirst && firstUidPicked)
+            {
+            XQSERVICE_DEBUG_PRINT("First service returned UID3=%x", aAppUid.iUid);
+            break;
+            }
         
         } // for implArray ...
     
@@ -561,6 +654,166 @@
         {
         error = KErrNotFound;
         }
+    if (found)
+        {
+        error = KErrNone;
+        }
+    
+    XQSERVICE_DEBUG_PRINT("Discover error: %d", error);
+    
+    return error;
+    }
+
+
+TInt XQServiceManagerPrivate::Discover2( const TDesC& aService,
+                                      TUid& aAppUid, QList<XQAiwInterfaceDescriptor>& interfaces,
+                                      int matchMode, bool findFirst)
+    {
+    XQSERVICE_DEBUG_PRINT("XQServiceManagerPrivate::Discover2");
+        
+    CApaAppServiceInfoArray* apaInfo = NULL;
+    TInt error = KErrNone;
+    
+    TRAP(error, apaInfo = AvailableServiceImplementations2L());
+    XQSERVICE_DEBUG_PRINT("Discover status=%d", error);
+    
+    if (error)
+        {
+        return error;  // This is fatal as nothing found
+        }
+    TArray<TApaAppServiceInfo> implArray( apaInfo->Array() );
+    XQSERVICE_DEBUG_PRINT("implArray.Count(): %d", implArray.Count());
+    
+    if ( !implArray.Count() )
+        {
+        delete apaInfo;
+        return KErrNotFound;   // No services found
+        }
+    
+    TBool found( EFalse );
+    
+    QString serviceName = QString::fromUtf16(aService.Ptr(),aService.Length());
+    XQSERVICE_DEBUG_PRINT("serviceName: %s", qPrintable(serviceName));
+    TBool firstUidPicked(EFalse);
+
+    for ( TInt ii = 0; ii < implArray.Count(); ii++ )  
+        {
+        TUid uid = implArray[ii].Uid();
+        XQSERVICE_DEBUG_PRINT("implArray[%d].UID=%x", ii, uid);
+
+        QByteArray xmlConf ;
+
+        TPtrC8 opaque = implArray[ii].OpaqueData();
+        const TPtrC16 tmpXml((TText16*) opaque.Ptr(),(opaque.Length()+1)>>1);
+        QString strXml = XQConversions:: s60DescToQString( tmpXml ) ;
+        // XQSERVICE_DEBUG_PRINT("XML conf: %s", qPrintable(strXml));
+        XQSERVICE_DEBUG_PRINT("size of xml conf.: %d characters", strXml.size());
+        xmlConf.append(strXml.toAscii());
+        
+        XQSERVICE_DEBUG_PRINT("resource data: %s", xmlConf.constData());
+        QBuffer buf(&xmlConf);
+        ServiceMetaData* metaData = new ServiceMetaData(&buf);
+        if (metaData->extractMetadata()) 
+            {
+            ServiceMetaDataResults results=metaData->parseResults();
+
+            // Go through all interfaces and pick the UI for the first matching one.
+            // THIS NEED TO BE FIXED IF SOMEONE WANTS DEDICATED IMPLEMENTATION
+            // Fill in the implementationId for all interfaces
+            foreach (XQAiwInterfaceDescriptor interface,results.interfaces)
+                {
+                QString sn;
+                QString snDeprecated;
+                if (results.version == ServiceMetaDataResults::VERSION_1)
+                    {
+                    // Old version of the XML format. The parser took care of adaptation
+                    // discovery-name = service-name + interface name
+                    XQSERVICE_DEBUG_PRINT("version 1");
+                    }
+                else
+                    {
+                    // discovery-name = interface name
+                   XQSERVICE_DEBUG_PRINT("version 2");
+                    }
+
+                // Deprecated service name, if any
+                QString deprecatedServiceName = interface.customProperty("deprecatedsn");
+                bool deprNameExists = !deprecatedServiceName.isEmpty();
+                if (deprNameExists)
+                {
+                    XQSERVICE_DEBUG_PRINT("deprecatedServiceName: %s", qPrintable(deprecatedServiceName));
+                }
+                // This is the name used in match
+                // TODO: Version handling support: Take the latest version if multiple matches
+                switch (matchMode)
+                {
+                    case MatchInterfaceName :
+                        sn = interface.interfaceName();
+                        break;
+                    case MatchServiceAndInterfaceName :
+                        sn =interface.serviceName() + "." + interface.interfaceName();
+                        snDeprecated = deprecatedServiceName + "." + interface.interfaceName();
+                        break;
+                    default:
+                        sn = interface.interfaceName();
+                        break;
+                }
+
+                XQSERVICE_DEBUG_PRINT("compare name is: %s", qPrintable(sn));
+                XQSERVICE_DEBUG_PRINT("requested name: %s", qPrintable(serviceName));
+                if ((!serviceName.compare(sn,Qt::CaseInsensitive)) ||
+                    (deprNameExists && !serviceName.compare(snDeprecated,Qt::CaseInsensitive)))
+                    {
+                    TUid appUid = implArray[ii].Uid();
+                    if (!firstUidPicked)
+                        {
+                        aAppUid = appUid;
+                        firstUidPicked = ETrue;
+                        XQSERVICE_DEBUG_PRINT("First service found UID3=%x", appUid.iUid);
+                        }
+                    XQSERVICE_DEBUG_PRINT("Service found UID3=%x", appUid.iUid);
+                    //  Add impl. UID to interface
+                    interface.setProperty(XQAiwInterfaceDescriptor::ImplementationId, (int)aAppUid.iUid);
+                    found = ETrue;
+
+                    // Add the matched interface to result set
+                    interfaces.append(interface);
+                    }
+
+                    if (found)
+                    {
+                        error = KErrNone;
+                    }
+                } // forearch interface
+            }
+        else
+            {
+             error = metaData->getLatestError();
+             iLatestError = error;
+             XQSERVICE_DEBUG_PRINT("metadata error: %d", error); 
+            }  
+        
+        delete metaData;
+        metaData = NULL;
+
+        // If only first found needed, quit the loop.
+        if (findFirst && firstUidPicked)
+            {
+            XQSERVICE_DEBUG_PRINT("First service returned UID3=%x", aAppUid.iUid);
+            break;
+            }
+        } // for implArray ...
+    
+    delete apaInfo;
+    if (!found)
+        {
+        error = KErrNotFound;
+        }
+    
+    if (found)
+        {
+        error = KErrNone;
+        }
     
     XQSERVICE_DEBUG_PRINT("Discover error: %d", error);
     
--- a/qthighway/xqserviceutil/src/xqservicemanager.h	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqservicemanager.h	Thu May 27 13:42:11 2010 +0300
@@ -39,6 +39,8 @@
         int startServer(const QString& service, bool embedded, int& applicationUid, quint64& processId);
         QList<XQAiwInterfaceDescriptor>  findInterfaces ( const QString &interfaceName ) const;
         QList<XQAiwInterfaceDescriptor>  findInterfaces ( const QString &serviceName, const QString &interfaceName ) const;
+        QList<XQAiwInterfaceDescriptor>  findFirstInterface ( const QString &interfaceName ) const;
+        QList<XQAiwInterfaceDescriptor>  findFirstInterface ( const QString &serviceName, const QString &interfaceName ) const;
         
         // Extended starter to allow passing XQAiwInterfaceDescriptor as user data
         // The user data has been attached by the XQServiceRequest
--- a/qthighway/xqserviceutil/xqserviceutil.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qthighway/xqserviceutil/xqserviceutil.pro	Thu May 27 13:42:11 2010 +0300
@@ -41,7 +41,7 @@
 
 include(src/xqservicemetadata/xqservicemetadata.pri)
 
-LIBS+=-lapparc -lapgrfx -lws32 -lcone -lbafl -leikcore -lefsrv
+LIBS+=-lapparc -lapgrfx -lws32 -lcone -lbafl -leikcore -lefsrv -lxqutils
 
 libFiles.sources = xqserviceutil.dll
 libFiles.path = "!:\sys\bin"
--- a/qtmobileextensions/examples/examples.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobileextensions/examples/examples.pro	Thu May 27 13:42:11 2010 +0300
@@ -24,6 +24,6 @@
 SUBDIRS= settingsmanagerex \
          sysinfoex \
          utilsex \
-         keycaptureex
+         keycaptureex 
 
 symbian:BLD_INF_RULES.prj_exports += "./rom/qtmobileextensionsexamples.iby $$CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(qtmobileextensionsexamples.iby)"
--- a/qtmobileextensions/examples/rom/qtmobileextensionsexamples.iby	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobileextensions/examples/rom/qtmobileextensionsexamples.iby	Thu May 27 13:42:11 2010 +0300
@@ -44,4 +44,10 @@
 UPGRADABLE_APP_REG_RSC(KeyCaptureEx)
 */
 
+/* optional 
+S60_APP_EXE(SystemToneServiceEx)
+S60_APP_RESOURCE(SystemToneServiceEx)
+UPGRADABLE_APP_REG_RSC(SystemToneServiceEx)
+*/
+
 #endif //__QT_MOBILEEXTENSIONSEXAMPLES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/examples/systemtoneserviceex/sis/stsqt.pkg	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,42 @@
+;
+; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: System Tone Service - UDEB build
+;
+;File: systemtoneservice.pkg
+
+;Languages
+&EN
+
+;Header
+#{"System Tone Service QT"},(0x10207C90),1,0,0, TYPE=SA, RU
+
+;Series 60 v5.0
+[0x1028315F], 0,0,0, {"Series60ProductID"}
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files To Copy...<src> <destination>
+;"/epoc32/release/armv5/udeb/systemtoneservice.dll" -"!:/sys/bin/systemtoneservice.dll"
+;"/epoc32/release/armv5/udeb/stsserver.exe"         -"!:/sys/bin/stsserver.exe"
+
+"/epoc32/release/armv5/udeb/stsserver.exe"         -"!:/sys/bin/stsserver.exe"
+
+;"/epoc32/release/armv5/udeb/xqsystemtoneservice.dll"         -"!:/sys/bin/xqsystemtoneservice.dll"
+"/epoc32/release/armv5/udeb/sts_testapp.exe"         -"!:/sys/bin/sts_testapp.exe"
+"/epoc32/data/z/resource/apps/sts_testapp.rsc"    - "!:\resource\apps\sts_testapp.rsc"
+"/epoc32/data/z/private/10003a3f/import/apps/sts_testapp_reg.rsc"    - "!:\private\10003a3f\import\apps\sts_testapp_reg.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/examples/systemtoneserviceex/ststest.cpp	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,239 @@
+/*
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not,
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+*/
+
+#include <QDebug>
+#include <QApplication>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QStackedWidget>
+#include <QImageReader>
+#include <QDebug>
+#include <QTimer>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QDebug>
+#include <QString>
+#include <QCheckBox>
+
+#include <QListView>
+#include <QMap>
+#include <QAction>
+
+#include "ststest.h"
+#include <XQSystemToneService>
+
+STSTest::STSTest( QWidget *parent, Qt::WFlags f ) 
+:
+QWidget(parent, f),
+sts(new XQSystemToneService())
+{
+    callbackCleanTimer.setSingleShot(true);
+    connect(&callbackCleanTimer, SIGNAL(timeout()), this, SLOT(cleanCallback()));
+    
+    QPushButton *quitButton = new QPushButton(tr("QUIT"));
+    connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
+
+    QPushButton *playToneButton = new QPushButton(tr("Play Tone"));
+    connect(playToneButton, SIGNAL(clicked()), this, SLOT(playTone()));
+
+    QPushButton *playAlarmButton = new QPushButton(tr("Play Alarm"));
+    connect(playAlarmButton, SIGNAL(clicked()), this, SLOT(playAlarm()));
+
+    QPushButton *stopAlarmButton = new QPushButton(tr("Stop Alarm"));
+    connect(stopAlarmButton, SIGNAL(clicked()), this, SLOT(stopAlarm()));
+    
+
+    connect(sts, SIGNAL(toneStarted()), this, SLOT(startCallback()));
+    connect(sts, SIGNAL(alarmStarted(unsigned int)), this, SLOT(startCallback(unsigned int)));
+    connect(sts, SIGNAL(alarmFinished(unsigned int)), this, SLOT(stopCallback(unsigned int)));
+
+
+    box = new QComboBox();
+    spinBox = new QSpinBox();
+    
+    QVBoxLayout *vl = new QVBoxLayout;
+    QGridLayout *gl = new QGridLayout();
+    
+    vl->setMargin(10);
+    vl->setSpacing(0);
+
+//    gl->setMargin(0);
+//    gl->setSpacing(0);
+//    gl->setDefaultPositioning();
+
+    
+    QList<QPair<int, QString> > tonesList;
+    
+
+    // alarms
+    tonesList.append(QPair<int,QString>(XQSystemToneService::CalendarAlarmTone, "[A] Calendar Alarm"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::ClockAlarmTone, "[A] Clock Alarm"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::ToDoAlarmTone, "[A] ToDo Alarm"));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::IncomingCallTone, "[A] Incoming Call"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::IncomingCallLine2Tone, "[A] Incomming Call Line 2"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::IncomingDataCallTone, "[A] Incomming Data Call"));
+
+    // tones
+    tonesList.append(QPair<int,QString>(XQSystemToneService::BurstModeTone, "[T] Burst Mode"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::CaptureTone, "[T] Capture"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::CallRecordingTone, "[T] Call Recording"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::RecordingStartTone, "[T] Recording Start"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::SelfTimerTone, "[T] Self Timer"));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::ConfirmationBeepTone, "[T] Confirmation Beep"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::DefaultBeepTone, "[T] Default Beep"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::ErrorBeepTone, "[T] Error Beep"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::InformationBeepTone, "[T] Information Beep"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::WarningBeepTone, "[T] Warning Beep"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::IntegratedHandsFreeActivatedTone, "[T] Integrated Hands Free Act."));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::TouchScreenTone, "[T] Touch Screen"));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::ChatAlertTone, "[T] Chat Alert"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::EmailAlertTone, "[T] Email Alert"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::MmsAlertTone, "[T] MMS Alert"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::SmsAlertTone, "[T] SMS Alert"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::DeliveryReportTone, "[T] Delivery Report"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::MessageSendFailureTone, "[T] Message Send Failure"));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::BatteryLowTone, "[T] Battery Low"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::BatteryRechargedTone, "[T] Battery Recharge"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::PowerOnTone, "[T] Power On"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::PowerOffTone, "[T] Power Off"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::WakeUpTone, "[T] Wake Up"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::WrongChargerTone, "[T] Wrong Charger"));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::AutomaticRedialCompleteTone, "[T] Automatic Redial Compl."));
+
+    tonesList.append(QPair<int,QString>(XQSystemToneService::VoiceStartTone, "[T] Voice Start"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::VoiceErrorTone, "[T] Voice Error"));
+    tonesList.append(QPair<int,QString>(XQSystemToneService::VoiceAbortTone, "[T] Voice Abort"));
+
+    vl->addLayout(gl);
+
+    QListIterator<QPair<int, QString> > iter(tonesList);
+
+    gl->setDefaultPositioning(4, Qt::Horizontal);
+    
+    while (iter.hasNext()) {
+        QPair<int, QString> item = iter.next();
+        box->addItem(item.second, item.first);
+    }
+
+    vl->addStretch(4);
+    vl->addWidget(box);
+
+    vl->addStretch(1);
+    vl->addWidget(playToneButton);
+    vl->addStretch(1);
+    vl->addWidget(playAlarmButton);
+    vl->addStretch(1);
+    vl->addWidget(currCtxLabel = new QLabel("Last context: ?"));
+    vl->addStretch(2);
+    vl->addWidget(stopAlarmButton);
+    vl->addStretch(1);
+    vl->addWidget(new QLabel("Context:"));
+    vl->addWidget(spinBox);
+
+    vl->addStretch(1);
+    vl->addWidget(callbackLabel = new QLabel("SIGNALS: ---"));
+    
+    vl->addStretch(4);
+    vl->addWidget(quitButton);
+
+    setLayout(vl);
+    //showMaximized();
+    showFullScreen();
+}
+
+STSTest::~STSTest()
+{
+    delete sts;
+}
+
+void STSTest::playTone()
+{
+    int id = box->itemData(box->currentIndex(), Qt::UserRole).toInt();
+    
+    qDebug("Beep!!! (%d)", id);
+    
+    sts->playTone((XQSystemToneService::ToneType)id);
+    
+    currCtxLabel->setText(QString("Last context: -"));
+}
+
+void STSTest::playAlarm()
+{
+    int id = box->itemData(box->currentIndex(), Qt::UserRole).toInt();
+    
+    qDebug("Beep!!! (%d)", id);
+    unsigned int ctx = 0;
+    
+    sts->playAlarm((XQSystemToneService::AlarmType)id, ctx);
+    
+    currCtxLabel->setText(QString("Last context: %1").arg(ctx));
+}
+
+void STSTest::stopAlarm()
+{
+    int ctx = spinBox->value();
+
+    qDebug("Silence! (%d)", ctx);
+    sts->stopAlarm(ctx);
+}
+
+void STSTest::startCallback()
+{
+    callbackLabel->setText(QString("SIGNALS: playing tone started..."));
+    callbackCleanTimer.start(1000);
+}
+
+void STSTest::startCallback(unsigned int ctx)
+{
+    callbackLabel->setText(QString("SIGNALS: (%1) playing alarm started...").arg(ctx));
+    callbackCleanTimer.start(1000);
+}
+
+void STSTest::stopCallback(unsigned int ctx)
+{
+    callbackLabel->setText(QString("SIGNALS: (%1) playing alarm finished...").arg(ctx));
+    callbackCleanTimer.start(1000);
+}
+
+void STSTest::cleanCallback()
+{
+    callbackLabel->setText("SIGNALS: ---");
+}
+
+int main(int argc, char* argv[])
+{
+    QApplication a(argc, argv);
+
+    STSTest* tester = new STSTest();
+    int rv = a.exec();    
+    delete tester;
+	return rv;    
+}
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/examples/systemtoneserviceex/ststest.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,76 @@
+/*
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not,
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+*/
+
+#ifndef T_TEST5_H
+#define T_TEST5_H
+
+#include <QObject>
+#include <QVariant>
+#include <QWidget>
+#include <QComboBox>
+#include <QSpinBox>
+#include <QLabel>
+#include <QTimer>
+
+#include <xqsystemtoneservice.h>
+
+class STSTest : public QWidget
+{
+
+Q_OBJECT
+
+public:
+   
+    STSTest(QWidget *parent = 0, Qt::WFlags f = 0);
+    
+    ~STSTest();
+    
+public slots: 
+
+    void playTone();
+
+    void playAlarm();
+
+    void stopAlarm();
+
+
+    void startCallback();
+
+    void startCallback(unsigned int ctx);
+
+    void stopCallback(unsigned int ctx);
+    
+    void cleanCallback();
+
+private:
+
+    QLabel *callbackLabel;
+    QTimer callbackCleanTimer;
+
+    QLabel *currCtxLabel;
+    QSpinBox *spinBox;
+    QComboBox *box;
+    XQSystemToneService *sts;
+    
+};
+
+#endif // T_TEST5_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/examples/systemtoneserviceex/systemtoneserviceex.pro	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not,
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+TEMPLATE = app
+TARGET = SystemToneServiceEx
+
+INCLUDEPATH += ../../include
+
+SOURCES = ststest.cpp
+
+HEADERS = ststest.h
+		  
+LIBS += -lflogger \
+        -lxqsystemtoneservice
+
+symbian {
+TARGET.CAPABILITY = ALL -TCB
+TARGET.EPOCSTACKSIZE = 0x5000
+TARGET.EPOCHEAPSIZE  = 0x400 0x1000000
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/include/XQSystemToneService	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,1 @@
+#include "xqsystemtoneservice.h"
--- a/qtmobileextensions/install/keycapture.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobileextensions/install/keycapture.pro	Thu May 27 13:42:11 2010 +0300
@@ -27,7 +27,7 @@
 
     qtmobileextension.sources = xqkeycapture.dll
     qtmobileextension.path = /sys/bin
-    qtmobileextension.depends = "(0x2002C342), 4, 5, 0, {\"QtLibs pre-release\"}"
+    qtmobileextension.depends = "(0x2001e61c), 4, 5, 0, {\"QtLibs pre-release\"}"
 
     license.depends = "\"install.txt\" - \"\", FILETEXT, TEXTEXIT"
     DEPLOYMENT += license qtmobileextension
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/install/systemtoneservice.pro	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,34 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, 
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+SUBDIRS = ../src/systemtoneservice
+    
+symbian: {
+    load(data_caging_paths)
+    VERSION=0.1.0
+
+    qtmobileextension.sources = xqsystemtoneservice.dll
+    qtmobileextension.path = /sys/bin
+    qtmobileextension.depends = "(0x2001e61c), 4, 5, 0, {\"QtLibs pre-release\"}"
+
+    license.depends = "\"install.txt\" - \"\", FILETEXT, TEXTEXIT"
+    DEPLOYMENT += license qtmobileextension
+}
\ No newline at end of file
--- a/qtmobileextensions/qtmobileextensions.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobileextensions/qtmobileextensions.pro	Thu May 27 13:42:11 2010 +0300
@@ -23,7 +23,9 @@
 SUBDIRS = src/settingsmanager \
           src/sysinfo \
           src/utils \
-          src/keycapture
+          src/keycapture 
+# Excluded for build for now as dependencies are not met:
+#          src/systemtoneservice
 
 symbian {
 BLD_INF_RULES.prj_exports += "./src/settingsmanager/settingsmanager_global.h               $$MW_LAYER_PLATFORM_EXPORT_PATH(settingsmanager_global.h)"
@@ -51,5 +53,7 @@
 BLD_INF_RULES.prj_exports += "./include/XQConversions                                      $$MW_LAYER_PLATFORM_EXPORT_PATH(XQConversions)"
 BLD_INF_RULES.prj_exports += "./src/keycapture/xqkeycapture.h                              $$MW_LAYER_PLATFORM_EXPORT_PATH(xqkeycapture.h)"
 BLD_INF_RULES.prj_exports += "./include/XQKeyCapture                                       $$MW_LAYER_PLATFORM_EXPORT_PATH(XQKeyCapture)"
+BLD_INF_RULES.prj_exports += "./src/systemtoneservice/xqsystemtoneservice.h                $$MW_LAYER_PLATFORM_EXPORT_PATH(xqsystemtoneservice.h)"
+BLD_INF_RULES.prj_exports += "./include/XQSystemToneService                                $$MW_LAYER_PLATFORM_EXPORT_PATH(XQSystemToneService)"
 BLD_INF_RULES.prj_exports += "./rom/qtmobileextensions.iby                                 $$CORE_MW_LAYER_IBY_EXPORT_PATH(qtmobileextensions.iby)"
 }
--- a/qtmobileextensions/rom/qtmobileextensions.iby	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobileextensions/rom/qtmobileextensions.iby	Thu May 27 13:42:11 2010 +0300
@@ -28,5 +28,6 @@
 file=ABI_DIR\BUILD_DIR\xqsysinfo.dll             SHARED_LIB_DIR\xqsysinfo.dll            PAGED
 file=ABI_DIR\BUILD_DIR\xqutils.dll               SHARED_LIB_DIR\xqutils.dll              PAGED
 file=ABI_DIR\BUILD_DIR\xqkeycapture.dll          SHARED_LIB_DIR\xqkeycapture.dll         PAGED
+/* file=ABI_DIR\BUILD_DIR\xqsystemtoneservice.dll   SHARED_LIB_DIR\xqsystemtoneservice.dll  PAGED */
 
 #endif // __QT_MOBILEEXTENSIONS_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/bwins/xqsystemtoneserviceu.def	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,10 @@
+EXPORTS
+	?alarmStarted@XQSystemToneService@@IAEXI@Z @ 1 NONAME ; void XQSystemToneService::alarmStarted(unsigned int)
+	??1XQSystemToneService@@UAE@XZ @ 2 NONAME ; XQSystemToneService::~XQSystemToneService(void)
+	?playTone@XQSystemToneService@@QAEXW4ToneType@1@@Z @ 3 NONAME ; void XQSystemToneService::playTone(enum XQSystemToneService::ToneType)
+	?toneStarted@XQSystemToneService@@IAEXXZ @ 4 NONAME ; void XQSystemToneService::toneStarted(void)
+	?alarmFinished@XQSystemToneService@@IAEXI@Z @ 5 NONAME ; void XQSystemToneService::alarmFinished(unsigned int)
+	??0XQSystemToneService@@QAE@PAVQObject@@@Z @ 6 NONAME ; XQSystemToneService::XQSystemToneService(class QObject *)
+	?stopAlarm@XQSystemToneService@@QAEXI@Z @ 7 NONAME ; void XQSystemToneService::stopAlarm(unsigned int)
+	?playAlarm@XQSystemToneService@@QAEXW4AlarmType@1@AAI@Z @ 8 NONAME ; void XQSystemToneService::playAlarm(enum XQSystemToneService::AlarmType, unsigned int &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/eabi/xqsystemtoneserviceu.def	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,13 @@
+EXPORTS
+	_ZN19XQSystemToneService11toneStartedEv @ 1 NONAME
+	_ZN19XQSystemToneService12alarmStartedEj @ 2 NONAME
+	_ZN19XQSystemToneService13alarmFinishedEj @ 3 NONAME
+	_ZN19XQSystemToneService8playToneENS_8ToneTypeE @ 4 NONAME
+	_ZN19XQSystemToneService9playAlarmENS_9AlarmTypeERj @ 5 NONAME
+	_ZN19XQSystemToneService9stopAlarmEj @ 6 NONAME
+	_ZN19XQSystemToneServiceC1EP7QObject @ 7 NONAME
+	_ZN19XQSystemToneServiceC2EP7QObject @ 8 NONAME
+	_ZN19XQSystemToneServiceD0Ev @ 9 NONAME
+	_ZN19XQSystemToneServiceD1Ev @ 10 NONAME
+	_ZN19XQSystemToneServiceD2Ev @ 11 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/systemtoneservice/systemtoneservice.pri	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, 
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+
+HEADERS += \
+	xqsystemtoneservice_p.h \
+	xqsystemtoneservice.h
+
+SOURCES += \
+	xqsystemtoneservice.cpp \
+	xqsystemtoneservice_p.cpp
+
+symbian:LIBS += -lsystemtoneservice
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/systemtoneservice/systemtoneservice.pro	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+# All rights reserved.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, version 2.1 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program.  If not, 
+# see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+#
+# Description:
+#
+
+TEMPLATE = lib
+TARGET = xqsystemtoneservice
+
+symbian:TARGET.UID3=0x2002EA83
+
+TARGET.CAPABILITY = CAP_GENERAL_DLL
+
+DEFINES += __STS_QT_LIB_BUILD__
+include(systemtoneservice.pri)
+
+symbian {
+MMP_RULES += EPOCALLOWDLLDATA 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/systemtoneservice/xqsystemtoneservice.cpp	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*       QT wrapper API for  for System Tone Service 
+*
+*/
+
+#include "xqsystemtoneservice.h"
+#include "xqsystemtoneservice_p.h"
+
+STS_EXPORT XQSystemToneService::XQSystemToneService(QObject *parent) :
+    QObject(parent)
+{
+    d_p = new XQSystemToneServicePrivate(this);
+}
+
+STS_EXPORT XQSystemToneService::~XQSystemToneService()
+{
+    delete d_p;
+}
+
+STS_EXPORT void XQSystemToneService::playTone(ToneType toneType)
+{
+    d_p->playTone(toneType);
+    emit toneStarted();
+}
+
+STS_EXPORT void XQSystemToneService::playAlarm(AlarmType alarmType, unsigned int& context)
+{
+    context = d_p->playAlarm(alarmType);
+}
+
+STS_EXPORT void XQSystemToneService::stopAlarm(unsigned int context)
+{
+    d_p->stopAlarm(context);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/systemtoneservice/xqsystemtoneservice.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*       QT wrapper API for  for System Tone Service 
+*
+*/
+
+#ifndef XQSYSTEMTONESERVICE_H
+#define XQSYSTEMTONESERVICE_H
+
+#include <QObject>
+
+#include <systemtoneservice.h>
+
+#ifdef __STS_QT_LIB_BUILD__ 
+#  define STS_EXPORT Q_DECL_EXPORT
+#else
+#  define STS_EXPORT Q_DECL_IMPORT
+#endif
+
+class XQSystemToneServicePrivate;
+
+/**
+ * The System Tone Service (STS) is a component of the Multimedia Services (mmserv) 
+ * collection of the Multimedia Middleware (mmmw) package. STS provides multimedia APIs 
+ * specific to playing system tones (calendar, message alerts, warnings, etc).
+ * 
+ * Here you can find Qt wrapper for this component.
+ * 
+ * Main concepts behind this API:
+ *   * tone - short sound used in the manner "fire and forget" therefore there are no signals when tone ends.
+ *   * alarm - these are kind of looped/longer sounds that may be interrupted by calling app; also there are notifications (signals) when alarm ends playing.
+ *    
+ */
+class XQSystemToneService : public QObject
+{
+  Q_OBJECT
+
+public:
+
+/**
+ * Supported tone types.
+*/
+  Q_DECL_IMPORT enum ToneType {
+	   // Capture Tones
+	   BurstModeTone = CSystemToneService::EBurstMode,
+	   CaptureTone = CSystemToneService::ECapture,
+	   CallRecordingTone = CSystemToneService::ECallRecording,
+	   RecordingStartTone = CSystemToneService::ERecordingStart,
+	   RecordingStopTone = CSystemToneService::ERecordingStop,
+	   SelfTimerTone = CSystemToneService::ESelfTimer,
+	   
+	   // General Tones
+	   ConfirmationBeepTone = CSystemToneService::EConfirmationBeep,
+	   DefaultBeepTone = CSystemToneService::EDefaultBeep,
+	   ErrorBeepTone = CSystemToneService::EErrorBeep,
+	   InformationBeepTone = CSystemToneService::EInformationBeep,
+	   WarningBeepTone = CSystemToneService::EWarningBeep,
+	   IntegratedHandsFreeActivatedTone = CSystemToneService::EIntegratedHandsFreeActivated,
+	   
+	   // Key Tones
+	   TouchScreenTone = CSystemToneService::ETouchScreen,
+	   
+	   // Location Tones
+	   LocationRequestTone = CSystemToneService::ELocationRequest,
+	   
+	   // Messaging Tones
+	   ChatAlertTone = CSystemToneService::EChatAlert,
+	   EmailAlertTone = CSystemToneService::EEmailAlert,
+	   MmsAlertTone = CSystemToneService::EMmsAlert,
+	   SmsAlertTone = CSystemToneService::ESmsAlert,
+	   DeliveryReportTone = CSystemToneService::EDeliveryReport,
+	   MessageSendFailureTone = CSystemToneService::EMessageSendFailure,
+	   
+	   // Power Tones
+	   BatteryLowTone = CSystemToneService::EBatteryLow,
+	   BatteryRechargedTone = CSystemToneService::EBatteryRecharged,
+	   PowerOnTone = CSystemToneService::EPowerOn,
+	   PowerOffTone = CSystemToneService::EPowerOff,
+	   WakeUpTone = CSystemToneService::EWakeUp,
+	   WrongChargerTone = CSystemToneService::EWrongCharger,
+	   
+	   // Telephony Tones
+	   AutomaticRedialCompleteTone = CSystemToneService::EAutomaticRedialComplete,
+	   
+	   // Voice Recognition Tones
+	   VoiceStartTone = CSystemToneService::EVoiceStart,
+	   VoiceErrorTone = CSystemToneService::EVoiceError,
+	   VoiceAbortTone = CSystemToneService::EVoiceAbort
+  };
+  
+Q_DECL_IMPORT enum AlarmType {
+       // Calendar Tones
+       CalendarAlarmTone = CSystemToneService::ECalendarAlarm,
+       ClockAlarmTone = CSystemToneService::EClockAlarm,
+       ToDoAlarmTone = CSystemToneService::EToDoAlarm,
+
+       // Telephony Alarms
+       IncomingCallTone = CSystemToneService::EIncomingCall,
+       IncomingCallLine2Tone = CSystemToneService::EIncomingCallLine2,
+       IncomingDataCallTone = CSystemToneService::EIncomingDataCall,
+  };
+
+  
+public:
+/**
+* XQSystemToneService object constructor. 
+*/
+  STS_EXPORT XQSystemToneService(QObject *parent = 0);
+
+/**
+* Simple destructor.
+*/
+  STS_EXPORT ~XQSystemToneService();
+
+/**
+* Play selected tone.
+*
+* @param  toneType  selected tone type.
+* @see  XQSystemToneService::error()
+*/
+  STS_EXPORT void playTone(ToneType toneType);
+
+/**
+* Play selected alarm. 
+*
+* @param  toneType  selected tone type.
+* @param  contextId  unique playback id for current playback event. May be used for matching playback signals and/or to later stop playing.
+* @see  XQSystemToneService::stopAlarm(unsigned int contextId)
+* @see  XQSystemToneService::error()
+*/
+  STS_EXPORT void playAlarm(AlarmType alarmType, unsigned int& contextId);
+  
+  
+/**
+* Cancel tone being played currently.
+*
+* @param contextId id, must be same as given by playTone method.
+* @see  XQSystemToneService::playAlarm(ToneType toneType, unsigned int& contextId)
+*/
+  STS_EXPORT void stopAlarm(unsigned int contextId);
+
+signals:
+
+/**
+* Playback of given tone has been started.
+* 
+*/
+  STS_EXPORT void toneStarted();
+
+/**
+* Playback of given alarm has been started.
+*
+* @param contextId id, the same as given by playTone method.
+* 
+*/
+  STS_EXPORT void alarmStarted(unsigned int contextId);
+  
+/**
+* Playback of given alarm has been finished.
+*
+* @param contextId id, the same as given by playTone method.
+* 
+*/
+  STS_EXPORT void alarmFinished(unsigned int contextId);
+
+private:
+
+  XQSystemToneServicePrivate *d_p;
+
+  friend class XQSystemToneServicePrivate;
+  
+};
+
+#endif /*SYSTEMTONESERVICE_QT_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/systemtoneservice/xqsystemtoneservice_p.cpp	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*       QT wrapper API for  for System Tone Service 
+*
+*/
+
+#include <xqsystemtoneservice_p.h>
+
+XQSystemToneServicePrivate::XQSystemToneServicePrivate(XQSystemToneService *qptr)
+:
+q_ptr(qptr),
+sts(CSystemToneService::Create())
+{
+}
+
+XQSystemToneServicePrivate::~XQSystemToneServicePrivate()
+{
+    if (sts) {
+        CSystemToneService::Delete(sts);
+    }
+}
+
+void XQSystemToneServicePrivate::playTone(XQSystemToneService::ToneType toneType)
+{
+    if (sts) {
+        sts->PlayTone(mapToneType(toneType));
+        emit q_ptr->toneStarted();
+    }
+}
+
+unsigned int XQSystemToneServicePrivate::playAlarm(XQSystemToneService::AlarmType alarmType)
+{
+    unsigned int ctx = 0;
+    if (sts) {
+        sts->PlayAlarm(mapAlarmType(alarmType), ctx, *this);
+        emit q_ptr->alarmStarted(ctx);
+    }
+    return ctx;
+}
+
+void XQSystemToneServicePrivate::stopAlarm(unsigned int contextId)
+{
+    if (sts) {
+        sts->StopAlarm(contextId);
+    }
+}
+
+CSystemToneService::TToneType XQSystemToneServicePrivate::mapToneType(XQSystemToneService::ToneType toneType)
+{
+    return static_cast<CSystemToneService::TToneType>(toneType);
+}
+
+CSystemToneService::TAlarmType XQSystemToneServicePrivate::mapAlarmType(XQSystemToneService::AlarmType alarmType)
+{
+    return static_cast<CSystemToneService::TAlarmType>(alarmType);
+}
+
+void XQSystemToneServicePrivate::PlayAlarmComplete(unsigned int contextId)
+{
+    emit q_ptr->alarmFinished(contextId);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobileextensions/src/systemtoneservice/xqsystemtoneservice_p.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License as published by
+* the Free Software Foundation, version 2.1 of the License.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public License
+* along with this program.  If not, 
+* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
+*
+* Description:
+*       QT wrapper API for  for System Tone Service 
+*
+*/
+
+#ifndef XQSYSTEMTONESERVICE_P_H
+#define XQSYSTEMTONESERVICE_P_H
+
+#include <xqsystemtoneservice.h>
+
+class XQSystemToneServicePrivate : public MStsPlayAlarmObserver
+{
+
+public:
+  XQSystemToneServicePrivate(XQSystemToneService *qptr);
+
+  ~XQSystemToneServicePrivate();
+
+  void playTone(XQSystemToneService::ToneType toneType);
+
+  unsigned int playAlarm(XQSystemToneService::AlarmType alarmType);
+
+  void stopAlarm(unsigned int contextId);
+
+  void PlayAlarmComplete(unsigned int aAlarmContext);
+
+private:
+
+  CSystemToneService::TToneType mapToneType(XQSystemToneService::ToneType toneType);
+
+  CSystemToneService::TAlarmType mapAlarmType(XQSystemToneService::AlarmType toneType);
+
+private:
+  
+  XQSystemToneService *q_ptr;
+  
+  CSystemToneService *sts;
+  
+};
+
+#endif /*XQSYSTEMTONESERVICE_P_H*/
--- a/qtmobility/.gitignore	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/.gitignore	Thu May 27 13:42:11 2010 +0300
@@ -28,7 +28,6 @@
 bin/sysinfo*
 bin/qcrmlgen*
 bin/icheck*
-src/global/qbuildcfg.h
 install/*
 lib/*
 *.app
--- a/qtmobility/common.pri	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/common.pri	Thu May 27 13:42:11 2010 +0300
@@ -13,10 +13,6 @@
 
 include(staticconfig.pri)
 
-# use only $$QT_MOBILITY_BUILD_TREE. If you add an subfolder it will create a relative path!!!
-# $$QT_MOBILITY_BUILD_TREE/src/global will become ../global
-INCLUDEPATH += $$QT_MOBILITY_BUILD_TREE
-
 symbian:contains(symbian_symbols_unfrozen,1) {
     #see configure.bat for details
     MMP_RULES+="EXPORTUNFROZEN"
@@ -173,3 +169,4 @@
 DEPENDPATH += . $$SOURCE_DIR
 INCLUDEPATH += $$SOURCE_DIR/src/global
 
+!symbian:!wince*:DEFINES += QTM_PLUGIN_PATH=\\\"$$replace(QT_MOBILITY_PREFIX, \\\\, /)\\\"
--- a/qtmobility/config.pri	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/config.pri	Thu May 27 13:42:11 2010 +0300
@@ -6,7 +6,7 @@
 isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include 
 isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib 
 isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin 
-mobility_modules =  bearer  location  serviceframework  publishsubscribe  systeminfo  messaging   
+mobility_modules =  bearer  location  serviceframework  publishsubscribe  systeminfo  messaging  sensors 
 maemo5|maemo6:mobility_modules -= systeminfo 
 contains(mobility_modules,versit): mobility_modules *= contacts  
 lbt_enabled = yes 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/config.tests/sensord/main.cpp	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,10 @@
+#include <sensormanagerinterface.h>
+#include <datatypes/magneticfield.h>
+
+int main()
+{
+    SensorManagerInterface* m_remoteSensorManager;
+    m_remoteSensorManager = &SensorManagerInterface::instance();
+    return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/config.tests/sensord/sensord.pro	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,7 @@
+TEMPLATE=app
+TARGET=sensord
+SOURCES=main.cpp
+QT+=network dbus
+CONFIG+=link_pkgconfig
+PKGCONFIG+=sensord
+
--- a/qtmobility/config.tests/symbiancntsim/main.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/config.tests/symbiancntsim/main.cpp	Thu May 27 13:42:11 2010 +0300
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 #include <etelmm.h>
+#include <mmtsy_names.h>
 
 int main(int argc, char** argv)
 {
--- a/qtmobility/configure	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/configure	Thu May 27 13:42:11 2010 +0300
@@ -99,6 +99,8 @@
 MAC_SDK=
 MOBILITY_MODULES="bearer location contacts multimedia publishsubscribe versit messaging systeminfo serviceframework sensors"
 MOBILITY_MODULES_UNPARSED=
+QMKSPEC=
+OS="other"
 
 usage() 
 {
@@ -232,13 +234,23 @@
     shift
 done
 
+checkostype()
+{
+    match="darwin" 
+    if [ "$OSTYPE" = "${match}"* ]; then
+        OS="darwin"
+        QMKSPEC="-spec macx-g++"
+        echo "QMAKESPEC = "$QMKSPEC >> "$CONFIG_IN"
+    fi
+}
+
 findframeworks()
 {
 # figure out if Qt was built with frameworks
 # if so, install in the correct place.
 # and fix rpath
     echo "contains(QT_CONFIG,qt_framework):message(1)" > 1.pro
-    SOMETHING=`qmake 1.pro 2>&1`
+    SOMETHING=`qmake -spec macx-g++ 1.pro 2>&1`
         if [ "$SOMETHING" = "Project MESSAGE: 1" ]; then
             LIB_PATH="Library/Frameworks"
             BIN_PATH="Applications"
@@ -246,7 +258,6 @@
     rm 1.pro
 }
 
-findframeworks
 
 findUniversal()
 {
@@ -257,19 +268,26 @@
     echo "contains(QT_CONFIG,ppc): system(echo CONFIG+=ppc >> mac.inc)" >> 2.pro
     echo "contains(QT_CONFIG,ppc64): system(echo CONFIG+=ppc64 >> mac.inc)" >> 2.pro
     echo "contains(QT_CONFIG,x86_64): system(echo CONFIG+=x86_64 >> mac.inc)" >> 2.pro
-    SOMETIME=`qmake 2.pro 2>&1`
+    SOMETIME=`qmake -spec macx-g++ 2.pro 2>&1`
     rm 2.pro
     if [ -e "mac.inc" ]; then 
          echo "exists(mac.inc): include(mac.inc)" >> "$CONFIG_IN"
     fi
 }
 
+checkostype
+
+if [ "$OS" = "darwin" ] ; then
+    findframeworks
+fi
 
 if [ -n "$BUILD_SILENT" ]; then
     echo "CONFIG += silent"  > "$CONFIG_IN"
 fi
 
-findUniversal
+if [ "$OS" = "darwin" ] ; then
+    findUniversal
+fi
 
 if [ -z "$RELEASEMODE" ]; then
     RELEASEMODE="debug"
@@ -408,7 +426,7 @@
         cd config.tests/$2
     fi
 
-    qmake "$relpath/config.tests/$2/$2.pro" 2>> "$CONFIG_LOG" >> "$CONFIG_LOG"
+    qmake $QMKSPEC "$relpath/config.tests/$2/$2.pro" 2>> "$CONFIG_LOG" >> "$CONFIG_LOG"
     printf  " ."
     "$MAKE" clean >> "$CONFIG_LOG"
     printf "."
@@ -430,6 +448,11 @@
 compileTest "CoreWLAN (MacOS 10.6)" corewlan
 compileTest "Maemo ICD" maemo-icd
 compileTest "Maemo ICD WLAN" maemo-icd-network-wlan
+if [ "$LINUX_TARGET" = maemo6 ]; then
+    compileTest sensord sensord
+else
+    echo "sensord_enabled = no" >> "$CONFIG_IN"
+fi
 
 # Now module selection
 # using 'expr match ....' should help a bit
@@ -455,42 +478,42 @@
 for module in $MOBILITY_MODULES; do
     case "$module" in 
         bearer)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/bearer
+            $relpath/bin/syncheaders $shadowpath/include/QtmBearer $relpath/src/bearer
             ;;
         publishsubscribe)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/publishsubscribe
+            $relpath/bin/syncheaders $shadowpath/include/QtmPubSub $relpath/src/publishsubscribe
             ;;
         location)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/location
+            $relpath/bin/syncheaders $shadowpath/include/QtmLocation $relpath/src/location
             ;;
         serviceframework)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/serviceframework
+            $relpath/bin/syncheaders $shadowpath/include/QtmServiceFramework $relpath/src/serviceframework
             ;;
         systeminfo)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/systeminfo
+            $relpath/bin/syncheaders $shadowpath/include/QtmSystemInfo $relpath/src/systeminfo
             ;;
         contacts)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/details
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/requests
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/filters
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/details
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/requests
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/filters
             ;;
         multimedia)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/multimedia
+            $relpath/bin/syncheaders $shadowpath/include/QtmMedia $relpath/src/multimedia
             ;;
         messaging)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/messaging
+            $relpath/bin/syncheaders $shadowpath/include/QtmMessaging $relpath/src/messaging
             ;;
         versit)
             #versit implies contacts
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/versit
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/details
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/requests
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/contacts/filters
+            $relpath/bin/syncheaders $shadowpath/include/QtmVersit $relpath/src/versit
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/details
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/requests
+            $relpath/bin/syncheaders $shadowpath/include/QtmContacts $relpath/src/contacts/filters
             ;;
         sensors)
-            $relpath/bin/syncheaders $shadowpath/include $relpath/src/sensors
+            $relpath/bin/syncheaders $shadowpath/include/QtmSensors $relpath/src/sensors
             ;;
         *)
             echo "Cannot generate headers for $module"
@@ -505,7 +528,7 @@
 fi
 
 echo "Running qmake..."
-if qmake -recursive "$relpath/qtmobility.pro"; then
+if qmake -makefile $QMKSPEC -recursive "$relpath/qtmobility.pro"; then
     echo ""
     echo "configure has finished. You may run make or gmake to build the project now."
 else
--- a/qtmobility/configure.bat	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/configure.bat	Thu May 27 13:42:11 2010 +0300
@@ -485,33 +485,33 @@
 )
 
 if %FIRST% == bearer (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\bearer
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmBearer %SOURCE_PATH%\src\bearer
 ) else if %FIRST% == contacts (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts\requests
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts\filters
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts\details
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts\requests
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts\filters
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts\details
 ) else if %FIRST% == location (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\location
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmLocation %SOURCE_PATH%\src\location
 ) else if %FIRST% == messaging (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\messaging
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmMessaging %SOURCE_PATH%\src\messaging
 ) else if %FIRST% == multimedia (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\multimedia
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmMedia %SOURCE_PATH%\src\multimedia
 ) else if %FIRST% == publishsubscribe (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\publishsubscribe
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmPubSub %SOURCE_PATH%\src\publishsubscribe
 ) else if %FIRST% == systeminfo (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\systeminfo
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmSystemInfo %SOURCE_PATH%\src\systeminfo
 ) else if %FIRST% == serviceframework (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\serviceframework
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmServiceFramework %SOURCE_PATH%\src\serviceframework
 ) else if %FIRST% == versit (
     REM versit implies contacts
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\versit
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts\requests
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts\filters
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\contacts\details
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmVersit %SOURCE_PATH%\src\versit
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts\requests
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts\filters
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmContacts %SOURCE_PATH%\src\contacts\details
 ) else if %FIRST% == sensors (
-    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\sensors
+    perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtmSensors %SOURCE_PATH%\src\sensors
 )
 
 if "%REMAINING%" == "" (
--- a/qtmobility/dist/changes-1.0.0	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/dist/changes-1.0.0	Thu May 27 13:42:11 2010 +0300
@@ -1,4 +1,4 @@
-Qt Mobility 1.0.0 is a final minor release. It contains a number of API
+Welcome to Qt Mobility 1.0.0. Qt Mobility 1.0.0 contains a number of API
 improvements and bug fixes since Qt Mobility 1.0.0-beta1. For
 more details, please refer to the online documentation included in this
 distribution. The documentation is also available online:
@@ -14,30 +14,6 @@
 
 
 ****************************************************************************
-*                           General                                        *
-****************************************************************************
-
-New features
-------
-
- - SomeClass, SomeOtherClass
-    * New classes for foo, bar and baz
-
-Optimizations
-------
-
- - Optimized foo in QSomeClass
-    * See list of Important Behavior Changes below
-
-
-****************************************************************************
-*                   Important Behavior Changes                             *
-****************************************************************************
-
- -
-
-
-****************************************************************************
 *                          Library                                         *
 ****************************************************************************
 
@@ -81,6 +57,7 @@
    restricted to Latin 1 (for performance and memory usage optimization).
  - Bugs fixed etc
 
+
 QtVersit
 ------
 
@@ -90,6 +67,7 @@
  - The API uses QImage instead of QPixmap, to avoid non-gui thread
    issues with QPixmap usage.
 
+
 QtLocation
 ------
 
@@ -99,6 +77,7 @@
     * Added serialization functions for QGeoSatelliteInfo
  - Maemo 5 (Fremantle) backend implemented
 
+
 QtMessaging
 ------
 
@@ -131,6 +110,7 @@
  - Format of identifiers changed
    * For forwards compatibility.
 
+
 QtMedia
 ------
  - Symbian backend improvements
@@ -154,6 +134,7 @@
    * Changed to QVideoWidget to consistently not fill the background with black
      by default.
 
+
 QtPublishSubscribe
 ------
 
@@ -163,6 +144,7 @@
     * Autotests
     * Example application modified to be usable in N900
 
+
 QtServiceFramework
 ------
 
@@ -171,6 +153,7 @@
        - Security token usage in databases, db server in protected namespace etc.
     * Capability fixes (reduced)
 
+
 QtSystemInfo
 ------
  - Mac
@@ -199,6 +182,7 @@
  - currentMode() added in network info
  - Fixed MOBILITY-748: Private Qt header usage has been removed
 
+
 QtSensors
 ------
 
@@ -213,49 +197,20 @@
  - Removed setType().
  - Renamed QSensor::connect() to QSensor::connectToBackend().
 
+
 Qt Mobility Plugins
 ------
 
- - foo
-    * bar
+ - mobapicontactspluginsymbian was renamed to qtcontacts_symbian.
+ - mobapicontactspluginsymbiansim was renamed to qtcontacts_symbiansim.
+ - m3u was renamed to qtmedia_m3u.
+ - QtMobilityMmfEngine was renamed to qtmedia_mmfengine.
 
 
 ****************************************************************************
 *                      Platform Specific Changes                           *
 ****************************************************************************
 
-Qt Mobility for Embedded Linux
-------
-
- -
-
-Qt Mobility for Unix (X11 and Mac OS X)
-------
-
- - 
-
-Qt Mobility for Linux/X11
-------
-
- -
-
-Qt Mobility for Windows
-------
-
- -
-
-Qt Mobility for Mac OS X
-------
-
- -
-
-
-
-Qt Mobility for Windows CE
-------
-
- -
-
 Qt Mobility for Symbian
 ------
 
@@ -281,10 +236,3 @@
     * Bug fix: Batch saving of SIM contacts did not update contact details
     * The schema definition of SIM backend now does not include e-mail and nick name details in case they are not supported by the SIM card
     * Trying to save too long details to a SIM card now gives an appropriate error
-
-****************************************************************************
-*                          Tools                                           *
-****************************************************************************
-
- - tool
-    * foo
--- a/qtmobility/dist/changes-1.0.0-beta1	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/dist/changes-1.0.0-beta1	Thu May 27 13:42:11 2010 +0300
@@ -385,11 +385,6 @@
 
  -
 
-<<<<<<< HEAD:dist/changes-1.0.0-beta1
-Qt Mobility for Symbian
-------
-
-=======
 Qt Mobility for Maemo5
 ------
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/dist/changes-1.0.1	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,141 @@
+Qt Mobility 1.0.1 is a patch release. It contains a number of
+improvements and bug fixes since the Qt Mobility 1.0.0 release. For
+more details, please refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+  http://qt.nokia.com/doc/qtmobility-1.0
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker or the Merge Request queue
+of the public source repository.
+
+Qt Bug Tracker: http://bugreports.qt.nokia.com
+Merge Request:  http://qt.gitorious.org
+
+
+****************************************************************************
+*                           General                                        *
+****************************************************************************
+
+New features
+------
+
+ - SomeClass, SomeOtherClass
+    * New classes for foo, bar and baz
+
+Optimizations
+------
+
+ - Optimized foo in QSomeClass
+    * See list of Important Behavior Changes below
+
+
+****************************************************************************
+*                   Important Behavior Changes                             *
+****************************************************************************
+
+ -
+
+
+****************************************************************************
+*                          Library                                         *
+****************************************************************************
+
+QtBearer
+------
+
+ - foo
+    * bar
+
+QtContacts
+------
+
+ - foo
+    * bar
+
+QtLocation
+------
+
+ - foo
+    * bar
+
+QtMessaging
+------
+
+ - foo
+    * bar
+
+QtMedia
+------
+
+ - foo
+    * bar
+
+QtPublishSubscribe
+------
+
+ - foo
+    * bar
+
+QtServiceFramework
+------
+
+ - foo
+    * bar
+
+QtSystemInfo
+------
+
+ - foo
+    * bar
+
+Qt Mobility Plugins
+------
+
+ - foo
+    * bar
+
+
+****************************************************************************
+*                      Platform Specific Changes                           *
+****************************************************************************
+
+Qt Mobility for Embedded Linux
+------
+
+ -
+
+Qt Mobility for Unix (X11 and Mac OS X)
+------
+
+ - 
+
+Qt Mobility for Linux/X11
+------
+
+ -
+
+Qt Mobility for Windows
+------
+
+ -
+
+Qt Mobility for Mac OS X
+------
+
+ -
+
+
+
+Qt Mobility for Windows CE
+------
+
+ -
+
+
+****************************************************************************
+*                          Tools                                           *
+****************************************************************************
+
+ - tool
+    * foo
--- a/qtmobility/examples/keepintouch/addressfinder.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/keepintouch/addressfinder.cpp	Thu May 27 13:42:11 2010 +0300
@@ -385,10 +385,10 @@
     connect(tabWidget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
 #else
     QWidget* centralWidget = new QWidget(this);
-    QScrollArea* sa = new QScrollArea(this);
-    sa->setWidget(centralWidget);
-    sa->setWidgetResizable(true);
-    setCentralWidget(sa);
+    QScrollArea* scrollArea = new QScrollArea(this);
+    scrollArea->setWidget(centralWidget);
+    scrollArea->setWidgetResizable(true);
+    setCentralWidget(scrollArea);
     QVBoxLayout* centralLayout = new QVBoxLayout(centralWidget);
 #endif
 
@@ -503,6 +503,26 @@
 #ifndef USE_SEARCH_BUTTON
     tabChanged(0);
 #endif
+
+    QWidgetList focusableWidgets;
+    focusableWidgets << excludeCheckBox
+                     << includePeriod
+                     << excludePeriod
+                     << contactList
+                     << messageCombo
+                     << showButton
+#ifndef USE_SEARCH_BUTTON
+                     << tabWidget
+#else
+                     << searchButton
+                     << scrollArea
+#endif
+                     << forwardButton;
+
+  foreach(QWidget* w, focusableWidgets)
+       w->setContextMenuPolicy(Qt::NoContextMenu);
+
+    excludePeriod->setFocus();
 }
 
 void AddressFinder::setSearchActionEnabled(bool val)
--- a/qtmobility/examples/qmlcontacts/example.qml	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/qmlcontacts/example.qml	Thu May 27 13:42:11 2010 +0300
@@ -19,30 +19,18 @@
             if(c == undefined){
                 return;
             }
-/*
-            print("Got contacts: " + c.name);
-            print(" Available actions: " + c.availableActions);
-            print(" details: " + c.details);detailsOpacity
-*/
-            var o = c.values("OnlineAccount");
+
             var q = c.values("Presence");
 
-            nameModel.append({"name": c.name, "accountPath": "Account: " + o.AccountPath, "presence": "Status: " + q.Presence, "email": c.email, "avatarSource": "qrc:/default.svg"});
+            nameModel.append({"name": c.name,
+                                "presence": "Status: " + q.Presence,
+                                "email": c.email,
+                                "avatarSource": c.avatar ? c.avatar : "qrc:/default.svg",
+                                "hasThumbnail" : c.hasThumbnail,
+                                "avatarImage": c.thumbnail,
+                                "interestLabel" : c.interestLabel,
+                                "interest" : c.interest});
 
-/*
-            var j;
-            for(j in c.details){                
-                var o = c.values(c.details[j]);
-                var i;
-                for(i in o){
-                    print(" "+ c.details[j] + "/" + i + ": " + o[i]);
-                }
-            }
-*/
-
-        }
-        function clickedList(index) {
-            mainList.currentIndex = index;
         }
     }
 
@@ -62,7 +50,8 @@
         Rectangle {
             id: wrapper            
             border.width: 2
-            height: 30;
+            height: mainLabel.height;
+            width: mainList.width;
 
             property color topColor: "#333333";
             property color bottomColor: "#111111";
@@ -71,88 +60,61 @@
             gradient: Gradient {
                  GradientStop { position: 0.0; color: topColor }
                  GradientStop { position: 1.0; color: bottomColor }
-             }
-
-            Item {
-                id: mainAvatar;
-                anchors.left: parent.left;
-                anchors.top: parent.top;
-                width: avatarFrame.width;
-                height: avatarFrame.height;
-                anchors.leftMargin:4;
-
-                Rectangle {
-                    id: avatarFrame;
-                    border.width: 2;
-                    radius: 4;
-                    height: wrapper.height-6
-                    width: height;
-                    x: 3; y: 3;
-                }
-
-                Image {
-                    id: avatar
-                    anchors.fill: avatarFrame;
-                    anchors.leftMargin: 3;
-                    anchors.rightMargin: 3;
-                    anchors.topMargin: 3;
-                    anchors.bottomMargin: 3;
-
-                    source: avatarSource
-                    fillMode: Image.PreserveAspectFit
-                }
             }
 
-            Item {
-                id: mainLabel;
-                height: nameTxt.height + 16;
-                property real contactId: 0;
-                anchors.left: mainAvatar.right;
-                anchors.right: parent.right;
-                anchors.leftMargin:8;
-                anchors.rightMargin: 4;
-                anchors.topMargin: 4;
-                anchors.bottomMargin: 4;
+            Row {
+                spacing: 2
+                Item {
+                    id: mainAvatar;
+                    height: wrapper.height;
+                    width: height;
 
-                Text {
-                    x:8; y:8;
-                    anchors.left: parent.left;
-                    anchors.right: parent.right;
-                    id: nameTxt
-                    text: name
-                    color: "white";
-                }
-            }
+                    Rectangle {
+                        border.width: 2;
+                        radius: 4;
+                        anchors.fill: parent;
+                        anchors.margins: 3;
 
-            Item {
-                id: details
-                property color textColor: "#ffffdd";
-                anchors.top: mainLabel.bottom;
-                anchors.bottom: parent.bottom;
-                anchors.left: mainAvatar.right;
-                anchors.right: parent.right;
-                anchors.leftMargin:8;
-                anchors.rightMargin: 4;
-                anchors.bottomMargin: 4;
-                opacity: wrapper.detailsOpacity
+                        Image {
+                            id: avatar
+                            anchors.fill: parent;
+                            anchors.margins: 3;
+
+                            pixmap: avatarImage
+                            source: hasThumbnail ? "" : avatarSource;
+                            fillMode: Image.PreserveAspectFit
+                        }
+                    }
+                }
 
                 Column {
-                    Text {
-                        id: emailId
-                        text: email
-                        color: details.textColor;
-                    }
-                    Row {
-                        spacing: 5
+                    Item {
+                        id: mainLabel;
+                        width: nameTxt.width
+                        height: nameTxt.height + 16;
                         Text {
-                            id: accountPathId
-                            text: accountPath
-                            color: details.textColor;
+                            id: nameTxt
+                            y: 8;
+                            text: name
+                            color: "white";
                         }
-                        Text {
-                            id: presenceId
-                            text: presence
-                            color: details.textColor;
+                    }
+
+                    Item {
+                        id: details
+                        property color textColor: "#ffffdd";
+                        opacity: wrapper.detailsOpacity
+                        height: childrenRect.height + 6;
+                        width: childrenRect.width;
+                        Column {
+                            Text {
+                                text: interestLabel + interest
+                                color: details.textColor;
+                            }
+                            Text {
+                                text: presence
+                                color: details.textColor;
+                            }
                         }
                     }
                 }
@@ -160,51 +122,53 @@
 
             states: State {
                 name: "Details"
+                when: wrapper.ListView.isCurrentItem;
                 PropertyChanges { target: wrapper; detailsOpacity: 1; }
-                PropertyChanges { target: wrapper; topColor: "#666666"; }
-                PropertyChanges { target: wrapper; bottomColor: "#222222"; }
-                PropertyChanges { target: wrapper; height: mainLabel.height + emailId.height + accountPathId.height + presenceId.height; }
+                PropertyChanges { target: wrapper; topColor: "#999999"; }
+                PropertyChanges { target: wrapper; bottomColor: "#444444"; }
+                PropertyChanges { target: wrapper; height: mainLabel.height + details.height + 4; }
             }
 
-            transitions: Transition {
-                from: ""
-                to: "Details"
-                reversible: true
-                ParallelAnimation {
-                    ColorAnimation { duration: 150; properties: "topColor, bottomColor";}
-                    NumberAnimation { duration: 100; properties: "detailsOpacity,height" }
+            transitions:  [
+                Transition {
+                    from: ""
+                    to: "Details"
+                    reversible: false
+                    SequentialAnimation {
+                        NumberAnimation { duration: 100; properties: "detailsOpacity,height" }
+                        ColorAnimation { duration: 100; properties: "topColor, bottomColor";}
+                    }
+                },
+                Transition {
+                    to: ""
+                    from: "Details"
+                    reversible: false
+                    SequentialAnimation {
+                        NumberAnimation { duration: 100; properties: "detailsOpacity,height" }
+                        ColorAnimation { duration: 100; properties: "topColor, bottomColor";}
+                    }
                 }
-            }
+            ]
             MouseArea {
                 id: mr
                 width: topItem.width;
                 height: wrapper.height;
                 anchors.centerIn: parent;
-                onClicked: wrapper.state == "" ? wrapper.state = "Details" :  wrapper.state = "";
+                onClicked: mainList.currentIndex = index;
             }
         }
     }
 
-    Component {
-        id: listhighlight
-        Rectangle {
-            width: parent.width-8
-            height: 40
-            color: "lightsteelblue"
-            radius: 5
-        }
-    }
-
     ListView {
         id: mainList
         model: nameModel
         width: parent.width; height: parent.height
         delegate: listdelegate
-        highlight: listhighlight
-        highlightFollowsCurrentItem: true
+        highlightFollowsCurrentItem: false
         focus: true
         anchors.fill: parent
         highlightMoveSpeed: 5000
+        keyNavigationWraps: true
     }
 
     ListModel {
@@ -233,6 +197,4 @@
     }
 }
 
-
-
 // ![0]
--- a/qtmobility/examples/qmlcontacts/qmlcontact.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/qmlcontacts/qmlcontact.cpp	Thu May 27 13:42:11 2010 +0300
@@ -43,6 +43,9 @@
 #include <QtDebug>
 #include <QStringList>
 
+#include <QPixmap>
+#include <QImage>
+
 QT_USE_NAMESPACE
 QTM_USE_NAMESPACE
 
@@ -72,7 +75,7 @@
     emit contactChanged(this);
 }
 
-QString QmlContact::name()
+QString QmlContact::name() const
 {
     return m_contact.displayLabel();
 }
@@ -84,7 +87,7 @@
     emit nameChanged(this);
 }
 
-QString QmlContact::email()
+QString QmlContact::email() const
 {
     QList<QContactDetail> allEmails = m_contact.details(QContactEmailAddress::DefinitionName);
 
@@ -102,6 +105,58 @@
     emit emailChanged(this);
 }
 
+QString QmlContact::avatar() const
+{
+    return m_contact.detail<QContactAvatar>().imageUrl().toString();
+}
+
+QPixmap QmlContact::thumbnail() const
+{
+    return QPixmap::fromImage(m_contact.detail<QContactThumbnail>().thumbnail());
+}
+
+bool QmlContact::hasThumbnail() const
+{
+    return !thumbnail().isNull();
+}
+
+QString QmlContact::interest() const
+{
+    // Try a phone number
+    QString det = m_contact.detail(QContactPhoneNumber::DefinitionName).value(QContactPhoneNumber::FieldNumber);
+    if (!det.isEmpty())
+        return det;
+
+    det = m_contact.detail(QContactEmailAddress::DefinitionName).value(QContactEmailAddress::FieldEmailAddress);
+    if (!det.isEmpty())
+        return det;
+
+    det = m_contact.detail(QContactOnlineAccount::DefinitionName).value(QContactOnlineAccount::FieldAccountUri);
+    if (!det.isEmpty())
+        return det;
+
+    // Well, don't know.
+    return QString();
+}
+
+QString QmlContact::interestLabel() const
+{
+    // Try a phone number
+    QString det = m_contact.detail(QContactPhoneNumber::DefinitionName).value(QContactPhoneNumber::FieldNumber);
+    if (!det.isEmpty())
+        return tr("Phone number:");
+
+    det = m_contact.detail(QContactEmailAddress::DefinitionName).value(QContactEmailAddress::FieldEmailAddress);
+    if (!det.isEmpty())
+        return tr("Email:");
+
+    det = m_contact.detail(QContactOnlineAccount::DefinitionName).value(QContactOnlineAccount::FieldAccountUri);
+    if (!det.isEmpty())
+        return QString("%1:").arg(m_contact.detail(QContactOnlineAccount::DefinitionName).value(QContactOnlineAccount::FieldServiceProvider));
+
+    // Well, don't know.
+    return QString();
+}
 
 QStringList QmlContact::details()
 {
--- a/qtmobility/examples/qmlcontacts/qmlcontact.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/qmlcontacts/qmlcontact.h	Thu May 27 13:42:11 2010 +0300
@@ -53,9 +53,13 @@
 Q_PROPERTY(QContact contact READ contact WRITE setContact NOTIFY contactChanged)
 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
-Q_PROPERTY(QString test READ test)
+Q_PROPERTY(QString avatar READ avatar NOTIFY avatarChanged)
+Q_PROPERTY(QPixmap thumbnail READ thumbnail)
+Q_PROPERTY(bool hasThumbnail READ hasThumbnail)
 Q_PROPERTY(QStringList details READ details)
 Q_PROPERTY(QStringList contexts READ contexts)
+Q_PROPERTY(QString interest READ interest)
+Q_PROPERTY(QString interestLabel READ interestLabel)
 public:
     explicit QmlContact(const QContact& contact, QObject *parent = 0);
     QmlContact();
@@ -64,20 +68,25 @@
     QContact& contact();
     void setContact(QContact& contact);
 
-    QString name();
+    QString name() const;
     void setName(QString name);
 
-    QString email();
+    QString email() const;
     void setEmail(QString email);
 
+    bool hasThumbnail() const;
+    QString avatar() const;
+    QPixmap thumbnail() const;
+
+    QString interest() const;
+    QString interestLabel() const;
+
     QStringList details();
 
     QStringList contexts();
 
     Q_INVOKABLE QVariantMap values(QString definitionId);
 
-    QString test() { return "test string"; }
-
 signals:
     void contactChanged(QmlContact* qmlcontact);
     void nameChanged(QmlContact* qmlcontact);
--- a/qtmobility/examples/sensors/cubehouse/view.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/sensors/cubehouse/view.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,6 +50,47 @@
 #define USE_BUFFERS 1
 #endif
 
+class smoothedaccelerometerfilter : public QObject, public QAccelerometerFilter
+{
+    qreal prevX;
+    qreal prevY;
+    qreal prevZ;
+    bool havePrev;
+
+public:
+    smoothedaccelerometerfilter(QObject *parent = 0)
+        : QObject(parent)
+        , QAccelerometerFilter()
+        , prevX(0)
+        , prevY(0)
+        , prevZ(0)
+        , havePrev(false)
+    {
+    }
+
+    bool filter(QAccelerometerReading *reading)
+    {
+        // Smooth out the reported values.  Large changes are applied as-is,
+        // and small jitters smooth to the rest position.
+        if (havePrev) {
+            qreal xdiff = reading->x() - prevX;
+            qreal ydiff = reading->y() - prevY;
+            qreal zdiff = reading->z() - prevZ;
+#define threshold 0.196133f
+            if (qAbs(xdiff) < threshold && qAbs(ydiff) < threshold && qAbs(zdiff) < threshold) {
+                reading->setX(prevX + xdiff * 0.1f);
+                reading->setY(prevY + ydiff * 0.1f);
+                reading->setZ(prevZ + zdiff * 0.1f);
+            }
+        }
+        prevX = reading->x();
+        prevY = reading->y();
+        prevZ = reading->z();
+        havePrev = true;
+        return true;
+    }
+};
+
 View::View(QWidget *parent)
     : QGLWidget(parent),
       sensitivity(0.1f),
@@ -63,6 +104,7 @@
 
     sensor = new QAccelerometer(this);
     connect(sensor, SIGNAL(readingChanged()), this, SLOT(accelerometerTimeout()));
+    sensor->addFilter(new smoothedaccelerometerfilter(this));
     sensor->start();
 
     time.start();
--- a/qtmobility/examples/sensors/grueplugin/grueplugin.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/sensors/grueplugin/grueplugin.pro	Thu May 27 13:42:11 2010 +0300
@@ -4,6 +4,8 @@
 include(grueplugin.pri)
 include(../../../common.pri)
 
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(sensors_grueplugin)
@@ -15,7 +17,6 @@
 
 CONFIG+=strict_flags
 
-DESTDIR = $$OUTPUT_DIR/bin/examples/sensors
-target.path = $$SOURCE_DIR/plugins/sensors
+target.path = $${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
-
--- a/qtmobility/examples/sensors/sensor_explorer/explorer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/sensors/sensor_explorer/explorer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -92,6 +92,15 @@
         }
     }
 
+    if (ui.sensors->topLevelItemCount() == 0) {
+        QTreeWidgetItem *item = new QTreeWidgetItem(QStringList() << tr("No Sensors Found"));
+        item->setData(0, Qt::UserRole, QString());
+        ui.sensors->addTopLevelItem(item);
+    }
+
+    ui.sensors->setCurrentItem(0);
+    ui.scrollArea->hide();
+
     resizeSensors();
 }
 
@@ -113,6 +122,7 @@
     }
     clearSensorProperties();
     clearReading();
+    ui.scrollArea->hide();
 
     // Check that we've selected an item
     QTreeWidgetItem *item = ui.sensors->currentItem();
@@ -124,6 +134,12 @@
     QByteArray type = item->data(0, Qt::UserRole).toString().toLatin1();
     QByteArray identifier = item->data(0, Qt::DisplayRole).toString().toLatin1();
 
+    if (type.isEmpty()) {
+        // Uh oh, there aren't any sensors.
+        // The user has clicked the dummy list entry so just ignore it.
+        return;
+    }
+
     // Connect to the sensor so we can probe it
     m_sensor = new QSensor(type, this);
     connect(m_sensor, SIGNAL(readingChanged()), this, SLOT(sensor_changed()));
@@ -135,6 +151,7 @@
         return;
     }
 
+    ui.scrollArea->show();
     loadSensorProperties();
     loadReading();
 
--- a/qtmobility/examples/serviceactions/mainwindow.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/serviceactions/mainwindow.cpp	Thu May 27 13:42:11 2010 +0300
@@ -193,7 +193,7 @@
     //        m_loader.start();
 
 #else 
-    if(!runonce) 
+    //    if(!runonce) 
          m_loader.start();
 #endif
     runonce = true;
@@ -381,7 +381,6 @@
 
 void RecentMessagesWidget::stateChanged(QMessageService::State newState)
 {
-    //  qDebug() << "stateChanged state=" << m_state << " newState=" << newState << "error=" << m_service->error();
     if (newState == QMessageService::FinishedState) {
         if ((m_state != LoadFailed) && (m_service->error() == QMessageManager::NoError)) {
             m_state = LoadFinished;
@@ -504,7 +503,6 @@
     bool b;
 
     b=m_service->queryMessages(QMessageFilter(),QMessageSortOrder::byReceptionTimeStamp(Qt::DescendingOrder),m_maxRecent);
-    //    qDebug() << "RecentMessagesWidget::load" << b << m_state;
 //! [load-message]
 };
 
@@ -516,7 +514,7 @@
         QMessageId id = m_ids.takeFirst();
         QMessage message(id);
 
-        QListWidgetItem* newItem = new QListWidgetItem(message.subject());
+        QListWidgetItem* newItem = new QListWidgetItem(message.from().addressee()+QString(":")+message.subject());
         newItem->setData(MessageIdRole,id.toString());
         QFont itemFont = newItem->font();
         bool isPartialMessage = !message.find(message.bodyId()).isContentAvailable();
@@ -890,7 +888,6 @@
 
 void MessageViewWidget::stateChanged(QMessageService::State newState)
 {
-    //  qDebug() << "stateChanged state=" << m_state << " newState=" << newState << "error=" << m_service->error();
     if (m_state == LoadFailed)
         return;
 
@@ -1337,7 +1334,6 @@
 
 void MainWindow::serviceStateChanged(QMessageService::State newState)
 {
-    //  qDebug() << "MainWindow::serviceStateChanged";
     if ((newState == QMessageService::FinishedState) && (m_service->error() != QMessageManager::NoError))
         QMessageBox::critical(this,"Error","One or more service actions failed");
 }
--- a/qtmobility/examples/servicebrowser/servicebrowser.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/servicebrowser/servicebrowser.cpp	Thu May 27 13:42:11 2010 +0300
@@ -76,7 +76,11 @@
 
     QServiceInterfaceDescriptor descriptor = current->data(Qt::UserRole).value<QServiceInterfaceDescriptor>();
     if (descriptor.isValid()) {
-        defaultInterfaceButton->setText(tr("Set as default implementation for %1") 
+#if defined(Q_WS_MAEMO_5)
+        defaultInterfaceButton->setText(tr("Set as default implementation for \n%1")
+#else
+        defaultInterfaceButton->setText(tr("Set as default implementation for %1")
+#endif
                 .arg(descriptor.interfaceName()));
         defaultInterfaceButton->setEnabled(true);
     }
@@ -225,7 +229,7 @@
     attributesListWidget = new QListWidget;
     attributesListWidget->addItem(tr("(Select an interface implementation)"));
 
-#ifndef Q_OS_SYMBIAN
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
     interfacesListWidget->setMinimumWidth(450);
 #endif
 
@@ -264,12 +268,22 @@
     attributesGroup = new QGroupBox(tr("Invokable attributes"));
     QVBoxLayout *attributesLayout = new QVBoxLayout;
     attributesLayout->addWidget(attributesListWidget);
+#if !defined(Q_WS_MAEMO_5)
+    // No space on the screen to show following title in Maemo
     attributesLayout->addWidget(new QLabel(tr("Show attributes for:")));
+#endif
     attributesLayout->addWidget(selectedImplRadioButton);
     attributesLayout->addWidget(defaultImplRadioButton);
     attributesGroup->setLayout(attributesLayout);
 
-#ifndef Q_OS_SYMBIAN
+#if defined(Q_WS_MAEMO_5)
+    // Maemo 5 style doesn't take group box titles into account.
+    int spacingHack = QFontMetrics(QFont()).height();
+    interfacesLayout->setContentsMargins(0, spacingHack, 0, 0);
+    attributesLayout->setContentsMargins(0, spacingHack, 0, 0);
+    servicesLayout->setContentsMargins(0, spacingHack, 0, 0);
+#endif
+#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
     QGridLayout *layout = new QGridLayout;
     layout->addWidget(servicesGroup, 0, 0);
     layout->addWidget(attributesGroup, 0, 1, 2, 1);
--- a/qtmobility/examples/sysinfo/dialog.ui	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/sysinfo/dialog.ui	Thu May 27 13:42:11 2010 +0300
@@ -32,7 +32,17 @@
         </widget>
        </item>
        <item row="0" column="2" colspan="2">
-        <widget class="QLineEdit" name="curLanguageLineEdit"/>
+        <widget class="QLineEdit" name="curLanguageLineEdit">
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
+        </widget>
        </item>
        <item row="1" column="0" colspan="2">
         <widget class="QLabel" name="label_28">
@@ -90,7 +100,17 @@
         </widget>
        </item>
        <item row="3" column="3" colspan="2">
-        <widget class="QLineEdit" name="versionLineEdit"/>
+        <widget class="QLineEdit" name="versionLineEdit">
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
+        </widget>
        </item>
        <item row="4" column="0" colspan="2">
         <widget class="QLabel" name="label_31">
@@ -174,7 +194,17 @@
         </widget>
        </item>
        <item row="4" column="4">
-        <widget class="QLineEdit" name="featuresLineEdit"/>
+        <widget class="QLineEdit" name="featuresLineEdit">
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
+        </widget>
        </item>
        <item row="5" column="1">
         <spacer name="verticalSpacer_4">
@@ -214,6 +244,12 @@
          <layout class="QGridLayout" name="gridLayout_12">
           <item row="0" column="0">
            <widget class="QRadioButton" name="radioButton">
+            <property name="mouseTracking">
+             <bool>false</bool>
+            </property>
+            <property name="focusPolicy">
+             <enum>Qt::NoFocus</enum>
+            </property>
             <property name="text">
              <string>Unknown Power</string>
             </property>
@@ -227,6 +263,12 @@
             <property name="enabled">
              <bool>true</bool>
             </property>
+            <property name="mouseTracking">
+             <bool>false</bool>
+            </property>
+            <property name="focusPolicy">
+             <enum>Qt::NoFocus</enum>
+            </property>
             <property name="text">
              <string>Battery Power</string>
             </property>
@@ -237,6 +279,12 @@
           </item>
           <item row="2" column="0">
            <widget class="QRadioButton" name="radioButton_3">
+            <property name="mouseTracking">
+             <bool>false</bool>
+            </property>
+            <property name="focusPolicy">
+             <enum>Qt::NoFocus</enum>
+            </property>
             <property name="text">
              <string>Wall Power</string>
             </property>
@@ -247,6 +295,12 @@
           </item>
           <item row="3" column="0">
            <widget class="QRadioButton" name="radioButton_4">
+            <property name="mouseTracking">
+             <bool>false</bool>
+            </property>
+            <property name="focusPolicy">
+             <enum>Qt::NoFocus</enum>
+            </property>
             <property name="text">
              <string>Wall Power charging Battery</string>
             </property>
@@ -464,6 +518,15 @@
          <height>25</height>
         </rect>
        </property>
+       <property name="mouseTracking">
+        <bool>false</bool>
+       </property>
+       <property name="focusPolicy">
+        <enum>Qt::NoFocus</enum>
+       </property>
+       <property name="acceptDrops">
+        <bool>false</bool>
+       </property>
       </widget>
       <widget class="QLabel" name="label_41">
        <property name="geometry">
@@ -487,6 +550,15 @@
          <height>25</height>
         </rect>
        </property>
+       <property name="mouseTracking">
+        <bool>false</bool>
+       </property>
+       <property name="focusPolicy">
+        <enum>Qt::NoFocus</enum>
+       </property>
+       <property name="acceptDrops">
+        <bool>false</bool>
+       </property>
       </widget>
      </widget>
      <widget class="QWidget" name="sysmemorytab">
--- a/qtmobility/examples/sysinfo/dialog_landscape.ui	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/sysinfo/dialog_landscape.ui	Thu May 27 13:42:11 2010 +0300
@@ -124,6 +124,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="5" column="0">
@@ -210,6 +219,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="5" column="0">
@@ -300,6 +318,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="6" column="0">
@@ -655,6 +682,12 @@
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
+             <property name="mouseTracking">
+              <bool>false</bool>
+             </property>
+             <property name="focusPolicy">
+              <enum>Qt::NoFocus</enum>
+             </property>
              <property name="text">
               <string>Unknown Power</string>
              </property>
@@ -668,6 +701,12 @@
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
+             <property name="mouseTracking">
+              <bool>false</bool>
+             </property>
+             <property name="focusPolicy">
+              <enum>Qt::NoFocus</enum>
+             </property>
              <property name="text">
               <string>Battery Power</string>
              </property>
@@ -681,6 +720,12 @@
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
+             <property name="mouseTracking">
+              <bool>false</bool>
+             </property>
+             <property name="focusPolicy">
+              <enum>Qt::NoFocus</enum>
+             </property>
              <property name="text">
               <string>Wall Power</string>
              </property>
@@ -694,6 +739,12 @@
                <verstretch>0</verstretch>
               </sizepolicy>
              </property>
+             <property name="mouseTracking">
+              <bool>false</bool>
+             </property>
+             <property name="focusPolicy">
+              <enum>Qt::NoFocus</enum>
+             </property>
              <property name="text">
               <string>Wall Power charging Battery</string>
              </property>
@@ -770,6 +821,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="2" column="0">
@@ -800,6 +860,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="4" column="0">
--- a/qtmobility/examples/sysinfo/dialog_s60.ui	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/sysinfo/dialog_s60.ui	Thu May 27 13:42:11 2010 +0300
@@ -75,6 +75,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="2" column="0">
@@ -216,6 +225,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="3" column="0">
@@ -332,6 +350,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="6" column="0">
@@ -756,6 +783,12 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
          <property name="text">
           <string>Unknown Power</string>
          </property>
@@ -769,6 +802,12 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
          <property name="text">
           <string>Battery Power</string>
          </property>
@@ -795,6 +834,12 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
          <property name="text">
           <string>Wall Power</string>
          </property>
@@ -808,6 +853,12 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
          <property name="text">
           <string>Wall Power charging Battery</string>
          </property>
@@ -848,6 +899,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="2" column="0">
@@ -878,6 +938,15 @@
            <verstretch>0</verstretch>
           </sizepolicy>
          </property>
+         <property name="mouseTracking">
+          <bool>false</bool>
+         </property>
+         <property name="focusPolicy">
+          <enum>Qt::NoFocus</enum>
+         </property>
+         <property name="acceptDrops">
+          <bool>false</bool>
+         </property>
         </widget>
        </item>
        <item row="4" column="0">
@@ -981,7 +1050,7 @@
          <item>
           <widget class="QLabel" name="label_42">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+            <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
@@ -994,7 +1063,7 @@
          <item>
           <widget class="QLabel" name="cellNetworkStatusLabel">
            <property name="sizePolicy">
-            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+            <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
              <horstretch>0</horstretch>
              <verstretch>0</verstretch>
             </sizepolicy>
@@ -1071,19 +1140,6 @@
          </item>
         </layout>
        </item>
-       <item row="4" column="2">
-        <spacer name="horizontalSpacer_16">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>359</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
        <item row="5" column="0">
         <layout class="QHBoxLayout" name="horizontalLayout_29">
          <item>
@@ -1144,7 +1200,7 @@
          </item>
         </layout>
        </item>
-       <item row="7" column="1">
+       <item row="7" column="0">
         <spacer name="verticalSpacer_17">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
--- a/qtmobility/examples/writemessage/messagesender.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/examples/writemessage/messagesender.cpp	Thu May 27 13:42:11 2010 +0300
@@ -329,10 +329,11 @@
 //! [add-attachments]
 
 //! [send-message]
+    sendButton->setEnabled(false);
     if (service.send(message)) {
-        sendButton->setEnabled(false);
         sendId = message.id();
     } else {
+        sendButton->setEnabled(true);
         QMessageBox::warning(0, tr("Failed"), tr("Unable to send message"));
     }
 //! [send-message]
--- a/qtmobility/features/mobility.prf	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/features/mobility.prf	Thu May 27 13:42:11 2010 +0300
@@ -66,7 +66,7 @@
 symbian:contains(CONFIG, mobility):!contains(TARGET.UID3, 0x2002AC89):!contains(TARGET.UID3, 0xE002AC89) {
     mobility_default_deployment.pkg_prerules += \
         "; Default dependency to QtMobility libraries" \
-        "(0x2002AC89), 1, 0, 0, {\"QtMobility\"}"
+        "(0x2002AC89), 1, 0, 1, {\"QtMobility\"}"
     DEPLOYMENT += mobility_default_deployment
 }
 
--- a/qtmobility/features/mobility.prf.template	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/features/mobility.prf.template	Thu May 27 13:42:11 2010 +0300
@@ -66,7 +66,7 @@
 symbian:contains(CONFIG, mobility):!contains(TARGET.UID3, 0x2002AC89):!contains(TARGET.UID3, 0xE002AC89) {
     mobility_default_deployment.pkg_prerules += \
         "; Default dependency to QtMobility libraries" \
-        "(0x2002AC89), 1, 0, 0, {\"QtMobility\"}"
+        "(0x2002AC89), 1, 0, 1, {\"QtMobility\"}"
     DEPLOYMENT += mobility_default_deployment
 }
 
--- a/qtmobility/plugins/contacts/maemo5/maemo5.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/maemo5/maemo5.pro	Thu May 27 13:42:11 2010 +0300
@@ -16,7 +16,8 @@
 
 INCLUDEPATH += $$SOURCE_DIR/src/contacts $$SOURCE_DIR/src/contacts/details $$SOURCE_DIR/src/contacts/filters $$SOURCE_DIR/src/contacts/requests
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/contacts
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
 CONFIG += mobility link_pkgconfig
 MOBILITY = contacts
--- a/qtmobility/plugins/contacts/qtcontacts-tracker/qtcontacts-tracker.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/qtcontacts-tracker/qtcontacts-tracker.pro	Thu May 27 13:42:11 2010 +0300
@@ -43,5 +43,6 @@
            qtrackercontactidfetchrequest.cpp \
            trackerchangelistener.cpp
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/contacts
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/contacts/symbian/inc/cntsymbianengine.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/inc/cntsymbianengine.h	Thu May 27 13:42:11 2010 +0300
@@ -87,7 +87,6 @@
 
 public:
     CntSymbianEngine(const QMap<QString, QString>& parameters, QContactManager::Error* error);
-    CntSymbianEngine(const CntSymbianEngine& other);
     ~CntSymbianEngine();
     
     /* URI reporting */
@@ -95,6 +94,7 @@
 
     /* XXX TODO - implement these correctly */
     int managerVersion() const { return 1;}
+    QContact compatibleContact(const QContact& contact, QContactManager::Error* error) const {return QContactManagerEngine::compatibleContact(contact, error);}
 
     /* Functions that are optional in the base API */
     bool saveRelationship(QContactRelationship* relationship, QContactManager::Error* error);
@@ -167,7 +167,9 @@
     QString m_managerUri;
     CntTransformContact *m_transformContact;
     CntAbstractContactFilter *m_contactFilter;
+#ifndef SYMBIAN_BACKEND_USE_SQLITE    
     CntAbstractContactSorter *m_contactSorter;
+#endif    
     CntRelationship *m_relationship;
     CntDisplayLabel *m_displayLabel;
 
--- a/qtmobility/plugins/contacts/symbian/inc/filtering/cntsymbianfilterdbms.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/inc/filtering/cntsymbianfilterdbms.h	Thu May 27 13:42:11 2010 +0300
@@ -46,6 +46,7 @@
 
 #include "cntabstractcontactfilter.h"
 #include <e32cmn.h>
+#include <cntdef.h>
 
 class CContactDatabase;
 class CContactIdArray;
@@ -89,6 +90,7 @@
             const TDesC& phoneNumber,
             const TInt matchLength);
     bool isFalsePositive(const CContactItemFieldSet& fieldSet, const TUid& fieldTypeUid, const TDesC& searchString);
+    bool contactExists(const TContactItemId &contactId);
     void getMatchLengthL(TInt& matchLength);
     CContactDatabase &m_contactDatabase;
     CntAbstractContactSorter *m_contactSorter;
--- a/qtmobility/plugins/contacts/symbian/inc/transform/cnttransformcontact.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/inc/transform/cnttransformcontact.h	Thu May 27 13:42:11 2010 +0300
@@ -48,8 +48,11 @@
 #include <cntdb.h>
 #include <cntdef.h>
 #include <cntitem.h>
+#include <tz.h>
+#include <tzconverter.h>
 
 class CntTransformContactData;
+class CTzConverter;
 
 QTM_BEGIN_NAMESPACE
 class QContactDetailDefinition;
@@ -69,7 +72,7 @@
 	        const CContactItem& contactItem,
 	        QContact& contact,
 	        const CContactDatabase &contactDatabase,
-	        QString managerUri) const;
+	        QString managerUri);
 	void transformContactL(
 	        QContact &contact,
 	        CContactItem &contactItem) const;
@@ -77,7 +80,7 @@
     TUint32 GetIdForDetailL(const QContactDetailFilter& detailFilter,bool& isSubtype) const;
     void detailDefinitions(QMap<QString, QContactDetailDefinition>& defaultSchema, const QString& contactType, QContactManager::Error* error) const;
     QContactDetail *transformGuidItemFieldL(const CContactItem &contactItem, const CContactDatabase &contactDatabase) const;
-    QContactDetail *transformTimestampItemFieldL(const CContactItem &contactItem, const CContactDatabase &contactDatabase) const;
+    QContactDetail *transformTimestampItemFieldL(const CContactItem &contactItem, const CContactDatabase &contactDatabase);
 private:
 	enum ContactData
 	{
@@ -108,6 +111,8 @@
 
 private:
 	QMap<ContactData, CntTransformContactData*> m_transformContactData;
+	CTzConverter* m_tzConverter;
+	RTz m_tzoneServer;
 };
 
 #endif /* TRANSFORMCONCTACT_H_ */
--- a/qtmobility/plugins/contacts/symbian/src/cntsymbiandatabase.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/src/cntsymbiandatabase.cpp	Thu May 27 13:42:11 2010 +0300
@@ -148,8 +148,18 @@
             changeSet.insertAddedContact(id);
         break;
     case EContactDbObserverEventOwnCardDeleted:
+        if (m_contactsEmitted.contains(id)) {
+            m_contactsEmitted.removeOne(id);
+        } else {
+            // signal selfContactIdChanged (from id to zero)
+            QOwnCardPair ownCard(m_currentOwnCardId, QContactLocalId(0));
+            changeSet.setOldAndNewSelfContactId(ownCard);
+            // signal contactsRemoved (the self contact was deleted)
+            changeSet.insertRemovedContact(id);
+        }
+        // reset own card id
         m_currentOwnCardId = QContactLocalId(0);
-        // ...and send contact deleted event
+        break;
     case EContactDbObserverEventContactDeleted:
         if(m_contactsEmitted.contains(id))
             m_contactsEmitted.removeOne(id);
@@ -218,9 +228,9 @@
         }
         break;
     case EContactDbObserverEventOwnCardChanged:
-        if(m_contactsEmitted.contains(id))
+        if (m_contactsEmitted.contains(id)) {
             m_contactsEmitted.removeOne(id);
-        else {
+        } else {
             QOwnCardPair ownCard(m_currentOwnCardId, QContactLocalId(id));
             changeSet.setOldAndNewSelfContactId(ownCard);
             m_currentOwnCardId = QContactLocalId(id);
--- a/qtmobility/plugins/contacts/symbian/src/cntsymbianengine.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/src/cntsymbianengine.cpp	Thu May 27 13:42:11 2010 +0300
@@ -88,31 +88,21 @@
         m_contactFilter    = new CntSymbianFilter(*this, *m_dataBase->contactDatabase(), *m_transformContact);
 #else
         m_contactFilter    = new CntSymbianFilter(*m_dataBase->contactDatabase());
+        m_contactSorter    = new CntSymbianSorterDbms(*m_dataBase->contactDatabase(), *m_transformContact);
 #endif
-        m_contactSorter    = new CntSymbianSorterDbms(*m_dataBase->contactDatabase(), *m_transformContact);
         m_relationship     = new CntRelationship(m_dataBase->contactDatabase(), m_managerUri);
         m_displayLabel     = new CntDisplayLabel();
     }
 }
 
-CntSymbianEngine::CntSymbianEngine(const CntSymbianEngine& other)
-    : QContactManagerEngine(),
-      m_dataBase(other.m_dataBase),
-      m_managerUri(other.m_managerUri),
-      m_transformContact(other.m_transformContact),
-      m_contactFilter(other.m_contactFilter),
-      m_contactSorter(other.m_contactSorter),
-      m_relationship(other.m_relationship),
-      m_displayLabel(other.m_displayLabel)
-{
-}
-
 CntSymbianEngine::~CntSymbianEngine()
 {
     delete m_contactFilter; // needs to be deleted before database
     delete m_dataBase;
     delete m_transformContact;
+#ifndef SYMBIAN_BACKEND_USE_SQLITE
     delete m_contactSorter;
+#endif    
     delete m_relationship;
     delete m_displayLabel;
 }
@@ -187,45 +177,6 @@
     return result;
 }
 
-#if 0
-// These functions are not used anymore - there is always a filter (which may be the default filter)
-QList<QContactLocalId> CntSymbianEngine::contactIds(const QList<QContactSortOrder>& sortOrders, QContactManager::Error* error) const
-{
-    // Check if sorting is supported by backend
-    if(m_contactSorter->sortOrderSupported(sortOrders))
-        return m_contactSorter->contacts(sortOrders,error);
-
-    // Backend does not support this sorting.
-    // Fall back to slow QContact-level sorting method.
-
-    // Get unsorted contact ids
-    QList<QContactSortOrder> noSortOrders;
-    QList<QContactLocalId> unsortedIds = m_contactSorter->contacts(noSortOrders, error);
-    if (*error != QContactManager::NoError)
-        return QList<QContactLocalId>();
-
-    // Sort contacts
-    return slowSort(unsortedIds, sortOrders, error);
-}
-
-QList<QContact> CntSymbianEngine::contacts(const QList<QContactSortOrder>& sortOrders, const QStringList& definitionRestrictions, QContactManager::Error* error) const
-{
-    *error = QContactManager::NoError;
-    QList<QContact> contacts;
-    QList<QContactLocalId> contactIds = this->contactIds(sortOrders, error);
-    if (*error == QContactManager::NoError ) {
-        foreach (QContactLocalId id, contactIds) {
-            QContact contact = this->contact(id, definitionRestrictions, error);
-            if (*error != QContactManager::NoError) {
-                return QList<QContact>(); // return empty list if error occurred
-            }
-            contacts.append(contact);
-        }
-    }
-    return contacts;
-}
-#endif
-
 QList<QContact> CntSymbianEngine::contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, const QContactFetchHint& fh, QContactManager::Error* error) const
 {
     *error = QContactManager::NoError;
@@ -489,10 +440,13 @@
         contactId->setLocalId(QContactLocalId(id));
         contactId->setManagerUri(m_managerUri);
         contact.setId(*contactId);
+        CleanupStack::PopAndDestroy(contactItem);
+        contactItem = 0;
 
         //update contact, will add the fields to the already saved group
         updateContactL(contact);
         // Transform details that are not available until the contact has been saved
+        contactItem = m_dataBase->contactDatabase()->ReadContactLC(id);
         m_transformContact->transformPostSaveDetailsL(*contactItem, contact, *m_dataBase->contactDatabase(), m_managerUri);
 
         CleanupStack::PopAndDestroy(contactItem);
@@ -554,6 +508,13 @@
     // note commitContactL removes empty fields from the contact
     m_dataBase->contactDatabase()->CommitContactL(*contactItem);
 
+    // Update "last modified" time stamp; the contact item needs to be
+    // explicitly refreshed by reading it again from the database
+    CleanupStack::PopAndDestroy(contactItem);
+    contactItem = 0;
+    contactItem = m_dataBase->contactDatabase()->ReadContactLC(contact.localId());
+    m_transformContact->transformPostSaveDetailsL(*contactItem, contact, *m_dataBase->contactDatabase(), m_managerUri);
+
     updateDisplayLabel(contact);
 
     CleanupStack::PopAndDestroy(contactItem);
--- a/qtmobility/plugins/contacts/symbian/src/filtering/cntsymbianfilterdbms.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/src/filtering/cntsymbianfilterdbms.cpp	Thu May 27 13:42:11 2010 +0300
@@ -327,7 +327,17 @@
             TRAP_IGNORE(getMatchLengthL(matchLength));
 
             TInt err = matchContacts(idArray, commPtr, matchLength);
-            if(err != KErrNone) {
+            if (err == KErrNone) {
+                // Phone number matching sometimes includes nonexisting contacts to
+                // the result for some reason. Remove them.
+                for (TInt i(0); i < idArray->Count(); ) {
+                    if(!contactExists((*idArray)[i])) {
+                        idArray->Remove(i);
+                    } else {
+                        i++;
+                    }
+                }
+            } else {
                 CntSymbianTransformError::transformError(err, error);
             }
         // Names, e-mail, display label (other flags)
@@ -413,6 +423,12 @@
     return value;
 }
 
+bool CntSymbianFilter::contactExists(const TContactItemId &contactId)
+{
+    TRAPD(err, m_contactDatabase.ReadMinimalContactL(contactId));
+    return err == KErrNone;
+}
+
 /*!
  * Transform detail filter into a contact item field definition that can be
  * used with CContactDatabase finds.
--- a/qtmobility/plugins/contacts/symbian/src/transform/cnttransformcontact.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/src/transform/cnttransformcontact.cpp	Thu May 27 13:42:11 2010 +0300
@@ -72,13 +72,17 @@
 
 #include <QDebug>
 
-CntTransformContact::CntTransformContact()
+CntTransformContact::CntTransformContact() :
+    m_tzConverter(0)
 {
 	initializeCntTransformContactData();
 }
 
 CntTransformContact::~CntTransformContact()
 {
+    delete m_tzConverter;
+    m_tzoneServer.Close();
+
     QMap<ContactData, CntTransformContactData*>::iterator itr;
 
     for (itr = m_transformContactData.begin(); itr != m_transformContactData.end(); ++itr)
@@ -187,7 +191,7 @@
         const CContactItem& contactItem,
         QContact& contact,
         const CContactDatabase &contactDatabase,
-        QString managerUri) const
+        QString managerUri)
 {
     // Id
     QContactId contactId;
@@ -388,9 +392,16 @@
     return guidDetail;
 }
 
-QContactDetail* CntTransformContact::transformTimestampItemFieldL(const CContactItem &contactItem, const CContactDatabase &contactDatabase) const
+QContactDetail* CntTransformContact::transformTimestampItemFieldL(const CContactItem &contactItem, const CContactDatabase &contactDatabase)
 {
 #ifdef SYMBIAN_CNTMODEL_V2
+
+    // Time zone conversion is needed because contact model uses GMT time stamps
+    if (!m_tzConverter) {
+        User::LeaveIfError(m_tzoneServer.Connect()); 
+        m_tzConverter = CTzConverter::NewL(m_tzoneServer);
+    }
+
     QContactTimestamp *timestampDetail = 0;
     HBufC* guidBuf = contactItem.UidStringL(contactDatabase.MachineId()).AllocLC();
     TPtr ptr = guidBuf->Des();
@@ -403,22 +414,25 @@
             if (lex.Val(timeValue, EHex) == 0)
             {
                 timestampDetail = new QContactTimestamp();
+                const TInt formattedDateLength(14);
+                _LIT(KDateFormat, "%F%Y%M%D%H%T%S");
+                QString DateFormatQt = QString("yyyyMMddHHmmss");
 
-                //creation date
+                // creation date
                 TTime timeCreation(timeValue);
-                TDateTime dateCreation = timeCreation.DateTime();
-                QDate qDateCreation(dateCreation.Year(), dateCreation.Month() + 1, dateCreation.Day() + 1);
-                QTime qTimeCreation(dateCreation.Hour(), dateCreation.Minute(), dateCreation.Second(), dateCreation.MicroSecond()/1000);
-                QDateTime qDateTimeCreation(qDateCreation, qTimeCreation);
-                timestampDetail->setCreated(qDateTimeCreation);
+                User::LeaveIfError(m_tzConverter->ConvertToLocalTime(timeCreation));
+                TBuf<formattedDateLength> createdBuf;
+                timeCreation.FormatL(createdBuf, KDateFormat);
+                QString createdString = QString::fromUtf16(createdBuf.Ptr(), createdBuf.Length());
+                timestampDetail->setCreated(QDateTime::fromString(createdString, DateFormatQt));
 
-                //last modified date
+                // last modified date
                 TTime timeModified = contactItem.LastModified();
-                TDateTime dateModified = timeModified.DateTime();
-                QDate qDateModified(dateModified.Year(), dateModified.Month() + 1, dateModified.Day() + 1);
-                QTime qTimeModified(dateModified.Hour(), dateModified.Minute(), dateModified.Second(), dateModified.MicroSecond()/1000);
-                QDateTime qDateTimeModified(qDateModified, qTimeModified);
-                timestampDetail->setLastModified(qDateTimeModified);
+                User::LeaveIfError(m_tzConverter->ConvertToLocalTime(timeModified));
+                TBuf<formattedDateLength> modifiedBuf;
+                timeModified.FormatL(modifiedBuf, KDateFormat);
+                QString modifiedString = QString::fromUtf16(modifiedBuf.Ptr(), modifiedBuf.Length());
+                timestampDetail->setLastModified(QDateTime::fromString(modifiedString, DateFormatQt));
             }
         }
     }
--- a/qtmobility/plugins/contacts/symbian/symbian.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/symbian.pro	Thu May 27 13:42:11 2010 +0300
@@ -134,7 +134,8 @@
         -lfbscli \
         -limageconversion \
         -lbitmaptransforms \
-        -lbafl
+        -lbafl \
+        -ltzclient
 
     target.path = /sys/bin
     INSTALLS += target
@@ -148,9 +149,10 @@
     }
     
     symbianplugin.sources = $${TARGET}.dll
-    symbianplugin.path = /resource/qt/plugins/contacts
+    symbianplugin.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
     DEPLOYMENT += symbianplugin
 }
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/contacts
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/contacts/symbian/tsrc/tsrc.pri	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/tsrc/tsrc.pri	Thu May 27 13:42:11 2010 +0300
@@ -120,4 +120,5 @@
         -lfbscli \
         -limageconversion \
         -lbitmaptransforms \ 
-        -lbafl   
+        -lbafl \
+        -ltzclient
--- a/qtmobility/plugins/contacts/symbian/tsrc/tst_qcontactmanagersymbian/tst_qcontactmanagersymbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/tsrc/tst_qcontactmanagersymbian/tst_qcontactmanagersymbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -68,11 +68,13 @@
     QTRY_COMPARE(spyContactsRemoved.count(), contactsRemoved); \
     QTRY_COMPARE(spyRelationshipsAdded.count(), relationshipsAdded); \
     QTRY_COMPARE(spyRelationshipsRemoved.count(), relationshipsRemoved); \
+    QTRY_COMPARE(spySelfContactIdChanged.count(), selfContactIdChanged); \
     QTRY_COMPARE(spyContactsAdded2.count(), contactsAdded); \
     QTRY_COMPARE(spyContactsChanged2.count(), contactsChanged); \
     QTRY_COMPARE(spyContactsRemoved2.count(), contactsRemoved); \
     QTRY_COMPARE(spyRelationshipsAdded2.count(), relationshipsAdded); \
-    QTRY_COMPARE(spyRelationshipsRemoved2.count(), relationshipsRemoved);
+    QTRY_COMPARE(spyRelationshipsRemoved2.count(), relationshipsRemoved); \
+    QTRY_COMPARE(spySelfContactIdChanged2.count(), selfContactIdChanged);
 
 //TESTED_CLASS=
 //TESTED_FILES=
@@ -107,6 +109,7 @@
     void ringTone();
     void displayLabel_data();
     void displayLabel();
+    void timestamp();
     void invalidContactItems();
 
 private:
@@ -165,6 +168,7 @@
     int contactsRemoved(0);
     int relationshipsAdded(0);
     int relationshipsRemoved(0);
+    int selfContactIdChanged(0);
     
     // Signal spys for verifying signal emissions
     qRegisterMetaType<QContactLocalId>("QContactLocalId");
@@ -174,11 +178,13 @@
     QSignalSpy spyContactsRemoved(m_cm, SIGNAL(contactsRemoved(QList<QContactLocalId>)));
     QSignalSpy spyRelationshipsAdded(m_cm, SIGNAL(relationshipsAdded(QList<QContactLocalId>)));
     QSignalSpy spyRelationshipsRemoved(m_cm, SIGNAL(relationshipsRemoved(QList<QContactLocalId>)));
+    QSignalSpy spySelfContactIdChanged(m_cm, SIGNAL(selfContactIdChanged(QContactLocalId, QContactLocalId)));
     QSignalSpy spyContactsAdded2(cm2.data(), SIGNAL(contactsAdded(QList<QContactLocalId>)));
     QSignalSpy spyContactsChanged2(cm2.data(), SIGNAL(contactsChanged(QList<QContactLocalId>)));
     QSignalSpy spyContactsRemoved2(cm2.data(), SIGNAL(contactsRemoved(QList<QContactLocalId>)));
     QSignalSpy spyRelationshipsAdded2(cm2.data(), SIGNAL(relationshipsAdded(QList<QContactLocalId>)));
     QSignalSpy spyRelationshipsRemoved2(cm2.data(), SIGNAL(relationshipsRemoved(QList<QContactLocalId>)));
+    QSignalSpy spySelfContactIdChanged2(cm2.data(), SIGNAL(selfContactIdChanged(QContactLocalId, QContactLocalId)));
 
     // create a group
     QContact group = createContact(QContactType::TypeGroup, "Hesketh", "");
@@ -262,6 +268,19 @@
     QVERIFY(m_cm->removeContact(group2.localId()));
     contactsRemoved++;
     QTRY_COMPARE_SIGNAL_COUNTS();
+
+    // Self contact
+    QContact memyself = createContact(QContactType::TypeContact, "Kimi", "Raikkonen");
+    QVERIFY(m_cm->saveContact(&memyself));
+    contactsAdded++;
+    QTRY_COMPARE_SIGNAL_COUNTS();
+    QVERIFY(m_cm->setSelfContactId(memyself.localId()));
+    selfContactIdChanged++;
+    QTRY_COMPARE_SIGNAL_COUNTS();
+    QVERIFY(m_cm->removeContact(memyself.localId()));
+    contactsRemoved++;
+    selfContactIdChanged++;
+    QTRY_COMPARE_SIGNAL_COUNTS();
 }
 
 /*
@@ -535,6 +554,34 @@
     QVERIFY(m_cm->removeContact(contact.localId()));
 }
 
+void tst_QContactManagerSymbian::timestamp()
+{
+    // Save a contact
+    QContact contact = createContact(QContactType::TypeContact, "Jame", "Hunt");
+    QVERIFY(m_cm->saveContact(&contact));
+
+    // Wait a second to make the contact's timestamp a little older
+    QTest::qWait(1001);
+
+    // Modify the contact
+    QContactName name = contact.detail(QContactName::DefinitionName);
+    name.setFirstName("James");
+    contact.saveDetail(&name);
+    QVERIFY(m_cm->saveContact(&contact));
+
+    // Verify
+    QContactTimestamp timestamp = contact.detail(QContactTimestamp::DefinitionName);
+    QDateTime current = QDateTime::currentDateTime();
+    // assume one contact save operation takes less than one second
+    QVERIFY(timestamp.created().secsTo(current) <= 2);
+    QVERIFY(timestamp.created().secsTo(current) >= 1);
+    QVERIFY(timestamp.lastModified().secsTo(current) <= 1);
+    QVERIFY(timestamp.lastModified().secsTo(current) >= 0);
+
+    // Delete the contact
+    QVERIFY(m_cm->removeContact(contact.localId()));
+}
+
 /*
  * Special contact handling test cases that cannot be covered in QtMobility
  * system level test cases.
--- a/qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_cntrelationship.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_cntrelationship.cpp	Thu May 27 13:42:11 2010 +0300
@@ -149,7 +149,7 @@
     }
 
     //remove relationships
-    QVERIFY(m_relationship->removeRelationships(&affectedContactIds, relationships, &errorMap, &error));
+    QVERIFY(!m_relationship->removeRelationships(&affectedContactIds, relationships, &errorMap, &error));
     QVERIFY(affectedContactIds.count() == 0);
     foreach (QContactManager::Error err, errorMap) {
         QVERIFY(err == QContactManager::NotSupportedError);
@@ -238,14 +238,9 @@
     expectedContacts += contact.localId();
     QVERIFY(true == validateRelationshipFilter(QContactRelationship::First, groupContact.id(), expectedContacts));
     
-    QList<QContactLocalId> expectedContacts1;
-    expectedContacts1 += groupContact.localId();
-    expectedContacts1 += contact.localId();
-    QList<QContactLocalId> expectedContacts2;
-    expectedContacts2 += contact.localId();
-    expectedContacts2 += groupContact.localId(); 
-    QVERIFY(true == (validateRelationshipFilter(QContactRelationship::Either, groupContact.id(), expectedContacts1) ||
-                     validateRelationshipFilter(QContactRelationship::Either, groupContact.id(), expectedContacts2)));
+    expectedContacts.clear();
+    expectedContacts += contact.localId();
+    QVERIFY(true == validateRelationshipFilter(QContactRelationship::Either, groupContact.id(), expectedContacts));
 
     expectedContacts.clear();
     expectedContacts += groupContact.localId();
--- a/qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_cntsymbianengine.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_cntsymbianengine.cpp	Thu May 27 13:42:11 2010 +0300
@@ -108,30 +108,14 @@
     if (error == QContactManager::NoError) {
         QVERIFY(ce->managerName() == CNT_SYMBIAN_MANAGER_NAME);
         QVERIFY(ce->m_contactFilter != 0);
-        QVERIFY(ce->m_contactSorter != 0);
         QVERIFY(ce->m_dataBase != 0);
         QVERIFY(ce->m_relationship != 0);
         QVERIFY(ce->m_transformContact != 0);
     } else {
         QSKIP("Error creating CntSymbianEngine in ctor", SkipSingle);
     }
-    // copy ctor
-    CntSymbianEngine* ce1 = new CntSymbianEngine(*ce);
-    QVERIFY(ce->managerName() == ce1->managerName());
-    QVERIFY(ce->m_contactFilter == ce1->m_contactFilter);
-    QVERIFY(ce->m_contactSorter == ce1->m_contactSorter);
-    QVERIFY(ce->m_dataBase == ce1->m_dataBase);
-    QVERIFY(ce->m_relationship == ce1->m_relationship);
-    QVERIFY(ce->m_transformContact == ce1->m_transformContact);
 
     delete ce;
-    /*
-    QVERIFY(ce->m_contactFilter == 0xDEDEDEDE);
-    QVERIFY(ce->m_contactSorter == 0xDEDEDEDE);
-    QVERIFY(ce->m_dataBase == 0xDEDEDEDE);
-    QVERIFY(ce->m_relationship == 0xDEDEDEDE);
-    QVERIFY(ce->m_transformContact == 0xDEDEDEDE);
-    */
 }
 
 void TestSymbianEngine::saveContact()
@@ -525,8 +509,8 @@
 
     // Remove non existent contacts
     QMap<int, QContactManager::Error> errorMap;
-    QVERIFY(m_engine->removeContacts(contacts, &errorMap, &err));
-    QVERIFY(err == QContactManager::NoError);
+    QVERIFY(!m_engine->removeContacts(contacts, &errorMap, &err));
+    QVERIFY(err == QContactManager::BadArgumentError);
     QVERIFY(errorMap.count() == 0);
 
     // Remove existing contacts
@@ -803,7 +787,7 @@
 
     // Add relationships
     QMap<int, QContactManager::Error> errorMap;
-    QVERIFY(m_engine->saveRelationships(&list, &errorMap, &error));
+    QVERIFY(!m_engine->saveRelationships(&list, &errorMap, &error));
     foreach(QContactManager::Error err, errorMap) {
         if (err == QContactManager::NoError ||
                 err == QContactManager::NotSupportedError)
--- a/qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_transformcontactdata.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/tsrc/ut_symbian/ut_transformcontactdata.cpp	Thu May 27 13:42:11 2010 +0300
@@ -493,17 +493,17 @@
     QVERIFY(transformPhoneNumber->supportsDetail(QContactPhoneNumber::DefinitionName));
     QVERIFY(!(transformPhoneNumber->supportsDetail("WrongValue")));
     validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::FieldNumber,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeLandline,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeMobile,0);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeLandline,KUidContactFieldPhoneNumber.iUid);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeMobile,KUidContactFieldPhoneNumber.iUid);
     validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeFax,KUidContactFieldFax.iUid);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypePager,0);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypePager,KUidContactFieldPhoneNumber.iUid);
     validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeVoice,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeModem,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeVideo,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeCar,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeBulletinBoardSystem,0);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeModem,KUidContactFieldPhoneNumber.iUid);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeVideo,KUidContactFieldPhoneNumber.iUid);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeCar,KUidContactFieldPhoneNumber.iUid);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeBulletinBoardSystem,KUidContactFieldPhoneNumber.iUid);
     validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeMessagingCapable,0);
-    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeAssistant,0);
+    validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeAssistant,KUidContactFieldPhoneNumber.iUid);
     validateGetIdForField(*transformPhoneNumber, QContactPhoneNumber::SubTypeDtmfMenu,KUidContactFieldDTMF.iUid);
     validateGetIdForField(*transformPhoneNumber, "WrongValue", 0);
     QVERIFY(transformPhoneNumber->supportsSubType(QContactPhoneNumber::FieldSubTypes));
@@ -1039,8 +1039,6 @@
     QVERIFY(transformOnlineAccount->supportsField(KUidContactFieldSIPID.iUid));
     QVERIFY(transformOnlineAccount->supportsField(KUidContactFieldIMPP.iUid));
     QVERIFY(transformOnlineAccount->supportsField(KUidContactFieldServiceProvider.iUid));
-    QVERIFY(transformOnlineAccount->supportsField(KUidContactFieldPresence.iUid));
-    QVERIFY(transformOnlineAccount->supportsField(KUidContactFieldStatusMsg.iUid));
     QVERIFY(!(transformOnlineAccount->supportsField(0))); //Test for Wrong value
     QVERIFY(transformOnlineAccount->supportsDetail(QContactOnlineAccount::DefinitionName));
     QVERIFY(!(transformOnlineAccount->supportsDetail("WrongValue")));
@@ -1067,15 +1065,13 @@
     QContactOnlineAccount onlineAccount1;
     onlineAccount1.setAccountUri(sipDetail);
     onlineAccount1.setServiceProvider(providerDetail);
-    onlineAccount1.setPresence(presenceDetail);
-    onlineAccount1.setStatusMessage(statusDetail);
     
     onlineAccount1.setSubTypes(QContactOnlineAccount::SubTypeSipVoip);
     QList<CContactItemField *> fields = transformOnlineAccount->transformDetailL(onlineAccount1);
     if(sipDetail.isEmpty()) {
         QVERIFY(fields.count() == 0);
     } else {
-        QVERIFY(fields.count() == 4);
+        QVERIFY(fields.count() == 2);
         
         QVERIFY(fields.at(0)->StorageType() == KStorageTypeText);
         QVERIFY(fields.at(0)->ContentType().ContainsFieldType(KUidContactFieldSIPID));
@@ -1086,16 +1082,6 @@
         QVERIFY(fields.at(1)->StorageType() == KStorageTypeText);
         QVERIFY(fields.at(1)->ContentType().ContainsFieldType(KUidContactFieldServiceProvider));
         QCOMPARE(fields.at(1)->TextStorage()->Text(), providerField );
-        
-        QVERIFY(fields.at(2)->StorageType() == KStorageTypeText);
-        QVERIFY(fields.at(2)->ContentType().ContainsFieldType(KUidContactFieldPresence));
-        //Presence information is encoded as single character value defined in enum
-        //1 for Available
-        QCOMPARE(fields.at(2)->TextStorage()->Text(), _L("1") );
-        
-        QVERIFY(fields.at(3)->StorageType() == KStorageTypeText);
-        QVERIFY(fields.at(3)->ContentType().ContainsFieldType(KUidContactFieldStatusMsg));
-        QCOMPARE(fields.at(3)->TextStorage()->Text(), statusField );
     }
 
     QContactOnlineAccount onlineAccount2;
@@ -1199,27 +1185,6 @@
     contactDetail = 0;
     delete newField;
     newField = 0;
-    
-    newField = CContactItemField::NewL(KStorageTypeText, KUidContactFieldPresence);
-    // Set the presence available i.e. 1
-    newField->TextStorage()->SetTextL(_L("1"));
-    contactDetail = transformOnlineAccount->transformItemField(*newField, contact);
-    const QContactOnlineAccount* onlineAccountDetail6(static_cast<const QContactOnlineAccount*>(contactDetail));
-    QCOMPARE(onlineAccountDetail6->presence(), QString::fromAscii("Available"));
-    delete contactDetail;
-    contactDetail = 0;
-    delete newField;
-    newField = 0;
-    
-    newField = CContactItemField::NewL(KStorageTypeText, KUidContactFieldStatusMsg);
-    newField->TextStorage()->SetTextL(statusField);
-    contactDetail = transformOnlineAccount->transformItemField(*newField, contact);
-    const QContactOnlineAccount* onlineAccountDetail7(static_cast<const QContactOnlineAccount*>(contactDetail));
-    QCOMPARE(onlineAccountDetail7->statusMessage(), statusDetail);
-    delete contactDetail;
-    contactDetail = 0;
-    delete newField;
-    newField = 0;
 
     delete transformOnlineAccount;
 }
--- a/qtmobility/plugins/contacts/symbiansim/symbiansim.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/symbiansim/symbiansim.pro	Thu May 27 13:42:11 2010 +0300
@@ -7,6 +7,7 @@
 TEMPLATE = lib
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(qtcontacts_symbiansim)
+PLUGIN_TYPE=contacts
 
 include(../../../common.pri)
 include(symbiansim_defines.pri)
@@ -62,7 +63,7 @@
     INSTALLS += target
 
     symbianplugin.sources = $${TARGET}.dll
-    symbianplugin.path = /resource/qt/plugins/contacts
+    symbianplugin.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
     DEPLOYMENT += symbianplugin
 
 }
--- a/qtmobility/plugins/contacts/wince/wince.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/contacts/wince/wince.pro	Thu May 27 13:42:11 2010 +0300
@@ -16,7 +16,8 @@
 
 INCLUDEPATH += $$SOURCE_DIR/src/contacts $$SOURCE_DIR/src/contacts/details $$SOURCE_DIR/src/contacts/filters $$SOURCE_DIR/src/contacts/requests
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/contacts
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
 LIBS += pimstore.lib -lole32
 CONFIG += mobility
--- a/qtmobility/plugins/multimedia/audiocapture/audiocapture.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/audiocapture/audiocapture.pro	Thu May 27 13:42:11 2010 +0300
@@ -30,9 +30,6 @@
     audiocaptureserviceplugin.cpp \
     audiocapturesession.cpp
 
-symbian {
-    TARGET.CAPABILITY = ALL -TCB
-    TARGET.EPOCALLOWDLLDATA = 1
-}
-target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/multimedia/directshow/directshow.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/directshow/directshow.pro	Thu May 27 13:42:11 2010 +0300
@@ -4,7 +4,7 @@
 QT+=multimedia
 TARGET = $$qtLibraryTarget(qtmedia_dsengine)
 
-PLUGIN_TYPE = mediaservice
+PLUGIN_TYPE=mediaservice
 
 include (../../../common.pri)
 INCLUDEPATH+=../../../src/multimedia
@@ -21,6 +21,7 @@
 
 include (player/player.pri)
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
 
--- a/qtmobility/plugins/multimedia/gstreamer/gstreamer.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/gstreamer/gstreamer.pro	Thu May 27 13:42:11 2010 +0300
@@ -82,5 +82,6 @@
     DEFINES += GST_USE_UNSTABLE_API #prevents warnings because of unstable photography API 
 }
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/multimedia/m3u/m3u.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/m3u/m3u.pro	Thu May 27 13:42:11 2010 +0300
@@ -23,9 +23,10 @@
     
     #make a sis package from plugin + stub (plugin)
     pluginDep.sources = $${TARGET}.dll
-    pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_SUBDIR}/playlistformats
+    pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
     DEPLOYMENT += pluginDep
 }
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/playlistformats
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/multimedia/qt7/qt7.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/qt7/qt7.pro	Thu May 27 13:42:11 2010 +0300
@@ -57,5 +57,6 @@
     qcvdisplaylink.mm
 
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/multimedia/symbian/common/s60videooutputcontrol.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/common/s60videooutputcontrol.h	Thu May 27 13:42:11 2010 +0300
@@ -43,7 +43,7 @@
 #define S60VIDEOOUTPUTCONTROL_H
 
 #include <QObject>
-#include <QVideoOutputControl>
+#include <qvideooutputcontrol.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocaptureservice.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocaptureservice.h	Thu May 27 13:42:11 2010 +0300
@@ -44,7 +44,7 @@
 
 #include <QtCore/qobject.h>
 
-#include <QMediaService>
+#include <qmediaservice.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocapturesession.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocapturesession.h	Thu May 27 13:42:11 2010 +0300
@@ -49,7 +49,7 @@
 #include <QList>
 #include <QHash>
 #include <QAudioFormat>
-#include <QMediaRecorder>
+#include <qmediarecorder.h>
 
 #include <Mda\Common\Audio.h>
 #include <Mda\Common\Resource.h>
--- a/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocontainercontrol.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audiocontainercontrol.h	Thu May 27 13:42:11 2010 +0300
@@ -42,7 +42,7 @@
 #ifndef S60AUDIOFORMATCONTROL_H
 #define S60AUDIOFORMATCONTROL_H
 
-#include "QMediaContainerControl"
+#include <qmediacontainercontrol.h>
 #include <QtCore/qstringlist.h>
 
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audioencodercontrol.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audioencodercontrol.h	Thu May 27 13:42:11 2010 +0300
@@ -42,7 +42,7 @@
 #ifndef AUDIOENCODERCONTROL_H
 #define AUDIOENCODERCONTROL_H
 
-#include <QAudioEncoderControl>
+#include <qaudioencodercontrol.h>
 #include <QtCore/qstringlist.h>
 #include <QAudioFormat>
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audioendpointselector.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/audiosource/s60audioendpointselector.h	Thu May 27 13:42:11 2010 +0300
@@ -44,7 +44,7 @@
 
 #include <QStringList>
 
-#include <QAudioEndpointSelector>
+#include <qaudioendpointselector.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediametadataprovider.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediametadataprovider.h	Thu May 27 13:42:11 2010 +0300
@@ -42,7 +42,7 @@
 #ifndef S60MEDIAMETADATAPROVIDER_H
 #define S60MEDIAMETADATAPROVIDER_H
 
-#include <QMetaDataControl>
+#include <qmetadatacontrol.h>
 #include "ms60mediaplayerresolver.h"
 
 QT_USE_NAMESPACE
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayeraudioendpointselector.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayeraudioendpointselector.h	Thu May 27 13:42:11 2010 +0300
@@ -44,7 +44,7 @@
 
 #include <QStringList>
 
-#include <QAudioEndpointSelector>
+#include <qaudioendpointselector.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayercontrol.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayercontrol.h	Thu May 27 13:42:11 2010 +0300
@@ -44,7 +44,7 @@
 
 #include <QtCore/qobject.h>
 
-#include <QMediaPlayerControl>
+#include <qmediaplayercontrol.h>
 
 #include "ms60mediaplayerresolver.h"
 #include <QtCore/qdebug.h>
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp	Thu May 27 13:42:11 2010 +0300
@@ -55,8 +55,8 @@
 #include "s60videorenderer.h"
 #include "s60mediaplayeraudioendpointselector.h"
 
-#include <QMediaPlaylistNavigator>
-#include <QMediaPlaylist>
+#include <qmediaplaylistnavigator.h>
+#include <qmediaplaylist.h>
 
 S60MediaPlayerService::S60MediaPlayerService(QObject *parent)
     : QMediaService(parent)
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.h	Thu May 27 13:42:11 2010 +0300
@@ -44,8 +44,8 @@
 
 #include <QtCore/qobject.h>
 
-#include <QMediaService>
-#include <QVideoOutputControl>
+#include <qmediaservice.h>
+#include <qvideooutputcontrol.h>
 
 #include "s60videooutputcontrol.h"
 #include "ms60mediaplayerresolver.h"
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayersession.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayersession.h	Thu May 27 13:42:11 2010 +0300
@@ -45,7 +45,7 @@
 #include <QtCore/qobject.h>
 #include <QtCore/qurl.h>
 #include <QtCore/qpair.h>
-#include <QMediaPlayer>
+#include <qmediaplayer.h>
 #include <e32cmn.h> // for TDesC
 #include <QRect>
 #include "s60mediaplayerservice.h"
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videooverlay.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videooverlay.h	Thu May 27 13:42:11 2010 +0300
@@ -43,7 +43,7 @@
 #define S60VIDEOOVERLAY_H
 
 #include <QtCore/qobject.h>
-#include <QVideoWindowControl>
+#include <qvideowindowcontrol.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,7 @@
 #include "s60mediaplayeraudioendpointselector.h"
 #include <videoplayer.h>
 #include <QtGui/qwidget.h>
-#include <QVideoWidget>
+#include <qvideowidget.h>
 
 #include <AudioOutput.h>
 #include <MAudioOutputObserver.h>
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videorenderer.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videorenderer.h	Thu May 27 13:42:11 2010 +0300
@@ -43,7 +43,7 @@
 #define S60VIDEORENDERER_H
 
 #include <QtCore/qobject.h>
-#include <QVideoRendererControl>
+#include <qvideorenderercontrol.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videowidget.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60videowidget.h	Thu May 27 13:42:11 2010 +0300
@@ -42,7 +42,7 @@
 #ifndef S60VIDEOWIDGET_H
 #define S60VIDEOWIDGET_H
 
-#include <QVideoWidgetControl>
+#include <qvideowidgetcontrol.h>
 #include <qmediaplayer.h>
 
 QT_USE_NAMESPACE
--- a/qtmobility/plugins/multimedia/symbian/mmf/mmf.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/mmf.pro	Thu May 27 13:42:11 2010 +0300
@@ -2,7 +2,7 @@
 QT += multimedia
 CONFIG += plugin
 TARGET = qtmedia_mmfengine
-PLUGIN_SUBDIR = mediaservice
+PLUGIN_TYPE = mediaservice
 include (../../../../common.pri)
 qtAddLibrary(QtMedia)
 
@@ -45,7 +45,7 @@
 
 #make a sis package from plugin + api + stub (plugin)
 pluginDep.sources = $${TARGET}.dll
-pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_SUBDIR}
+pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
 DEPLOYMENT += pluginDep      
 
 #Media API spesific deployment
--- a/qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunercontrol_31.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunercontrol_31.h	Thu May 27 13:42:11 2010 +0300
@@ -43,8 +43,8 @@
 #define S60RADIOTUNERCONTROL_H
 
 #include <QtCore/qobject.h>
-#include <QRadioTunerControl>
-#include <QRadioTuner>
+#include <qradiotunercontrol.h>
+#include <qradiotuner.h>
 #include <tuner.h>
 
 class S60RadioTunerService;
--- a/qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunercontrol_since32.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunercontrol_since32.h	Thu May 27 13:42:11 2010 +0300
@@ -43,8 +43,8 @@
 #define S60RADIOTUNERCONTROL_H
 
 #include <QtCore/qobject.h>
-#include <QRadioTunerControl>
-#include <QRadioTuner>
+#include <qradiotunercontrol.h>
+#include <qradiotuner.h>
 
 #include <radioutility.h>
 #include <radiofmtunerutility.h>
--- a/qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunerservice.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/radio/s60radiotunerservice.h	Thu May 27 13:42:11 2010 +0300
@@ -44,7 +44,7 @@
 
 #include <QtCore/qobject.h>
 
-#include <QMediaService>
+#include <qmediaservice.h>
 
 #ifdef TUNERLIBUSED
 #include "s60radiotunercontrol_31.h"
--- a/qtmobility/plugins/multimedia/symbian/mmf/s60mediaserviceplugin.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/mmf/s60mediaserviceplugin.h	Thu May 27 13:42:11 2010 +0300
@@ -44,8 +44,8 @@
 #define S60SERVICEPLUGIN_H
 
 #include <QtCore/qobject.h>
-#include <QMediaService>
-#include <QMediaServiceProviderPlugin>
+#include <qmediaservice.h>
+#include <qmediaserviceproviderplugin.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/plugins/multimedia/symbian/openmaxal/mediarecorder/mediarecorder.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/symbian/openmaxal/mediarecorder/mediarecorder.pro	Thu May 27 13:42:11 2010 +0300
@@ -2,7 +2,7 @@
 CONFIG += plugin
 TARGET = qtmedia_xarecordservice
 
-PLUGIN_SUBDIR = mediaservice
+PLUGIN_TYPE = mediaservice
 
 include (../../../../../common.pri)
 
@@ -13,7 +13,7 @@
 # Input parameters for qmake to make the dll a qt plugin
 # ------------------------------------------------------
 pluginstub.sources = qmakepluginstubs/qtmedia_xarecordservice.dll
-pluginstub.path = /resource/qt/plugins/mediaservice
+pluginstub.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
 DEPLOYMENT += pluginstub
 
 # Input parameters for the generated bld.inf file
--- a/qtmobility/plugins/multimedia/v4l/v4l.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/v4l/v4l.pro	Thu May 27 13:42:11 2010 +0300
@@ -18,5 +18,6 @@
 
 include(radio/radio.pri)
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/multimedia/wmp/wmp.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/multimedia/wmp/wmp.pro	Thu May 27 13:42:11 2010 +0300
@@ -2,7 +2,7 @@
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(qtmedia_wmp)
 
-PLUGIN_TYPE = mediaservice
+PLUGIN_TYPE=mediaservice
 
 INCLUDEPATH+=../../../src/multimedia
 include(../../../common.pri)
@@ -43,5 +43,6 @@
     qwmpvideooutputcontrol.cpp \
     qwmpvideooverlay.cpp
 
-target.path=$$QT_MOBILITY_PREFIX/plugins/mediaservice
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS+=target
--- a/qtmobility/plugins/sensors/dummy/dummy.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/dummy/dummy.pro	Thu May 27 13:42:11 2010 +0300
@@ -4,6 +4,8 @@
 include(dummy.pri)
 include(../../../common.pri)
 
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(qtsensors_dummy)
@@ -15,7 +17,7 @@
 
 CONFIG+=strict_flags
 
-DESTDIR = $$OUTPUT_DIR/bin/examples/sensors
-target.path = $$SOURCE_DIR/plugins/sensors
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
 
--- a/qtmobility/plugins/sensors/generic/generic.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/generic/generic.pro	Thu May 27 13:42:11 2010 +0300
@@ -4,6 +4,8 @@
 include(generic.pri)
 include(../../../common.pri)
 
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(qtsensors_generic)
@@ -14,7 +16,7 @@
    TARGET.CAPABILITY = ALL -TCB
 
    pluginDep.sources = $${TARGET}.dll
-   pluginDep.path = $${QT_PLUGINS_BASE_DIR}/sensors
+   pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
    DEPLOYMENT += pluginDep
 }
 
@@ -24,7 +26,7 @@
 
 CONFIG+=strict_flags
 
-DESTDIR = $$OUTPUT_DIR/bin/examples/sensors
-target.path = $$SOURCE_DIR/plugins/sensors
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/plugins/sensors/maemo6/maemo6.pri	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,20 @@
+HEADERS += maemo6sensorbase.h \
+    maemo6accelerometer.h \
+    maemo6als.h \
+    maemo6compass.h \
+    maemo6magnetometer.h \
+    maemo6orientationsensor.h \
+    maemo6proximitysensor.h \
+    maemo6rotationsensor.h \
+    maemo6tapsensor.h
+
+SOURCES += maemo6sensorbase.cpp \
+    maemo6accelerometer.cpp \
+    maemo6als.cpp \
+    maemo6compass.cpp \
+    maemo6magnetometer.cpp \
+    maemo6orientationsensor.cpp \
+    maemo6proximitysensor.cpp \
+    maemo6rotationsensor.cpp \
+    maemo6tapsensor.cpp \
+    main.cpp
--- a/qtmobility/plugins/sensors/maemo6/maemo6.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6.pro	Thu May 27 13:42:11 2010 +0300
@@ -1,31 +1,22 @@
+INCLUDEPATH+=../../../src/sensors
+
+include(version.pri)
+include(maemo6.pri)
+include(../../../common.pri)
+
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
-TARGET = maemo6sensorplugin
-DEPENDPATH += .
-INCLUDEPATH += .
-QT += dbus
-QT += network
 CONFIG += plugin
-CONFIG += sensord
-CONFIG += link_pkgconfig
+TARGET = $$qtLibraryTarget(qtsensors_maemo6)
+
+QT = core dbus network
 CONFIG += mobility
-HEADERS += maemo6sensorbase.h \
-    maemo6accelerometer.h \
-    maemo6als.h \
-    maemo6compass.h \
-    maemo6magnetometer.h \
-    maemo6orientationsensor.h \
-    maemo6proximitysensor.h \
-    maemo6rotationsensor.h \
-    maemo6tapsensor.h
-SOURCES += maemo6sensorbase.cpp \
-    maemo6accelerometer.cpp \
-    maemo6als.cpp \
-    maemo6compass.cpp \
-    maemo6magnetometer.cpp \
-    maemo6orientationsensor.cpp \
-    maemo6proximitysensor.cpp \
-    maemo6rotationsensor.cpp \
-    maemo6tapsensor.cpp \
-    main.cpp
-target.path = /usr/lib/qt4/plugins/sensors
+MOBILITY += sensors
+CONFIG += link_pkgconfig
+PKGCONFIG += sensord
+
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
+
--- a/qtmobility/plugins/sensors/maemo6/maemo6accelerometer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6accelerometer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -60,7 +60,8 @@
             qWarning() << "Unable to initialize accelerometer sensor.";
 
         // adding metadata
-        addDataRate(100, 100); // 100Hz
+        addDataRate(142, 142); // 142Hz
+        sensor->setDataRate(142);
         //addDataRate(400, 400); // 400Hz
 
         // accuracy - or resolution???
@@ -77,9 +78,9 @@
 {
     // Convert from milli-Gs to meters per second per second
     // Using 1 G = 9.80665 m/s^2
-    qreal ax = - data.x() * GRAVITY_EARTH_THOUSANDTH;
-    qreal ay = - data.y() * GRAVITY_EARTH_THOUSANDTH;
-    qreal az = - data.z() * GRAVITY_EARTH_THOUSANDTH;
+    qreal ax = -data.x() * GRAVITY_EARTH_THOUSANDTH;
+    qreal ay = -data.y() * GRAVITY_EARTH_THOUSANDTH;
+    qreal az = -data.z() * GRAVITY_EARTH_THOUSANDTH;
 
     m_reading.setX(ax);
     m_reading.setY(ay);
@@ -88,4 +89,3 @@
     m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp
     newReadingAvailable();
 }
-
--- a/qtmobility/plugins/sensors/maemo6/maemo6als.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6als.cpp	Thu May 27 13:42:11 2010 +0300
@@ -57,6 +57,8 @@
             qWarning() << "Unable to initialize ambient light sensor.";
 
         // metadata
+        addDataRate(1, 1); // 1Hz
+        sensor->setDataRate(1);
         addOutputRange(0, 5, 1);
         setDescription(QLatin1String("Ambient light intensity given as 5 pre-defined levels"));
 
--- a/qtmobility/plugins/sensors/maemo6/maemo6compass.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6compass.cpp	Thu May 27 13:42:11 2010 +0300
@@ -60,8 +60,9 @@
         }
 
         // metadata TODO accuracy
-        addDataRate(10, 10); // 10Hz
-        addOutputRange(0, 359, 2);
+        addDataRate(43, 43); // 43Hz
+        sensor->setDataRate(43);
+        addOutputRange(0, 359, 1);
         setDescription(QLatin1String("Measures compass north in degrees"));
  
         m_initDone = true;
@@ -91,4 +92,3 @@
     m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp
     newReadingAvailable();
 }
-
--- a/qtmobility/plugins/sensors/maemo6/maemo6magnetometer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6magnetometer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -59,6 +59,9 @@
             qWarning() << "Unable to initialize magnetometer sensor.";
 
         // metadata
+        addDataRate(43, 43); // 43Hz
+        sensor->setDataRate(43);
+        addOutputRange(-0.000614, 0.000614, 0.0000003); // -600 ... 600 mikroteslas, 0.3 uT resolution
         setDescription(QLatin1String("Magnetic flux density measured in teslas"));
 
         m_initDone = true;
@@ -69,14 +72,14 @@
 {
     QVariant v = m_sensor->property("returnGeoValues");
     if (v.isValid() && v.toBool()) {
-        m_reading.setX(data.x());
-        m_reading.setY(data.y());
-        m_reading.setZ(data.z());
-        m_reading.setCalibrationLevel(data.level());
+        m_reading.setX( 0.0000003 * data.x() );
+        m_reading.setY( 0.0000003 * data.y() );
+        m_reading.setZ( 0.0000003 * data.z() );
+        m_reading.setCalibrationLevel( ((float) data.level()) / 3.0 );
     } else {
-        m_reading.setX(data.rx());
-        m_reading.setY(data.ry());
-        m_reading.setZ(data.rz());
+        m_reading.setX( 0.0000003 * data.rx() );
+        m_reading.setY( 0.0000003 * data.ry() );
+        m_reading.setZ( 0.0000003 * data.rz() );
         m_reading.setCalibrationLevel(1);
     }
     //m_reading.setTimestamp(data.timestamp());
--- a/qtmobility/plugins/sensors/maemo6/maemo6orientationsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6orientationsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -60,6 +60,8 @@
             qWarning() << "Unable to initialize orientation sensor.";
 
         // metadata
+        addDataRate(142, 142); // 142Hz
+        sensor->setDataRate(142);
         addOutputRange(0, 6, 1);
         setDescription(QLatin1String("Orientation of the device screen"));
 
--- a/qtmobility/plugins/sensors/maemo6/maemo6proximitysensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6proximitysensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -57,8 +57,10 @@
         else
             qWarning() << "Unable to initialize proximity sensor.";
 
-        // close definition in meters - may be used as metadata even the sensor gives true/false values 
-        addOutputRange(0, 1, 1);
+        // metadata
+        addDataRate(2, 2); // 2Hz
+        sensor->setDataRate(2);
+        addOutputRange(0, 1, 1); // close definition in meters - may be used as metadata even the sensor gives true/false values
         setDescription(QLatin1String("Measures if a living object is in proximity or not"));
 
         m_initDone = true;
--- a/qtmobility/plugins/sensors/maemo6/maemo6rotationsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6rotationsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -59,6 +59,10 @@
         else
             qWarning() << "Unable to initialize rotation sensor.";
 
+        // metadata
+        addDataRate(23, 23); // 23Hz
+        sensor->setDataRate(23);
+        addOutputRange(-180, 180, 1);
         setDescription(QLatin1String("Measures x, y, and z axes rotation"));
 
         m_initDone = true;
@@ -75,4 +79,3 @@
     m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp
     newReadingAvailable();
 }
-
--- a/qtmobility/plugins/sensors/maemo6/maemo6sensorbase.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6sensorbase.cpp	Thu May 27 13:42:11 2010 +0300
@@ -68,11 +68,15 @@
         return;
     if (m_sensorInterface) {
         int dataRate = sensor()->dataRate();
-        qDebug() << "Sensor data rate " << dataRate;
-
+        int interval = 1000 / dataRate;
+        // for testing max speed
+        //interval = 1;
+        //dataRate = 1000;
         if (dataRate > 0) {
-            qDebug() << "Setting data rate " << dataRate << " for " << m_sensorInterface->id();
-            m_sensorInterface->setInterval(dataRate);
+            qDebug() << "Setting data rate" << dataRate << "Hz (interval" << interval << "ms) for" << m_sensorInterface->id();
+            m_sensorInterface->setInterval(interval);
+        } else {
+            qDebug() << "Sensor data rate" << dataRate << "Hz";
         }
         m_sensorInterface->start();
     }
--- a/qtmobility/plugins/sensors/maemo6/maemo6tapsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/maemo6/maemo6tapsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -61,6 +61,8 @@
             qWarning() << "Unable to initialize tap sensor.";
 
         // metadata
+        addDataRate(100, 100); // 100Hz
+        sensor->setDataRate(100);
         addOutputRange(0, 9, 1);
         setDescription(QLatin1String("Measures single and double taps and gives tap direction"));
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/plugins/sensors/maemo6/version.pri	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,1 @@
+VERSION = 1.0.0
--- a/qtmobility/plugins/sensors/n900/n900.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/n900/n900.pro	Thu May 27 13:42:11 2010 +0300
@@ -4,6 +4,8 @@
 include(n900.pri)
 include(../../../common.pri)
 
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(qtsensors_n900)
@@ -14,8 +16,8 @@
 
 CONFIG+=strict_flags
 
-DESTDIR = $$OUTPUT_DIR/bin/examples/sensors
-target.path = $$SOURCE_DIR/plugins/sensors
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
 
 BUILD_ALL_PLUGINS=$$(BUILD_ALL_PLUGINS)
--- a/qtmobility/plugins/sensors/s60_sensor_api/s60_sensor_api.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/s60_sensor_api/s60_sensor_api.pro	Thu May 27 13:42:11 2010 +0300
@@ -4,6 +4,8 @@
 include(s60_sensor_api.pri)
 include(version.pri)
 
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
 CONFIG += plugin
 
@@ -18,8 +20,9 @@
 
 #S60 v3.1 sensor back end deployment
 s60sensorapi.sources = $${TARGET}.dll
-s60sensorapi.path = $${QT_PLUGINS_BASE_DIR}/sensors
+s60sensorapi.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
 DEPLOYMENT += s60sensorapi
 
-target.path += $$[QT_INSTALL_PLUGINS]/sensors
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
--- a/qtmobility/plugins/sensors/sensors.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/sensors.pro	Thu May 27 13:42:11 2010 +0300
@@ -6,6 +6,14 @@
     SUBDIRS += n900
 }
 
+maemo6 {
+    equals(sensord_enabled,yes) {
+        SUBDIRS += maemo6
+    } else {
+        message("sensord library missing")
+    }
+}
+
 symbian {
     equals(sensors_symbian_enabled,yes) {
         SUBDIRS += symbian
--- a/qtmobility/plugins/sensors/symbian/symbian.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/plugins/sensors/symbian/symbian.pro	Thu May 27 13:42:11 2010 +0300
@@ -5,6 +5,8 @@
 #include(symbian.pri)
 include(../../../common.pri)
 
+PLUGIN_TYPE = sensors
+
 TEMPLATE = lib
 CONFIG += plugin
 TARGET = $$qtLibraryTarget(qtsensors_sym)
@@ -43,15 +45,8 @@
 MOBILITY+=sensors
 DEFINES+=QT_MAKEDLL
 
-#QMAKE_CXXFLAGS+=-Werror
-
-#MOC_DIR = moc/
-#OBJECTS_DIR = obj/
-
-#DESTDIR = $$OUTPUT_DIR/bin/examples/sensors
-#target.path = $$SOURCE_DIR/plugins/sensors
-#INSTALLS += target
 symbian {
+    TARGET.UID3 = 0x2002BFC8
     TARGET.CAPABILITY = ALL -TCB    
     LIBS += -lSensrvClient
     LIBS += -lsensrvutil   
@@ -62,10 +57,11 @@
  
 # Defines plugin files into Symbian .pkg package
 pluginDep.sources = qtsensors_sym.dll
-pluginDep.path = $$QT_PLUGINS_BASE_DIR/sensors
+pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
 DEPLOYMENT += pluginDep
 }
- 
-target.path += $$[QT_INSTALL_PLUGINS]/sensors
+
+target.path=$${QT_MOBILITY_PREFIX}/plugins/$${PLUGIN_TYPE}
+maemo6:target.path=$$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
 INSTALLS += target
 
--- a/qtmobility/qtmobility.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/qtmobility.pro	Thu May 27 13:42:11 2010 +0300
@@ -19,28 +19,6 @@
     #happen if we are trying to shadow build w/o running configure
 }
 
-#creating qbuildcfg header
-!exists($$QT_MOBILITY_BUILD_TREE/src/global){
-	message("creating qbuildcfg header")
-	symbian|win32|wince*{
-		system($$QMAKE_MKDIR $$QT_MOBILITY_BUILD_TREE\src\global)
-	}
-	else{
-		system($$QMAKE_MKDIR $$QT_MOBILITY_BUILD_TREE/src/global)
-	}
-}
-	
-QCFGH_OUTPUT=$$QT_MOBILITY_BUILD_TREE/src/global/qbuildcfg.h
-mobilityprefixpath = $$QT_MOBILITY_PREFIX
-symbian|win32|wince*{
-	mobilityprefixpath = $$replace(mobilityprefixpath, \\\, \\\\)
-	system(echo static const char qt_mobility_configure_prefix_path_str [512 + 12] = \"$$mobilityprefixpath\\0\"; > $$QCFGH_OUTPUT)
-}
-else{
-	system(echo static const char qt_mobility_configure_prefix_path_str [512 + 12] = '\\\"$$mobilityprefixpath\\\0\\\"\;' > $$QCFGH_OUTPUT)
-}
-
-
 #don't build QtMobility if chosen config mismatches Qt's config
 win32:!contains(CONFIG_WIN32,build_all) {
    contains(QT_CONFIG,debug):!contains(QT_CONFIG,release):contains(CONFIG_WIN32,release) {
@@ -115,6 +93,65 @@
 
 # install Qt style headers
 qtmheaders.path = $${QT_MOBILITY_INCLUDE}
-qtmheaders.files = $${QT_MOBILITY_BUILD_TREE}/include/*
+
+!symbian {
+    qtmheaders.files = $${QT_MOBILITY_BUILD_TREE}/include/QtmBearer/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmContacts/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmLocation/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmMessaging/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmMedia/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmPubSub/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmServiceFramework/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmVersit/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmSystemInfo/* \
+                         $${QT_MOBILITY_BUILD_TREE}/include/QtmSensors/*
+    INSTALLS += qtmheaders
+} else {
+
+#    Can we assume the path exists?
+#    paths = $$MW_LAYER_PUBLIC_EXPORT_PATH("") \
+#            $$APP_LAYER_PUBLIC_EXPORT_PATH("")
+#    for(i, paths) {
+#        exportPath=$$EPOCROOT"."$$dirname($$i)
+#        nativePath=$$replace(exportPath, /,\)
+#        !exists($$nativePath):system($$QMAKE_MKDIR $$nativePath)
+#    }
+
+    #absolute path does not work and so is shadow building for Symbian
+    qtmAppHeaders = include/QtmContacts/* \
+                          include/QtmVersit/*
 
-INSTALLS += qtmheaders
+    qtmMwHeaders = include/QtmBearer/* \
+                       include/QtmLocation/* \
+                       include/QtmMessaging/* \
+                       include/QtmMedia/* \
+                       include/QtmPubSub/* \
+                       include/QtmServiceFramework/* \
+                       include/QtmSystemInfo/* \
+                       include/QtmSensors/*
+
+    contains(mobility_modules,contacts|versit) {
+        for(api, qtmAppHeaders) {
+            INCLUDEFILES=$$files($$api);
+            #files() attaches a ';' at the end which we need to remove
+            cleanedFiles=$$replace(INCLUDEFILES, ;,)
+            for(header, cleanedFiles) {
+                exists($$header):
+                    BLD_INF_RULES.prj_exports += "$$header $$APP_LAYER_PUBLIC_EXPORT_PATH($$basename(header))"
+            }
+        }
+    }
+
+    contains(mobility_modules,serviceframework|location|bearer|publishsubscribe|systeminfo|multimedia|messaging) {
+        for(api, qtmMwHeaders) {
+            INCLUDEFILES=$$files($$api);
+            #files() attaches a ';' at the end which we need to remove
+            cleanedFiles=$$replace(INCLUDEFILES, ;,)
+            for(header, cleanedFiles) {
+                exists($$header):
+                    BLD_INF_RULES.prj_exports += "$$header $$MW_LAYER_PUBLIC_EXPORT_PATH($$basename(header))"
+            }
+        }
+    }
+}
+
--- a/qtmobility/src/contacts/qcontactmanager.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/contacts/qcontactmanager.cpp	Thu May 27 13:42:11 2010 +0300
@@ -541,13 +541,10 @@
 }
 
 /*!
-  \preliminary
   Returns a pruned or modified version of the \a original contact which is valid and can be saved in the manager.
   The returned contact might have entire details removed or arbitrarily changed.  The cache of relationships
   in the contact are ignored entirely when considering compatibility with the backend, as they are
   saved and validated separately.
-
-  This function is preliminary and the behaviour is subject to change!
  */
 QContact QContactManager::compatibleContact(const QContact& original)
 {
--- a/qtmobility/src/contacts/qcontactmanager_p.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/contacts/qcontactmanager_p.cpp	Thu May 27 13:42:11 2010 +0300
@@ -39,7 +39,6 @@
 **
 ****************************************************************************/
 
-#include <src/global/qbuildcfg.h>
 #include "qcontactmanager.h"
 #include "qcontactmanager_p.h"
 #include "qcontactmanagerengine.h"
@@ -63,6 +62,7 @@
 
 #include "qcontactmemorybackend_p.h"
 #include "qcontactinvalidbackend_p.h"
+#include "qmobilitypluginsearch.h"
 
 QTM_BEGIN_NAMESPACE
 
@@ -191,63 +191,6 @@
     }
 }
 
-class DirChecker
-{
-public:
-    DirChecker();
-    ~DirChecker();
-    bool checkDir(const QDir& dir);
-
-private:
-#if defined(Q_OS_SYMBIAN)
-    RFs rfs;
-#endif
-};
-
-#if defined(Q_OS_SYMBIAN)
-DirChecker::DirChecker()
-{
-    qt_symbian_throwIfError(rfs.Connect());
-}
-
-bool DirChecker::checkDir(const QDir& dir)
-{
-    bool pathFound = false;
-    // In Symbian, going cdUp() in a c:/private/<uid3>/ will result in *platsec* error at fileserver (requires AllFiles capability)
-    // Also, trying to cd() to a nonexistent directory causes *platsec* error. This does not cause functional harm, but should
-    // nevertheless be changed to use native Symbian methods to avoid unnecessary platsec warnings (as per qpluginloader.cpp).
-    // Use native Symbian code to check for directory existence, because checking
-    // for files from under non-existent protected dir like E:/private/<uid> using
-    // QDir::exists causes platform security violations on most apps.
-    QString nativePath = QDir::toNativeSeparators(dir.absolutePath());
-    TPtrC ptr = TPtrC16(static_cast<const TUint16*>(nativePath.utf16()), nativePath.length());
-    TUint attributes;
-    TInt err = rfs.Att(ptr, attributes);
-    if (err == KErrNone) {
-        // yes, the directory exists.
-        pathFound = true;
-    }
-    return pathFound;
-}
-
-DirChecker::~DirChecker()
-{
-    rfs.Close();
-}
-#else
-DirChecker::DirChecker()
-{
-}
-
-DirChecker::~DirChecker()
-{
-}
-
-bool DirChecker::checkDir(const QDir &dir)
-{
-    return dir.exists();
-}
-#endif
 
 /* Plugin loader */
 void QContactManagerData::loadFactories()
@@ -259,69 +202,16 @@
     // Always do this..
     loadStaticFactories();
 
-    if (!m_discovered || QApplication::libraryPaths() != m_pluginPaths) {
-        m_discovered = true;
-        m_pluginPaths = QApplication::libraryPaths();
-
-        /* Discover a bunch o plugins */
-        QStringList plugins;
-
-        QStringList paths;
-        QSet<QString> processed;
-
-        paths << QApplication::applicationDirPath() << QApplication::libraryPaths();
-        QString val = qt_mobility_configure_prefix_path_str;
-        if(val.length() > 0){
-            paths << val;
-        }
-#if !defined QT_NO_DEBUG
-        if (showDebug)
-            qDebug() << "Plugin paths:" << paths;
-#endif
-
-        DirChecker dirChecker;
+    QStringList plugins;
+    plugins = mobilityPlugins(QLatin1String("contacts"));
 
-        /* Enumerate our plugin paths */
-        for (int i=0; i < paths.count(); i++) {
-            if (processed.contains(paths.at(i)))
-                continue;
-            processed.insert(paths.at(i));
-            QDir pluginsDir(paths.at(i));
-            if (!dirChecker.checkDir(pluginsDir))
-                continue;
-
-#if defined(Q_OS_WIN)
-            if (pluginsDir.dirName().toLower() == QLatin1String("debug") || pluginsDir.dirName().toLower() == QLatin1String("release"))
-                pluginsDir.cdUp();
-#elif defined(Q_OS_MAC)
-            if (pluginsDir.dirName() == QLatin1String("MacOS")) {
-                pluginsDir.cdUp();
-                pluginsDir.cdUp();
-                pluginsDir.cdUp();
-            }
-#endif
-
-            QString subdir(QLatin1String("plugins/contacts"));
-            if (pluginsDir.path().endsWith(QLatin1String("/plugins"))
-                || pluginsDir.path().endsWith(QLatin1String("/plugins/")))
-                subdir = QLatin1String("contacts");
-
-            if (dirChecker.checkDir(QDir(pluginsDir.path() + QLatin1Char('/') + subdir))) {
-                pluginsDir.cd(subdir);
-                const QStringList& files = pluginsDir.entryList(QDir::Files);
-#if !defined QT_NO_DEBUG
-                if (showDebug)
-                    qDebug() << "Looking for contacts plugins in" << pluginsDir.path() << files;
-#endif
-                for (int j=0; j < files.count(); j++) {
-                    plugins <<  pluginsDir.absoluteFilePath(files.at(j));
-                }
-            }
-        }
+    if (!m_discovered || plugins != m_pluginPaths) {
+        m_discovered = true;
+        m_pluginPaths = plugins;
 
         /* Now discover the dynamic plugins */
-        for (int i=0; i < plugins.count(); i++) {
-            QPluginLoader qpl(plugins.at(i));
+        for (int i=0; i < m_pluginPaths.count(); i++) {
+            QPluginLoader qpl(m_pluginPaths.at(i));
             QContactManagerEngineFactory *f = qobject_cast<QContactManagerEngineFactory*>(qpl.instance());
             if (f) {
                 QString name = f->managerName();
@@ -332,12 +222,12 @@
                 if (name != QLatin1String("memory") && name != QLatin1String("invalid") && !name.isEmpty()) {
                     // we also need to ensure that we haven't already loaded this factory.
                     if (m_engines.keys().contains(name)) {
-                        qWarning() << "Contacts plugin" << plugins.at(i) << "has the same name as currently loaded plugin" << name << "; ignored";
+                        qWarning() << "Contacts plugin" << m_pluginPaths.at(i) << "has the same name as currently loaded plugin" << name << "; ignored";
                     } else {
                         m_engines.insertMulti(name, f);
                     }
                 } else {
-                    qWarning() << "Contacts plugin" << plugins.at(i) << "with reserved name" << name << "ignored";
+                    qWarning() << "Contacts plugin" << m_pluginPaths.at(i) << "with reserved name" << name << "ignored";
                 }
             }
 
--- a/qtmobility/src/contacts/qcontactmanagerengine.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/contacts/qcontactmanagerengine.cpp	Thu May 27 13:42:11 2010 +0300
@@ -60,7 +60,6 @@
 
 /*!
   \class QContactManagerEngine
-  \preliminary
   \brief The QContactManagerEngine class provides the interface for all
   implementations of the contact manager backend functionality.
   \ingroup contacts-backends
@@ -73,7 +72,8 @@
   can simply implement the functionality that is supported by
   the specific contacts engine that is being adapted.
 
-  More information on writing a contacts engine plugin is TODO.
+  More information on writing a contacts engine plugin is available in
+  the \l{Qt Contacts Manager Engines} documentation.
 
   \sa QContactManager, QContactManagerEngineFactory
  */
--- a/qtmobility/src/contacts/qcontactmanagerenginefactory.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/contacts/qcontactmanagerenginefactory.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
 
 /*!
   \class QContactManagerEngineFactory
-  \preliminary
   \brief The QContactManagerEngineFactory class provides the interface for
  plugins that implement QContactManagerEngine functionality.
   \ingroup contacts-backends
@@ -56,7 +55,8 @@
   associated with it, which forms the \c managerName parameter
   when creating \l QContactManager objects.
  
-  More information on writing a contacts engine plugin is TODO.
+  More information on writing a contacts engine plugin is available in
+  the \l{Qt Contacts Manager Engines} documentation.
  
   \sa QContactManager, QContactManagerEngine
  */
--- a/qtmobility/src/global/qmobilityglobal.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/global/qmobilityglobal.h	Thu May 27 13:42:11 2010 +0300
@@ -42,13 +42,13 @@
 #define QMOBILITYGLOBAL_H
 
 
-#define QTM_VERSION_STR   "1.0.0"
+#define QTM_VERSION_STR   "1.0.1"
 /*
    QTM_VERSION is (major << 16) + (minor << 8) + patch.
 */
-#define QTM_VERSION 0x010000
+#define QTM_VERSION 0x010001
 /*
-   can be used like #if (QTM_VERSION >= QTM_VERSION_CHECK(1, 0, 0))
+   can be used like #if (QTM_VERSION >= QTM_VERSION_CHECK(1, 0, 1))
 */
 #define QTM_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/src/global/qmobilitypluginsearch.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QApplication>
+#include <QStringList>
+
+#if defined(Q_OS_SYMBIAN)
+# include <f32file.h>
+#endif
+
+QTM_BEGIN_NAMESPACE
+
+class DirChecker
+{
+public:
+    DirChecker();
+    ~DirChecker();
+    bool checkDir(const QDir& dir);
+
+private:
+#if defined(Q_OS_SYMBIAN)
+    RFs rfs;
+#endif
+};
+
+#if defined(Q_OS_SYMBIAN)
+DirChecker::DirChecker()
+{
+    qt_symbian_throwIfError(rfs.Connect());
+}
+
+bool DirChecker::checkDir(const QDir& dir)
+{
+    bool pathFound = false;
+    // In Symbian, going cdUp() in a c:/private/<uid3>/ will result in *platsec* error at fileserver (requires AllFiles capability)
+    // Also, trying to cd() to a nonexistent directory causes *platsec* error. This does not cause functional harm, but should
+    // nevertheless be changed to use native Symbian methods to avoid unnecessary platsec warnings (as per qpluginloader.cpp).
+    // Use native Symbian code to check for directory existence, because checking
+    // for files from under non-existent protected dir like E:/private/<uid> using
+    // QDir::exists causes platform security violations on most apps.
+    QString nativePath = QDir::toNativeSeparators(dir.absolutePath());
+    TPtrC ptr = TPtrC16(static_cast<const TUint16*>(nativePath.utf16()), nativePath.length());
+    TUint attributes;
+    TInt err = rfs.Att(ptr, attributes);
+    if (err == KErrNone) {
+        // yes, the directory exists.
+        pathFound = true;
+    }
+    return pathFound;
+}
+
+DirChecker::~DirChecker()
+{
+    rfs.Close();
+}
+#else
+DirChecker::DirChecker()
+{
+}
+
+DirChecker::~DirChecker()
+{
+}
+
+bool DirChecker::checkDir(const QDir &dir)
+{
+    return dir.exists();
+}
+#endif
+
+inline QStringList mobilityPlugins(const QString plugintype)
+{
+#if !defined QT_NO_DEBUG
+    const bool showDebug = qgetenv("QT_DEBUG_PLUGINS").toInt() > 0;
+#endif
+
+    QStringList paths = QApplication::libraryPaths();
+#ifdef QTM_PLUGIN_PATH
+    paths << QLatin1String(QTM_PLUGIN_PATH);
+#endif
+#if !defined QT_NO_DEBUG
+    if (showDebug)
+        qDebug() << "Plugin paths:" << paths;
+#endif
+
+    DirChecker dirChecker;
+
+    //temp variable to avoid multiple identic path
+    QSet<QString> processed;
+
+    /* Discover a bunch o plugins */
+    QStringList plugins;
+
+    /* Enumerate our plugin paths */
+    for (int i=0; i < paths.count(); i++) {
+        if (processed.contains(paths.at(i)))
+            continue;
+        processed.insert(paths.at(i));
+        QDir pluginsDir(paths.at(i));
+        if (!dirChecker.checkDir(pluginsDir))
+            continue;
+
+#if defined(Q_OS_WIN)
+        if (pluginsDir.dirName().toLower() == QLatin1String("debug") || pluginsDir.dirName().toLower() == QLatin1String("release"))
+            pluginsDir.cdUp();
+#elif defined(Q_OS_MAC)
+        if (pluginsDir.dirName() == QLatin1String("MacOS")) {
+            pluginsDir.cdUp();
+            pluginsDir.cdUp();
+            pluginsDir.cdUp();
+        }
+#endif
+
+        QString subdir(QLatin1String("plugins/"));
+        subdir += plugintype;
+        if (pluginsDir.path().endsWith(QLatin1String("/plugins"))
+            || pluginsDir.path().endsWith(QLatin1String("/plugins/")))
+            subdir = plugintype;
+
+        if (dirChecker.checkDir(QDir(pluginsDir.path() + QLatin1Char('/') + subdir))) {
+            pluginsDir.cd(subdir);
+            QStringList files = pluginsDir.entryList(QDir::Files);
+
+#if !defined QT_NO_DEBUG
+            if (showDebug)
+                qDebug() << "Looking for " << plugintype << " plugins in" << pluginsDir.path() << files;
+#endif
+
+            for (int j=0; j < files.count(); j++) {
+                plugins <<  pluginsDir.absoluteFilePath(files.at(j));
+            }
+        }
+    }
+    return  plugins;
+}
+
+QTM_END_NAMESPACE
--- a/qtmobility/src/location/dbuscomm_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/dbuscomm_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,28 +46,28 @@
 
 QTM_BEGIN_NAMESPACE
 
+const QString DBusComm::positioningdService   = QString("com.nokia.positioningd.client");
+const QString DBusComm::positioningdPath      = QString("/com/nokia/positioningd/client");
+const QString DBusComm::positioningdInterface = QString("com.nokia.positioningd.client");
+
 DBusComm::DBusComm()
 {
-    positioningdService   = QString("com.nokia.positioningd.client");
-    positioningdPath      = QString("/com/nokia/positioningd/client");
-    positioningdInterface = QString("com.nokia.positioningd.client");
 }
 
 
 int DBusComm::init()
 {
-
     if (!QDBusConnection::sessionBus().isConnected()) {
-        cerr << "Cannot connect to the D-BUS session bus." << endl;
+        cerr << "Cannot connect to the D-BUS session bus.\n";
         return -1;
     }
 
     // Application auto-start by dbus may take a while, so try
     // connecting a few times.
 
-    int cnt = 3;
+    int cnt = 6; 
     do {
-        cout << "Connecting to positioning daemon" << endl;
+        cout << "Connecting to positioning daemon..." << endl;
         positioningdProxy = new QDBusInterface(positioningdService,
                                                positioningdPath,
                                                positioningdInterface,
@@ -77,64 +77,114 @@
     } while (cnt && (positioningdProxy->isValid() == false));
 
     if (positioningdProxy->isValid() == false) {
-        cerr << "DBus connection to positioning daemon failed." << endl;
+        cerr << "DBus connection to positioning daemon failed.\n";
         return -1;
     }
 
-    createUniqueName();
+    if (createUniqueName() == false) { // set myService, myPath 
+        return -1;
+    }
 
-    dbusServer = new DBusServer(&serverObj);
-    dbusServer->setHandlerObject(this);
-
+    dbusServer = new DBusServer(&serverObj, this);
     QDBusConnection::sessionBus().registerObject(myPath, &serverObj);
-
     if (!QDBusConnection::sessionBus().registerService(myService)) {
         cerr << qPrintable(QDBusConnection::sessionBus().lastError().message()) << endl;
         return -1;
     }
 
-    return 0;
-}
-
-
-int DBusComm::receiveDBusMessage(const QByteArray &message)
-{
-    emit receivedMessage(message);
+    sendDBusRegister();
 
     return 0;
 }
 
 
-int DBusComm::receivePositionUpdate(const QGeoPositionInfo &update)
+void DBusComm::receivePositionUpdate(const QGeoPositionInfo &update)
 {
     emit receivedPositionUpdate(update);
+}
 
-    return 0;
+
+void DBusComm::receiveSatellitesInView(const QList<QGeoSatelliteInfo> &info)
+{
+    emit receivedSatellitesInView(info);
 }
 
 
-int DBusComm::receiveSettings(const QGeoPositionInfoSource::PositioningMethod methods,
+void DBusComm::receiveSatellitesInUse(const QList<QGeoSatelliteInfo> &info)
+{
+    emit receivedSatellitesInUse(info);
+}
+
+
+void DBusComm::receiveSettings(const QGeoPositionInfoSource::PositioningMethod methods,
                               const int interval)
 {
+    Q_UNUSED(methods)
     cout << "Interval confirmed to be :" << interval << "\n";
     // FIXME save these
 
-    return 0;
+    return;
 }
 
 
 bool DBusComm::sendDBusRegister()
 {
-    int n;
+#if 1
     QDBusReply<int> reply;
-
     reply = positioningdProxy->call("registerListener",
                                     myService.toAscii().constData(),
                                     myPath.toAscii().constData());
     if (reply.isValid()) {
-        n = reply.value();
-        clientId = n;
-        cout << "Register client ID: " << n << endl;
+        clientId = reply.value();
+        cout << "Register client ID: " << clientId << endl;
+    } else {
+        cerr << endl << "DBus error:\n";
+        cerr << reply.error().name().toAscii().constData() << endl;
+        cerr << reply.error().message().toAscii().constData() << endl;
+        return false;
+    }
+#else
+    QList<QVariant> args;
+    QDBusMessage message = QDBusMessage::createMethodCall(positioningdService, positioningdPath,
+                                                          positioningdInterface, "registerListener");
+    args << myService.toAscii().constData() << myPath.toAscii().constData();
+    message.setArguments(args);
+    QDBusPendingCall pending = QDBusConnection::systemBus().asyncCall(message, 10000);
+    QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending, this);
+    QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
+                     this, SLOT(registerDone(QDBusPendingCallWatcher*)));
+    
+    cout << "DBusComm::sendDBusRegister() Register client\n";
+#endif
+    return true;
+}
+
+
+void DBusComm::registerDone(QDBusPendingCallWatcher *call)
+{
+    QDBusPendingReply<int> reply = *call;
+    if (reply.isValid()) {
+        clientId = reply.value();
+        cout << "Register client ID: " << clientId << endl;
+    } 
+    else {
+        std::cerr << "DBusComm::register Dbus Error:" << qPrintable(reply.error().message()) << "\n";
+    }
+}
+
+
+bool DBusComm::sendConfigRequest(Command command, QGeoPositionInfoSource::PositioningMethods method,
+                                 int interval) const
+{
+    QDBusReply<int> reply; 
+    reply = positioningdProxy->call("configSession", clientId, command, int(method), interval);
+    
+    //cout << "sessionConfigRequest cmd: cmd:" << command << " method: ";
+    //cout << method << " interval: " << interval << "\n";
+    
+    if (reply.isValid()) {
+        int n = reply.value();
+        cout << "sessionConfigRequest:Reply: " << n << endl;
     } else {
         cerr << endl << "DBus error:\n";
         cerr << reply.error().name().toAscii().constData() << endl;
@@ -146,34 +196,34 @@
 }
 
 
-int DBusComm::sessionConfigRequest(const int command, const int method,
-                                   const int interval) const
+QGeoPositionInfo& DBusComm::requestLastKnownPosition(bool satelliteMethodOnly)
 {
-    int n;
-    QDBusReply<bool> reply;
+    QDBusReply<QByteArray> reply; 
+    reply = positioningdProxy->call("latestPosition", satelliteMethodOnly);
+    static QGeoPositionInfo update;
 
-    positioningdProxy->call("configSession", clientId, command, method, interval);
-    cout << "sessionConfigRequest cmd: cmd:" << command << " method: ";
-    cout << method << " interval: " << interval << "\n";
     if (reply.isValid()) {
-        n = reply.value();
-        cout << "sessionConfigRequest:Reply: " << n << endl;
+        cout << "requestLastKnownPosition(): received update\n";
+        QByteArray message = reply.value();
+        QDataStream stream(message);
+        stream >> update;
     } else {
         cerr << endl << "DBus error:\n";
         cerr << reply.error().name().toAscii().constData() << endl;
         cerr << reply.error().message().toAscii().constData() << endl;
+        update = QGeoPositionInfo();
     }
 
-    return 0;
-}
+    return update;
+} 
 
 
-void DBusComm::createUniqueName()
+bool DBusComm::createUniqueName()
 {
     QFile uuidfile("/proc/sys/kernel/random/uuid");
     if (!uuidfile.open(QIODevice::ReadOnly)) {
         cerr << "UUID file failed.";
-        exit(0);
+        return false;
     }
 
     QTextStream in(&uuidfile);
@@ -181,8 +231,8 @@
     uuid.replace('-', 'I');
     myService   = "com.nokia.qlocation." + uuid;
     myPath      = "/com/nokia/qlocation/" + uuid;
-    myInterface = "com.nokia.qlocation.updates";
 
+    return true;
 }
 
 #include "moc_dbuscomm_maemo_p.cpp"
--- a/qtmobility/src/location/dbuscomm_maemo_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/dbuscomm_maemo_p.h	Thu May 27 13:42:11 2010 +0300
@@ -47,46 +47,61 @@
 #include <QtDBus/QtDBus>
 
 #include "qgeopositioninfo.h"
+#include "qgeosatelliteinfo.h"
 #include "qgeopositioninfosource.h"
+#include "qgeosatelliteinfosource.h"
 #include "dbusserver_maemo_p.h"
 
 QTM_BEGIN_NAMESPACE
 
-class DBusServer;
-class DBusComm: public QObject
+class DBusComm: public QObject, DBusServerIF
 {
     Q_OBJECT
 
-private:
-    QDBusInterface *positioningdProxy;
-    DBusServer* dbusServer;
-    QObject serverObj;
-
-    QString positioningdService;
-    QString positioningdPath;
-    QString positioningdInterface;
-    QString myService;
-    QString myPath;
-    QString myInterface;
-    int     clientId;
-
-    void createUniqueName();
 
 public:
-    enum cmds {CmdStart = 1, CmdStop = 2, CmdOneShot = 3, CmdSetMethods = 4, CmdSetInterval = 8};
+    enum Command {CommandStart = 1,      CommandStop = 2,     CommandOneShot = 3, 
+                  CommandSetMethods = 4, CommandSetInterval = 8, 
+                  CommandSatStart = 16,  CommandSatStop = 32, CommandSatOneShot = 48};
 
     DBusComm();
     int  init();
     bool sendDBusRegister();
-    int  sessionConfigRequest(const int command, const int method,
-                              const int interval) const;
-    int receiveDBusMessage(const QByteArray &message); // called by D-Bus server
-    int receivePositionUpdate(const QGeoPositionInfo &update); // called by D-Bus server
-    int receiveSettings(const QGeoPositionInfoSource::PositioningMethod methods,
-                        const int interval);
-signals:
-    void receivedMessage(const QByteArray &msg);
+    bool sendConfigRequest(Command command, QGeoPositionInfoSource::PositioningMethods method, 
+                           int interval) const;
+    QGeoPositionInfo& requestLastKnownPosition(bool satelliteMethodOnly);
+
+
+Q_SIGNALS:
     void receivedPositionUpdate(const QGeoPositionInfo &update);
+    void receivedSatellitesInView(const QList<QGeoSatelliteInfo> &update);
+    void receivedSatellitesInUse(const QList<QGeoSatelliteInfo> &update);
+
+private Q_SLOTS:
+    void registerDone(QDBusPendingCallWatcher *call);
+
+private:
+    static const QString positioningdService;
+    static const QString positioningdPath;
+    static const QString positioningdInterface;
+
+    // from DBusServerIF
+    void receivePositionUpdate(const QGeoPositionInfo &update);
+    void receiveSatellitesInView(const QList<QGeoSatelliteInfo> &info);
+    void receiveSatellitesInUse(const QList<QGeoSatelliteInfo> &info);
+    void receiveSettings(const QGeoPositionInfoSource::PositioningMethod methods, 
+                         const int interval);
+
+    QDBusInterface *positioningdProxy;
+    DBusServer* dbusServer;
+    QObject serverObj;
+    QString myService;
+    QString myPath;
+    int  clientId;
+
+    bool createUniqueName();
+
+    Q_DISABLE_COPY(DBusComm)
 };
 
 QTM_END_NAMESPACE
--- a/qtmobility/src/location/dbusserver_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/dbusserver_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -43,15 +43,9 @@
 
 QTM_BEGIN_NAMESPACE
 
-void DBusServer::setHandlerObject(DBusComm* p)
+DBusServer::DBusServer(QObject *obj, DBusServerIF *iface) : QDBusAbstractAdaptor(obj), 
+                                                            interface(iface) 
 {
-    handler = p;
-}
-
-
-DBusServer::DBusServer(QObject *obj) : QDBusAbstractAdaptor(obj)
-{
-    handler = 0;
 }
 
 
@@ -61,23 +55,34 @@
     QDataStream stream(message);
     stream >> update;
 
-    if (handler != 0) {
-        handler->receivePositionUpdate(update);
-    }
-
-    return;
+    interface->receivePositionUpdate(update);
 }
 
 
 Q_NOREPLY void DBusServer::currentSettings(const QGeoPositionInfoSource::PositioningMethod methods,
-        const int interval)
+                                           int interval)
+{
+    interface->receiveSettings(methods, interval);
+}
+
+
+Q_NOREPLY void DBusServer::satellitesInViewUpdate(const QByteArray &message)
 {
-    if (handler != 0) {
-        handler->receiveSettings(methods, interval);
-    }
+    static QList<QGeoSatelliteInfo> update;
+    QDataStream stream(message);
+    stream >> update;
+
+    interface->receiveSatellitesInView(update);
+}
+
 
-    return;
+Q_NOREPLY void DBusServer::satellitesInUseUpdate(const QByteArray &message)
+{
+    static QList<QGeoSatelliteInfo> update;
+    QDataStream stream(message);
+    stream >> update;
 
+    interface->receiveSatellitesInUse(update);
 }
 
 #include "moc_dbusserver_maemo_p.cpp"
--- a/qtmobility/src/location/dbusserver_maemo_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/dbusserver_maemo_p.h	Thu May 27 13:42:11 2010 +0300
@@ -43,30 +43,39 @@
 #define DBUSSERVER_MAEMO_H
 
 #include <QtDBus/QDBusAbstractAdaptor>
-#include "dbuscomm_maemo_p.h"
-
 #include "qgeopositioninfo.h"
 #include "qgeopositioninfosource.h"
+#include "qgeosatelliteinfo.h"
 
 QTM_BEGIN_NAMESPACE
 
-class DBusComm;
+class DBusServerIF {
+public:
+    virtual void receivePositionUpdate(const QGeoPositionInfo &update) = 0;
+    virtual void receiveSettings(const QGeoPositionInfoSource::PositioningMethod methods, int interval) = 0;
+    virtual void receiveSatellitesInView(const QList<QGeoSatelliteInfo> &update) = 0;
+    virtual void receiveSatellitesInUse(const QList<QGeoSatelliteInfo> &update) = 0;
+};
+
+
 class DBusServer: public QDBusAbstractAdaptor
 {
     Q_OBJECT
     Q_CLASSINFO("D-Bus Interface", "com.nokia.qlocation.updates")
 
 public:
-    DBusServer(QObject *obj);
-    void setHandlerObject(DBusComm* p);
+    DBusServer(QObject *obj, DBusServerIF *interface);
+
+public Q_SLOTS:
+    Q_NOREPLY void positionUpdate(const QByteArray &update);
+    Q_NOREPLY void satellitesInViewUpdate(const QByteArray &update);
+    Q_NOREPLY void satellitesInUseUpdate(const QByteArray &update);
+    Q_NOREPLY void currentSettings(const QGeoPositionInfoSource::PositioningMethod methods,
+                                   int interval);
 
 private:
-    DBusComm* handler;
-
-public slots:
-    Q_NOREPLY void positionUpdate(const QByteArray &update);
-    Q_NOREPLY void currentSettings(const QGeoPositionInfoSource::PositioningMethod methods,
-                                   const int interval);
+    Q_DISABLE_COPY(DBusServer)
+    DBusServerIF *interface;
 };
 
 QTM_END_NAMESPACE
--- a/qtmobility/src/location/gconfitem.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/gconfitem.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,7 +45,7 @@
 #include <QVariant>
 #include <QtDebug>
 
-#include "gconfitem.h"
+#include "gconfitem_p.h"
 
 #include <glib.h>
 #include <gconf/gconf-value.h>
--- a/qtmobility/src/location/gconfitem.h	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GCONFITEM_H
-#define GCONFITEM_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-
-/*!
-
-  \brief GConfItem is a simple C++ wrapper for GConf.
-
-  Creating a GConfItem instance gives you access to a single GConf
-  key.  You can get and set its value, and connect to its
-  valueChanged() signal to be notified about changes.
-
-  The value of a GConf key is returned to you as a QVariant, and you
-  pass in a QVariant when setting the value.  GConfItem converts
-  between a QVariant and GConf values as needed, and according to the
-  following rules:
-
-  - A QVariant of type QVariant::Invalid denotes an unset GConf key.
-
-  - QVariant::Int, QVariant::Double, QVariant::Bool are converted to
-    and from the obvious equivalents.
-
-  - QVariant::String is converted to/from a GConf string and always
-    uses the UTF-8 encoding.  No other encoding is supported.
-
-  - QVariant::StringList is converted to a list of UTF-8 strings.
-
-  - QVariant::List (which denotes a QList<QVariant>) is converted
-    to/from a GConf list.  All elements of such a list must have the
-    same type, and that type must be one of QVariant::Int,
-    QVariant::Double, QVariant::Bool, or QVariant::String.  (A list of
-    strings is returned as a QVariant::StringList, however, when you
-    get it back.)
-
-  - Any other QVariant or GConf value is essentially ignored.
-
-  \warning GConfItem is as thread-safe as GConf.
-
-*/
-
-class GConfItem : public QObject
-{
-    Q_OBJECT
-
- public:
-    /*! Initializes a GConfItem to access the GConf key denoted by
-        \a key.  Key names should follow the normal GConf conventions
-        like "/myapp/settings/first".
-
-        \param key    The name of the key.
-        \param parent Parent object
-    */
-    explicit GConfItem(const QString &key, QObject *parent = 0);
-
-    /*! Finalizes a GConfItem.
-     */
-    virtual ~GConfItem();
-
-    /*! Returns the key of this item, as given to the constructor.
-     */
-    QString key() const;
-
-    /*! Returns the current value of this item, as a QVariant.
-     */
-    QVariant value() const;
-
-    /*! Returns the current value of this item, as a QVariant.  If
-     *  there is no value for this item, return \a def instead.
-     */
-    QVariant value(const QVariant &def) const;
-
-    /*! Set the value of this item to \a val.  If \a val can not be
-        represented in GConf or GConf refuses to accept it for other
-        reasons, the current value is not changed and nothing happens.
-
-        When the new value is different from the old value, the
-        changedValue() signal is emitted on this GConfItem as part
-        of calling set(), but other GConfItem:s for the same key do
-        only receive a notification once the main loop runs.
-
-        \param val  The new value.
-    */
-    void set(const QVariant &val);
-
-    /*! Unset this item.  This is equivalent to
-
-        \code
-        item.set(QVariant(QVariant::Invalid));
-        \endcode
-     */
-    void unset();
-
-    /*! Return a list of the directories below this item.  The
-        returned strings are absolute key names like
-        "/myapp/settings".
-
-        A directory is a key that has children.  The same key might
-        also have a value, but that is confusing and best avoided.
-    */
-    QList<QString> listDirs() const;
-
-    /*! Return a list of entries below this item.  The returned
-        strings are absolute key names like "/myapp/settings/first".
-
-        A entry is a key that has a value.  The same key might also
-        have children, but that is confusing and is best avoided.
-    */
-    QList<QString> listEntries() const;
-
- signals:
-    /*! Emitted when the value of this item has changed.
-     */
-    void valueChanged();
-
- private:
-    friend struct GConfItemPrivate;
-    struct GConfItemPrivate *priv;
-
-    void update_value(bool emit_signal);
-};
-
-#endif // GCONFITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/src/location/gconfitem_p.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,166 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GCONFITEM_H
+#define GCONFITEM_H
+
+#include <QVariant>
+#include <QStringList>
+#include <QObject>
+
+/*!
+
+  \brief GConfItem is a simple C++ wrapper for GConf.
+
+  Creating a GConfItem instance gives you access to a single GConf
+  key.  You can get and set its value, and connect to its
+  valueChanged() signal to be notified about changes.
+
+  The value of a GConf key is returned to you as a QVariant, and you
+  pass in a QVariant when setting the value.  GConfItem converts
+  between a QVariant and GConf values as needed, and according to the
+  following rules:
+
+  - A QVariant of type QVariant::Invalid denotes an unset GConf key.
+
+  - QVariant::Int, QVariant::Double, QVariant::Bool are converted to
+    and from the obvious equivalents.
+
+  - QVariant::String is converted to/from a GConf string and always
+    uses the UTF-8 encoding.  No other encoding is supported.
+
+  - QVariant::StringList is converted to a list of UTF-8 strings.
+
+  - QVariant::List (which denotes a QList<QVariant>) is converted
+    to/from a GConf list.  All elements of such a list must have the
+    same type, and that type must be one of QVariant::Int,
+    QVariant::Double, QVariant::Bool, or QVariant::String.  (A list of
+    strings is returned as a QVariant::StringList, however, when you
+    get it back.)
+
+  - Any other QVariant or GConf value is essentially ignored.
+
+  \warning GConfItem is as thread-safe as GConf.
+
+*/
+
+class GConfItem : public QObject
+{
+    Q_OBJECT
+
+ public:
+    /*! Initializes a GConfItem to access the GConf key denoted by
+        \a key.  Key names should follow the normal GConf conventions
+        like "/myapp/settings/first".
+
+        \param key    The name of the key.
+        \param parent Parent object
+    */
+    explicit GConfItem(const QString &key, QObject *parent = 0);
+
+    /*! Finalizes a GConfItem.
+     */
+    virtual ~GConfItem();
+
+    /*! Returns the key of this item, as given to the constructor.
+     */
+    QString key() const;
+
+    /*! Returns the current value of this item, as a QVariant.
+     */
+    QVariant value() const;
+
+    /*! Returns the current value of this item, as a QVariant.  If
+     *  there is no value for this item, return \a def instead.
+     */
+    QVariant value(const QVariant &def) const;
+
+    /*! Set the value of this item to \a val.  If \a val can not be
+        represented in GConf or GConf refuses to accept it for other
+        reasons, the current value is not changed and nothing happens.
+
+        When the new value is different from the old value, the
+        changedValue() signal is emitted on this GConfItem as part
+        of calling set(), but other GConfItem:s for the same key do
+        only receive a notification once the main loop runs.
+
+        \param val  The new value.
+    */
+    void set(const QVariant &val);
+
+    /*! Unset this item.  This is equivalent to
+
+        \code
+        item.set(QVariant(QVariant::Invalid));
+        \endcode
+     */
+    void unset();
+
+    /*! Return a list of the directories below this item.  The
+        returned strings are absolute key names like
+        "/myapp/settings".
+
+        A directory is a key that has children.  The same key might
+        also have a value, but that is confusing and best avoided.
+    */
+    QList<QString> listDirs() const;
+
+    /*! Return a list of entries below this item.  The returned
+        strings are absolute key names like "/myapp/settings/first".
+
+        A entry is a key that has a value.  The same key might also
+        have children, but that is confusing and is best avoided.
+    */
+    QList<QString> listEntries() const;
+
+ signals:
+    /*! Emitted when the value of this item has changed.
+     */
+    void valueChanged();
+
+ private:
+    friend struct GConfItemPrivate;
+    struct GConfItemPrivate *priv;
+
+    void update_value(bool emit_signal);
+};
+
+#endif // GCONFITEM_H
--- a/qtmobility/src/location/liblocationwrapper_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/liblocationwrapper_p.h	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,7 @@
 #include "qgeopositioninfo.h"
 #include "qgeosatelliteinfo.h"
 
-#include "gconfitem.h"
+#include "gconfitem_p.h"
 
 extern "C" {
    #include <glib.h>
--- a/qtmobility/src/location/location.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/location.pro	Thu May 27 13:42:11 2010 +0300
@@ -80,7 +80,7 @@
                qgeopositioninfosource_maemo5.cpp \
                qgeosatelliteinfosource_maemo5.cpp \
                qgeoareamonitor_maemo.cpp
-    HEADERS += gconfitem.h  \
+    HEADERS += gconfitem_p.h  \
                liblocationwrapper_p.h \
                qgeopositioninfosource_maemo5_p.h \
                qgeosatelliteinfosource_maemo5_p.h \
@@ -107,9 +107,9 @@
     TARGET.CAPABILITY = ALL -TCB
     TARGET.UID3 = 0x2002AC83
 
-    INCLUDEPATH += $${EPOCROOT}epoc32\include\osextensions \
-                   $${EPOCROOT}epoc32\include\LBTHeaders \
-                   $${EPOCROOT}epoc32\include\platform
+#    INCLUDEPATH += $${EPOCROOT}epoc32\include\osextensions \
+#                   $${EPOCROOT}epoc32\include\LBTHeaders \
+#                   $${EPOCROOT}epoc32\include\platform
     LIBS += -llbs
     contains(lbt_enabled, yes) {
         LIBS += -llbt
--- a/qtmobility/src/location/qgeopositioninfosource_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/qgeopositioninfosource_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -41,17 +41,7 @@
 
 #include "qgeopositioninfosource_maemo_p.h"
 #include <iostream>
-
-#if 0
-void dumpQByteArray(const QByteArray &msg)
-{
-    std::cout << "QByteArray dump:\n";
-    std::cout << msg.size() << "  \n";
-    int i =  msg.size();
-    for (int k = 0; k < i ;k++)
-        printf("msg[%d]=%2.2x\n", k, (unsigned char)msg[k]);
-}
-#endif
+#include <QDateTime>
 
 using namespace std;
 
@@ -59,59 +49,35 @@
 
 QGeoPositionInfoSourceMaemo::QGeoPositionInfoSourceMaemo(QObject *parent): QGeoPositionInfoSource(parent)
 {
-    // default values
-    time_interval_ = 5000;
-    distance_interval_ = 10;
-    registered_ = false;
-    validLastUpdate = false;
-    validLastSatUpdate = false;
+    time_interval_ = DefaultUpdateInterval;
     availableMethods = AllPositioningMethods;
 }
 
+
 int QGeoPositionInfoSourceMaemo::init()
 {
     int status;
-
     dbusComm = new DBusComm();
-    status = dbusComm->init();
-
-    QObject::connect(dbusComm, SIGNAL(receivedMessage(const QByteArray &)),
-                     this, SLOT(dbusMessages(const QByteArray &)));
-
-    QObject::connect(dbusComm, SIGNAL(receivedPositionUpdate(const QGeoPositionInfo &)),
-                     this, SLOT(newPositionUpdate(const QGeoPositionInfo &)));
-
+    if ((status = dbusComm->init()) == 0) {
+        QObject::connect(dbusComm, SIGNAL(receivedPositionUpdate(const QGeoPositionInfo &)),
+                         this, SLOT(newPositionUpdate(const QGeoPositionInfo &)));
+    }
     return status;
 }
 
 
-void QGeoPositionInfoSourceMaemo::dbusMessages(const QByteArray &msg)
-{
-    Q_UNUSED(msg)
-    // stub
-
-    return;
-}
-
-
 void QGeoPositionInfoSourceMaemo::newPositionUpdate(const QGeoPositionInfo &update)
 {
-    lastSatUpdate = update;
-    validLastSatUpdate = true;
     emit positionUpdated(update);
 }
 
 
 QGeoPositionInfo QGeoPositionInfoSourceMaemo::lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const
 {
-    if (validLastSatUpdate)
-        return lastSatUpdate;
+    static QGeoPositionInfo lastUpdate;
+    lastUpdate = dbusComm->requestLastKnownPosition(fromSatellitePositioningMethodsOnly); 
 
-    if (!fromSatellitePositioningMethodsOnly)
-        if (validLastUpdate)
-            return lastUpdate;
-
-    return QGeoPositionInfo();
+    return lastUpdate;
 }
 
 
@@ -124,19 +90,16 @@
 void QGeoPositionInfoSourceMaemo::setUpdateInterval(int msec)
 {
     msec = (msec < MinimumUpdateInterval) ? MinimumUpdateInterval : msec;
+    QGeoPositionInfoSource::setUpdateInterval(msec);
 
-    QGeoPositionInfoSource::setUpdateInterval(msec);
-    if (registered_ == false)
-        registered_ = dbusComm->sendDBusRegister();
-    dbusComm->sessionConfigRequest(dbusComm->CmdSetInterval, 0, msec);
+    dbusComm->sendConfigRequest(dbusComm->CommandSetInterval, 0, msec);
 }
 
+
 void QGeoPositionInfoSourceMaemo::setPreferredPositioningMethods(PositioningMethods sources)
 {
     QGeoPositionInfoSource::setPreferredPositioningMethods(sources);
-    if (registered_ == false)
-        registered_ = dbusComm->sendDBusRegister();
-    dbusComm->sessionConfigRequest(dbusComm->CmdSetMethods, sources, 0);
+    dbusComm->sendConfigRequest(dbusComm->CommandSetMethods, sources, 0);
 }
 
 
@@ -146,29 +109,21 @@
 }
 
 
-// public slots:
-
 void QGeoPositionInfoSourceMaemo::startUpdates()
 {
-    if (registered_ == false)
-        registered_ = dbusComm->sendDBusRegister();
-
-    int cmd = dbusComm->CmdStart;
-    dbusComm->sessionConfigRequest(cmd, 222, time_interval_);
+    dbusComm->sendConfigRequest(DBusComm::CommandStart, 0, time_interval_);
 }
 
 
 void QGeoPositionInfoSourceMaemo::stopUpdates()
 {
-    if (registered_ == false) return; // nothing to stop
-    dbusComm->sessionConfigRequest(dbusComm->CmdStop, 0, 0);
+    dbusComm->sendConfigRequest(dbusComm->CommandStop, 0, 0);
 }
 
-// Stub
 
 void QGeoPositionInfoSourceMaemo::requestUpdate(int timeout)
 {
-    if (timeout) {}
+    dbusComm->sendConfigRequest(dbusComm->CommandOneShot, 0, timeout);
 }
 
 #include "moc_qgeopositioninfosource_maemo_p.cpp"
--- a/qtmobility/src/location/qgeopositioninfosource_maemo_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/qgeopositioninfosource_maemo_p.h	Thu May 27 13:42:11 2010 +0300
@@ -45,12 +45,25 @@
 #include "qgeopositioninfosource.h"
 #include "dbuscomm_maemo_p.h"
 
+#ifdef Q_WS_MAEMO_5
+#include "qgeocoordinate.h"
+
+extern "C" {
+   #include <glib.h>
+   #include <location/location-gpsd-control.h>
+   #include <location/location-gps-device.h>
+   #include <location/location-misc.h>
+   #include <location/location-distance-utils.h>
+}
+#endif
+
 QTM_BEGIN_NAMESPACE
 
 class DBusComm;
 class QGeoPositionInfoSourceMaemo : public QGeoPositionInfoSource
 {
     Q_OBJECT
+
 public:
 
     QGeoPositionInfoSourceMaemo(QObject *parent = 0);
@@ -58,29 +71,25 @@
 
     virtual void setUpdateInterval(int interval);
     virtual void setPreferredPositioningMethods(PositioningMethods sources);
-    //virtual QPositioninfo QGeoPositionInfoSource::lastUpdate(QFlags<QGeoPositionInfoSource::PositionSourceType>) const;
     virtual QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
     virtual PositioningMethods supportedPositioningMethods() const;
     virtual int minimumUpdateInterval() const;
 
-private:
-    void dumpNMEA(const char *msg);
-    DBusComm* dbusComm;
-    QGeoPositionInfo lastUpdate;
-    QGeoPositionInfo lastSatUpdate;
-    bool validLastUpdate;
-    bool validLastSatUpdate;
-    static const int MinimumUpdateInterval = 1000;
-    int time_interval_;
-    int distance_interval_;
-    bool registered_;
-    PositioningMethods availableMethods;
-
-public slots:
+public Q_SLOTS:
     void startUpdates();
     void stopUpdates();
     void requestUpdate(int timeout = 5000);
-    void dbusMessages(const QByteArray &msg);
+
+private:
+    static const int MinimumUpdateInterval = 1000;
+    static const int DefaultUpdateInterval = 5000;
+
+    DBusComm* dbusComm;
+
+    int time_interval_;
+    PositioningMethods availableMethods;
+
+private Q_SLOTS:
     void newPositionUpdate(const QGeoPositionInfo &update);
 };
 
--- a/qtmobility/src/location/qgeosatelliteinfosource_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/qgeosatelliteinfosource_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,81 +45,63 @@
 
 QGeoSatelliteInfoSourceMaemo::QGeoSatelliteInfoSourceMaemo(QObject *parent) : QGeoSatelliteInfoSource(parent)
 {
-    client_id_ = -1;
+    registered = false;
 }
 
+
 int QGeoSatelliteInfoSourceMaemo::init()
 {
-    int status;
+    dbusComm = new DBusComm();
+    int status = dbusComm->init();
 
-    dbusComm = new DBusComm();
-    status = dbusComm->init();
-
-    QObject::connect(dbusComm, SIGNAL(npeMessage(const QByteArray &)),
-                     this, SLOT(npeMessages(const QByteArray &)));
+    if (status == 0) {
+        QObject::connect(dbusComm, SIGNAL(receivedSatellitesInView(const QList<QGeoSatelliteInfo> &)),
+                         this, SLOT(newSatellitesInView(const QList<QGeoSatelliteInfo> &)));
+        QObject::connect(dbusComm, SIGNAL(receivedSatellitesInUse(const QList<QGeoSatelliteInfo> &)),
+                         this, SLOT(newSatellitesInUse(const QList<QGeoSatelliteInfo> &)));
+    }
 
     return status;
 }
 
-// This method receives messages from DBus.
-
-void QGeoSatelliteInfoSourceMaemo::dbusMessages(const QByteArray &msg)
-{
-    Q_UNUSED(msg)
-
-    return;
-}
-
 
 void QGeoSatelliteInfoSourceMaemo::startUpdates()
 {
-#if 0
-    int len = npe.NewStartTrackingMsg(&msg, client_id_, NpeIf::MethodAll,
-                                      NpeIf::OptionNone , 1);
-
-    // cout << "ISI Message len " << len << "\n";
-    dbusComm->sendIsiMessage(msg, len);
-    delete [] msg;
-#endif
-
-#if 0 // Test !
-    QList<QGeoSatelliteInfo> list;
-    QGeoSatelliteInfo tmp;
+    if (registered == false)
+        registered = dbusComm->sendDBusRegister();
 
-    tmp.setPrnNumber(33);
-    tmp.setSignalStrength(15);
-    tmp.setProperty(QGeoSatelliteInfo::Azimuth, 45.0);
-    tmp.setProperty(QGeoSatelliteInfo::Elevation, 25.5);
-    list.append(tmp);
-    list.append(tmp);
-    list.append(tmp);
-
-    emit satellitesInViewUpdated(list);
-    emit satellitesInUseUpdated(list);
-#endif
-
-
+    dbusComm->sendConfigRequest(DBusComm::CommandSatStart, 0, 0);
 }
 
 
 void QGeoSatelliteInfoSourceMaemo::stopUpdates()
 {
-
+    if (registered == false)
+        registered = dbusComm->sendDBusRegister();
 
+    dbusComm->sendConfigRequest(DBusComm::CommandSatStop, 0, 0);
 }
 
+
 void QGeoSatelliteInfoSourceMaemo::requestUpdate(int timeout)
 {
-    int a;
-    a = timeout + 1;
+    if (registered == false)
+        registered = dbusComm->sendDBusRegister();
 
+    dbusComm->sendConfigRequest(DBusComm::CommandSatOneShot, 0, timeout);
 }
 
-#if 0
-void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites);
-void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites);
-void requestTimeout();
-#endif
+
+void QGeoSatelliteInfoSourceMaemo::newSatellitesInView(const QList<QGeoSatelliteInfo> &update)
+{
+    emit satellitesInViewUpdated(update);
+}
+
+
+void QGeoSatelliteInfoSourceMaemo::newSatellitesInUse(const QList<QGeoSatelliteInfo> &update)
+{
+    emit satellitesInUseUpdated(update);
+}
 
 #include "moc_qgeosatelliteinfosource_maemo_p.cpp"
 QTM_END_NAMESPACE
--- a/qtmobility/src/location/qgeosatelliteinfosource_maemo_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/location/qgeosatelliteinfosource_maemo_p.h	Thu May 27 13:42:11 2010 +0300
@@ -57,16 +57,18 @@
 
 private:
     DBusComm* dbusComm;
-    int client_id_;
-    void dbusMessages(const QByteArray &msg);
+    bool registered;
 
-public slots:
-    virtual void startUpdates();
+private Q_SLOTS:
+    void newSatellitesInView(const QList<QGeoSatelliteInfo> &update);
+    void newSatellitesInUse(const QList<QGeoSatelliteInfo> &update);
+    
+public Q_SLOTS:
+    void startUpdates();
     void stopUpdates();
-
     void requestUpdate(int timeout = 5000);
 
-signals:
+Q_SIGNALS:
     void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites);
     void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites);
     void requestTimeout();
--- a/qtmobility/src/messaging/eventloggerengine_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/eventloggerengine_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include "eventloggerengine_maemo_p.h"
 #include "telepathyengine_maemo_p.h"
 #include <QDebug>
@@ -14,17 +55,20 @@
 }
 
 
-EventLoggerEngine::EventLoggerEngine(QObject *parent)
+EventLoggerEngine::EventLoggerEngine(QObject *parent):QObject(parent)
 {
-  Q_UNUSED(parent);
   //    qDebug() << "EventLoggerEngine::EventLoggerEngine";
     DBusError err=DBUS_ERROR_INIT;
+    active = false;
     g_type_init();
     dbus = dbus_bus_get(DBUS_BUS_SESSION, &err); // Create dummy Dbus object and
     dbus_connection_setup_with_g_main (dbus, NULL); //add it to g_mainloop because eventlogger library expects that someone alse has added session bus to g_mainloop
     el=rtcom_el_new ();
     if(!RTCOM_IS_EL(el)) qDebug() << "EventLoggerEngine::EventLoggerEngine():Could't create RTComEl\n";
 
+    queryThread=0;
+    //    queryThread.run();
+    //    connect(queryThread, SIGNAL(messagesFound(const QMessageIdList &)),this, SLOT(messagesFound_(const QMessageIdList &)));
 
 
     g_signal_connect(G_OBJECT(el), "new-event", G_CALLBACK(new_event_cb),(void*)this);
@@ -34,6 +78,7 @@
                                     const char *local_uid,const char *remote_uid,const char *remote_ebook_uid,
                                     const char *group_uid,const char *service,EventLoggerEngine *p)
 {
+  Q_UNUSED(el);
   p->newEvent(event_id, local_uid,remote_uid ,remote_ebook_uid,group_uid,service);
 };
 
@@ -254,6 +299,56 @@
 }
 #endif
 
+bool EventLoggerEngine::filterMessages(const QMessageFilter &filter,
+                                                    const QMessageSortOrder& sortOrder,
+                                                    QString body,
+                                                    QMessageDataComparator::MatchFlags matchFlags)
+{
+
+  //  qDebug() << "EventLoggerEngine::filterMessages";
+  if (active) {
+    qWarning() << "EventLoggerEngine::filterMessages::Service is currently busy";
+    return false;
+  }
+
+
+  active = true;
+  state = QMessageService::ActiveState;
+  emit stateChanged(state);
+
+  if(!queryThread) {
+    queryThread=new QueryThread();
+    connect(queryThread, SIGNAL(completed()), this, SLOT(reportMatchingIds()), Qt::QueuedConnection);
+  };
+  queryThread->setArgs(this, filter, body, matchFlags, sortOrder, 0,0);
+  queryThread->start();
+
+    //  return queryThread.queryMessages(filter,sortOrder,body,matchFlags);
+    return true;
+}
+
+void EventLoggerEngine::messagesFound_(const QMessageIdList &ids)
+{
+  //  qDebug() << "EventLoggerEngine::messagesFound";
+  emit messagesFound(ids,true,false); // filtered but not sorted
+}
+
+
+void EventLoggerEngine::reportMatchingIds()
+{
+  //  qDebug() << "EventLoggerEngine::messagesFound" << m_ids.count();
+  emit messagesFound(m_ids,true,false);
+  completed();
+}
+
+void EventLoggerEngine::completed()
+{
+    active = false;
+    state = QMessageService::FinishedState;
+    emit stateChanged(state);
+}
+
+
 QMessageIdList EventLoggerEngine::filterAndOrderMessages(const QMessageFilter &filter,
                                                     const QMessageSortOrder& sortOrder,
                                                     QString body,
@@ -327,4 +422,32 @@
     return idList;
 }
 
+
+QueryThread::QueryThread(): QThread()
+{
+}
+
+void QueryThread::setArgs(EventLoggerEngine *parent, const QMessageFilter &filter, const QString &body, QMessageDataComparator::MatchFlags matchFlags, const QMessageSortOrder &sortOrder, uint limit, uint offset)
+{
+  _parent=parent;
+  _filter=filter;
+  _body=body;
+  _matchFlags=matchFlags;
+  _sortOrder=sortOrder;
+  _limit=limit;
+  _offset=offset;
+}
+
+void QueryThread::run()
+{
+  //  qDebug() << "QueryThread::run()";
+  _parent->m_ids=EventLoggerEngine::instance()->filterAndOrderMessages(_filter,_sortOrder,_body,_matchFlags);
+  //  qDebug() << "QueryThread::run() done" << _parent->m_ids.count();
+  emit completed();
+}
+
+
+
+#include "moc_eventloggerengine_maemo_p.cpp"
+
 QTM_END_NAMESPACE
--- a/qtmobility/src/messaging/eventloggerengine_maemo_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/eventloggerengine_maemo_p.h	Thu May 27 13:42:11 2010 +0300
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #ifndef EVENTLOGGERENGINE_H
 #define EVENTLOGGERENGINE_H
 #include "qmessageglobal.h"
@@ -16,6 +57,7 @@
 #include "qmessagefilter.h"
 #include "qmessagefilter_p.h"
 #include "qmessagefolderfilter_p.h"
+#include <QThread>
 #include <QObject>
 
 extern "C" {
@@ -29,9 +71,35 @@
 
 QTM_BEGIN_NAMESPACE
 
+class EventLoggerEngine;
 
-class EventLoggerEngine
+class QueryThread : public QThread
 {
+    Q_OBJECT
+
+
+public:
+    QueryThread();
+    void setArgs(EventLoggerEngine *parent, const QMessageFilter &filter, const QString &body, QMessageDataComparator::MatchFlags matchFlags, const QMessageSortOrder &sortOrder, uint limit, uint offset);
+    void run();
+
+ signals:
+    void completed();
+ public:
+    EventLoggerEngine *_parent;
+    QMessageFilter _filter;
+    QString _body;
+    QMessageDataComparator::MatchFlags _matchFlags;
+    QMessageSortOrder _sortOrder;
+    uint _limit;
+    uint _offset;
+
+};
+
+
+class EventLoggerEngine:public QObject
+{
+    Q_OBJECT
     
 public:
 
@@ -52,11 +120,24 @@
     QMessageIdList filterAndOrderMessages(const QMessageFilter &filter, const QMessageSortOrder& sortOrder,
 				      QString body, QMessageDataComparator::MatchFlags matchFlags);
 
+    bool filterMessages(const QMessageFilter &filter, const QMessageSortOrder& sortOrder,
+				      QString body, QMessageDataComparator::MatchFlags matchFlags);
+
+    QMessageIdList m_ids;
+
+
 signals:
-
+    void messagesFound(const QMessageIdList &,bool,bool);
+    void stateChanged(QMessageService::State);
 public slots:
-
+    void reportMatchingIds();
+    void messagesFound_(const QMessageIdList &ids);
+    void completed();
 private:
+    bool active;
+    QMessageService::State state;
+    //    EventLoggerThread queryThread;
+    QueryThread *queryThread;
     QMessageStorePrivate* ipMessageStorePrivate;
     void debugMessage(QMessage &message);
     RTComEl *el;
--- a/qtmobility/src/messaging/messaging.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/messaging.pro	Thu May 27 13:42:11 2010 +0300
@@ -42,7 +42,8 @@
     qmessagefilter_p.h \
     qmessagesortorder_p.h \
     qmessagestore.h \
-    qmessagestore_p.h
+    qmessagestore_p.h \
+    messagingutil_p.h
 SOURCES += qmessageid.cpp \
     qmessagecontentcontainerid.cpp \
     qmessagefolderid.cpp \
@@ -61,7 +62,8 @@
     qmessagemanager.cpp \
     qmessagesortorder.cpp \
     qmessagestore.cpp \
-    qmessageservice.cpp
+    qmessageservice.cpp \
+    messagingutil.cpp
 symbian|win32|maemo6|maemo5|mac { 
     mac|maemo6: SOURCES += qmessageid_stub.cpp \
         qmessagecontentcontainerid_stub.cpp \
@@ -132,7 +134,7 @@
         pkgconfig.files = QtMessaging.pc
         INSTALLS += pkgconfig \
             documentation
-        LIBS += -lgconf-2 -lrtcom-eventlogger -lmodest-dbus-client-1.0 -losso -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -ltpsession -ltelepathy-qt4
+        LIBS += -lgconf-2 -lrtcom-eventlogger -lmodest-dbus-client-1.0 -losso -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -ltpsession -ltelepathy-qt4 -lhildonmime
     }
     symbian { 
         INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/src/messaging/messagingutil.cpp	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,242 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "messagingutil_p.h"
+#include "qmessageid.h"
+#include "qmessageaccountid.h"
+#include "qmessagefolderid.h"
+#include <qmessageglobal.h>
+
+#include <QDebug>
+
+
+
+QTM_BEGIN_NAMESPACE
+
+namespace SymbianHelpers {
+
+    EngineType idType(const QString& id)
+    {
+        if (id.startsWith(mtmPrefix)) {
+            return EngineTypeMTM;
+        } else if (id.startsWith(freestylePrefix)) {
+            return EngineTypeFreestyle;
+        } else {
+            return EngineTypeMTM;
+        }
+    }
+
+    EngineType idType(const QMessageId& id)
+    {
+        if (id.toString().startsWith(mtmPrefix)) {
+            return EngineTypeMTM;
+        } else if (id.toString().startsWith(freestylePrefix)) {
+            return EngineTypeFreestyle;
+        } else {
+            return EngineTypeMTM;
+        }
+    }
+    
+    EngineType idType(const QMessageAccountId& id)
+    {
+        if (id.toString().startsWith(mtmPrefix)) {
+            return EngineTypeMTM;
+        } else if (id.toString().startsWith(freestylePrefix)) {
+            return EngineTypeFreestyle;
+        } else {
+            return EngineTypeMTM;
+        }
+    }
+    
+    EngineType idType(const QMessageFolderId& id)
+    {
+        if (id.toString().startsWith(mtmPrefix)) {
+            return EngineTypeMTM;
+        } else if (id.toString().startsWith(freestylePrefix)) {
+            return EngineTypeFreestyle;
+        } else {
+            return EngineTypeMTM;
+        }
+    }
+
+    
+    QString addIdPrefix(const QString& id, const EngineType& type)
+    {
+        switch (type) {
+        case EngineTypeFreestyle:
+            Q_ASSERT(!id.startsWith(freestylePrefix));
+            return QString(freestylePrefix) + id;
+            break;
+        case EngineTypeMTM:
+            Q_ASSERT(!id.startsWith(mtmPrefix));
+            return QString(mtmPrefix) + id;
+        default:
+            return QString(id);
+            break;
+        }
+    }
+
+    QMessageAccountId addIdPrefix(const QMessageAccountId& id, const EngineType& type)
+    {
+        switch (type) {
+        case EngineTypeFreestyle:
+            Q_ASSERT(!id.toString().startsWith(freestylePrefix));
+            return QMessageAccountId(QString(freestylePrefix) + id.toString());
+            break;
+        case EngineTypeMTM:
+            Q_ASSERT(!id.toString().startsWith(mtmPrefix));
+            return QMessageAccountId(QString(mtmPrefix) + id.toString());
+            break;
+        default:
+            return QMessageAccountId(id);
+            break;
+        }
+    }
+
+    QMessageFolderId addIdPrefix(const QMessageFolderId& id, const EngineType& type)
+    {
+        switch (type) {
+        case EngineTypeFreestyle:
+            Q_ASSERT(!id.toString().startsWith(freestylePrefix));
+            return QMessageFolderId(QString(freestylePrefix) + id.toString());
+            break;
+        case EngineTypeMTM:
+            Q_ASSERT(!id.toString().startsWith(mtmPrefix));
+            return QMessageFolderId(QString(mtmPrefix) + id.toString());
+            break;
+        default:
+            return QMessageFolderId(id);
+            break;
+        }
+    }
+
+    QMessageId addIdPrefix(const QMessageId& id, const EngineType& type)
+    {
+        switch (type) {
+        case EngineTypeFreestyle:
+            Q_ASSERT(!id.toString().startsWith(freestylePrefix));
+            return QMessageId(freestylePrefix + id.toString());
+            break;
+        case EngineTypeMTM:
+            Q_ASSERT(!id.toString().startsWith(mtmPrefix));
+            return QMessageId(mtmPrefix + id.toString());
+            break;
+        default:
+            return QMessageId(id);
+            break;
+        }
+    }
+
+    QString stripIdPrefix(const QString& id)
+    {
+        if (id.startsWith(freestylePrefix))
+            return id.right(id.length() - QString(freestylePrefix).length());
+        else if (id.startsWith(mtmPrefix))
+            return id.right(id.length() - QString(mtmPrefix).length());
+        else
+            return QString(id);
+    }
+
+    QMessageId stripIdPrefix(const QMessageId& id)
+    {
+        if (id.toString().startsWith(freestylePrefix))
+            return QMessageId(id.toString().right(id.toString().length() - QString(freestylePrefix).length()));
+        else if (id.toString().startsWith(mtmPrefix))
+            return QMessageId(id.toString().right(id.toString().length() - QString(mtmPrefix).length()));
+        else
+            return QMessageId(id);
+    }
+
+    QMessageAccountId stripIdPrefix(const QMessageAccountId& id)
+    {
+        if (id.toString().startsWith(freestylePrefix))
+            return QMessageAccountId(id.toString().right(id.toString().length() - QString(freestylePrefix).length()));
+        else if (id.toString().startsWith(mtmPrefix))
+            return QMessageAccountId(id.toString().right(id.toString().length() - QString(mtmPrefix).length()));
+        else
+            return QMessageAccountId(id);
+    }
+
+    QMessageFolderId stripIdPrefix(const QMessageFolderId& id)
+    {
+        if (id.toString().startsWith(freestylePrefix))
+            return QMessageFolderId(id.toString().right(id.toString().length() - QString(freestylePrefix).length()));
+        else if (id.toString().startsWith(mtmPrefix))
+            return QMessageFolderId(id.toString().right(id.toString().length() - QString(mtmPrefix).length()));
+        else
+            return QMessageFolderId(id);
+    }
+
+}
+
+namespace MessagingUtil {
+
+    QString addIdPrefix(const QString& id)
+    {
+        if(id.startsWith(idPrefix()))
+			qWarning() << "ID already prefixed";
+
+        return idPrefix() + id;
+    }
+
+    QString stripIdPrefix(const QString& id)
+    {
+		if(!id.startsWith(idPrefix()))
+			qWarning() << "ID not prefixed";
+
+		return id.right(id.length() - idPrefix().length());
+    }
+
+    QString idPrefix()
+    {
+#ifdef Q_OS_SYMBIAN
+        static QString prefix(SymbianHelpers::mtmPrefix);
+#elif defined(Q_OS_WIN)
+        static QString prefix("WIN_");
+#else
+        static QString prefix("QMF_");
+#endif
+        return prefix;
+    }
+
+}
+
+QTM_END_NAMESPACE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/src/messaging/messagingutil_p.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef _SYMBIANHELPERS_H_
+#define _SYMBIANHELPERS_H_
+
+#include <QtCore>
+#include "qmessage.h"
+
+QTM_BEGIN_NAMESPACE
+
+class QMessageId;
+class QMessageAccountId;
+class QMessageFolderId;
+
+namespace SymbianHelpers {
+
+    enum EngineType {
+        EngineTypeMTM = 0,
+        EngineTypeFreestyle,
+        EngineDefault
+    };
+
+    EngineType idType(const QString& id);
+    EngineType idType(const QMessageId& id);
+    EngineType idType(const QMessageAccountId& id);
+    EngineType idType(const QMessageFolderId& id);
+
+    QString addIdPrefix(const QString& id, const EngineType& type = EngineDefault);
+    QMessageId addIdPrefix(const QMessageId& id, const EngineType& type = EngineDefault);
+    QMessageAccountId addIdPrefix(const QMessageAccountId& id, const EngineType& type = EngineDefault);
+    QMessageFolderId addIdPrefix(const QMessageFolderId& id, const EngineType& type = EngineDefault);
+
+    QString stripIdPrefix(const QString& id);
+    QMessageId stripIdPrefix(const QMessageId& id);
+    QMessageAccountId stripIdPrefix(const QMessageAccountId& id);
+    QMessageFolderId stripIdPrefix(const QMessageFolderId& id);
+
+    static const char* mtmPrefix = "MTM_";
+    static const char* freestylePrefix = "FS_";
+}
+
+namespace MessagingUtil
+{
+    QString addIdPrefix(const QString& id);
+    QString stripIdPrefix(const QString& id);
+    QString idPrefix();
+}
+
+QTM_END_NAMESPACE
+
+#endif
--- a/qtmobility/src/messaging/qmessage.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessage.cpp	Thu May 27 13:42:11 2010 +0300
@@ -59,7 +59,6 @@
 /*!
     \class QMessage
 
-    \preliminary
     \brief The QMessage class provides a convenient interface for working with messages.
     
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessageaccount.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccount.cpp	Thu May 27 13:42:11 2010 +0300
@@ -43,7 +43,6 @@
 /*!
     \class QMessageAccount
 
-    \preliminary
     \brief The QMessageAccount class represents a messaging account in the messaging store.
     
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessageaccountfilter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccountfilter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
 /*!
     \class QMessageAccountFilter
 
-    \preliminary
     \brief The QMessageAccountFilter class defines the parameters used for querying a subset of
     all available accounts from the messaging store.
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessageaccountid.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccountid.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
     \class QMessageAccountId
     \ingroup messaging
 
-    \preliminary
     \brief The QMessageAccountId class provides a unique identifier for a QMessageAccount 
     messaging account, within the scope of the messaging store.
 
--- a/qtmobility/src/messaging/qmessageaccountid.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccountid.h	Thu May 27 13:42:11 2010 +0300
@@ -55,7 +55,7 @@
 public:
     QMessageAccountId();
     QMessageAccountId(const QMessageAccountId &other);
-    QMessageAccountId(const QString &id);
+    QMessageAccountId(const QString& id);
     ~QMessageAccountId();
     
     QMessageAccountId& operator=(const QMessageAccountId &other);
--- a/qtmobility/src/messaging/qmessageaccountid_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccountid_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -41,6 +41,7 @@
 #include "qmessageaccountid.h"
 #include "qmessageaccountid_p.h"
 #include <qhash.h>
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -91,7 +92,7 @@
             d_ptr = 0;
         }
     }
-    
+
     return *this;
 }
 
@@ -100,12 +101,12 @@
     long left = 0;
     long right = 0;
     if (d_ptr) {
-        left = d_ptr->_id.toLong();
+        left = SymbianHelpers::stripIdPrefix(d_ptr->_id).toLong();
     }
     if (other.d_ptr) {
-        right = other.d_ptr->_id.toLong();
+        right = SymbianHelpers::stripIdPrefix(other.d_ptr->_id).toLong();
     }
-    
+
     return (left < right);
 }
 
--- a/qtmobility/src/messaging/qmessageaccountid_win.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccountid_win.cpp	Thu May 27 13:42:11 2010 +0300
@@ -42,6 +42,7 @@
 #include <QByteArray>
 #include <QDataStream>
 #include <MAPIUtil.h>
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -90,7 +91,7 @@
 QMessageAccountId::QMessageAccountId(const QString& id)
     : d_ptr(new QMessageAccountIdPrivate(this))
 {
-	QDataStream idStream(QByteArray::fromBase64(WinHelpers::stripIdPrefix(id).toLatin1()));
+    QDataStream idStream(QByteArray::fromBase64(MessagingUtil::stripIdPrefix(id).toLatin1()));
     idStream >> d_ptr->_storeRecordKey;
 }
 
@@ -128,13 +129,13 @@
 QString QMessageAccountId::toString() const
 {
     if (!isValid())
-        return QString();
+        return MessagingUtil::addIdPrefix(QString());
 
     QByteArray encodedId;
     QDataStream encodedIdStream(&encodedId, QIODevice::WriteOnly);
     encodedIdStream << d_ptr->_storeRecordKey;
 
-	return WinHelpers::addIdPrefix(encodedId.toBase64());
+    return MessagingUtil::addIdPrefix(encodedId.toBase64());
 }
 
 bool QMessageAccountId::isValid() const
--- a/qtmobility/src/messaging/qmessageaccountsortorder.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaccountsortorder.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,7 +45,6 @@
 /*!
     \class QMessageAccountSortOrder
 
-    \preliminary
     \brief The QMessageAccountSortOrder class defines the parameters used for sorting a subset of 
     queried accounts from the messaging store.
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessageaddress.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageaddress.cpp	Thu May 27 13:42:11 2010 +0300
@@ -47,7 +47,6 @@
 /*!
     \class QMessageAddress
 
-    \preliminary
     \brief The QMessageAddress class provides an interface for a message address.
 
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessagecontentcontainer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagecontentcontainer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -51,7 +51,6 @@
 
 /*!
     \class QMessageContentContainer
-    \preliminary
 
     \brief The QMessageContentContainer class provides an interface for internet media (MIME) 
     and Transport Neutral Encapsulation Format (TNEF) content that is possibly only 
--- a/qtmobility/src/messaging/qmessagecontentcontainer_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagecontentcontainer_p.h	Thu May 27 13:42:11 2010 +0300
@@ -44,6 +44,7 @@
 #include "qmessageglobal.h"
 #include "qmessagecontentcontainer.h"
 #include "qmessage.h"
+#include "messagingutil_p.h"
 
 #ifdef USE_QMF_IMPLEMENTATION
 #include "qmfhelpers_p.h"
@@ -355,7 +356,7 @@
             return;
         }
 #endif
-		container.d_ptr->_id = QMessageContentContainerId(WinHelpers::addIdPrefix(QString::number(_attachments.count()+1)));
+        container.d_ptr->_id = QMessageContentContainerId(MessagingUtil::addIdPrefix(QString::number(_attachments.count()+1)));
         _attachments.append(container);
         return container.d_ptr->_id;
     }
@@ -370,14 +371,14 @@
 #endif
         _attachments.prepend(container);
         for (int i = 0; i < _attachments.count(); ++i) {
-			_attachments[i].d_ptr->_id = QMessageContentContainerId(WinHelpers::addIdPrefix(QString::number(i+1)));
+            _attachments[i].d_ptr->_id = QMessageContentContainerId(MessagingUtil::addIdPrefix(QString::number(i+1)));
         }
         return _attachments[0].d_ptr->_id;
     }
 
     QMessageContentContainerId bodyContentId() const
     {
-		return QMessageContentContainerId(WinHelpers::addIdPrefix(QString::number(0)));
+        return QMessageContentContainerId(MessagingUtil::addIdPrefix(QString::number(0)));
     }
 
     static QString attachmentFilename(const QMessageContentContainer& container)
--- a/qtmobility/src/messaging/qmessagecontentcontainer_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagecontentcontainer_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -42,7 +42,8 @@
 #include <QStringList>
 #include <QTextCodec>
 #include "qmessagecontentcontainer_symbian_p.h"
-#include "qmtmengine_symbian_p.h"
+#include <qmtmengine_symbian_p.h>
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -234,7 +235,7 @@
 
 QMessageContentContainerId QMessageContentContainerPrivate::appendContent(QMessageContentContainer& container)
 {
-    container.d_ptr->_id = QMessageContentContainerId(QString::number(_attachments.count()+1));
+    container.d_ptr->_id = QMessageContentContainerId(SymbianHelpers::addIdPrefix(QString::number(_attachments.count()+1),SymbianHelpers::EngineTypeMTM));
     _attachments.append(container);
     return container.d_ptr->_id;
 }
@@ -243,7 +244,7 @@
 {
     _attachments.prepend(container);
     for (int i = 0; i < _attachments.count(); ++i) {
-        _attachments[i].d_ptr->_id = QMessageContentContainerId(QString::number(i+1));
+        _attachments[i].d_ptr->_id = QMessageContentContainerId(SymbianHelpers::addIdPrefix(QString::number(i+1),SymbianHelpers::EngineTypeMTM));
     }
     return _attachments[0].d_ptr->_id;
 }
@@ -252,7 +253,7 @@
 
 QMessageContentContainerId QMessageContentContainerPrivate::bodyContentId()
 {
-    return QMessageContentContainerId(QString::number(0));
+    return QMessageContentContainerId(SymbianHelpers::addIdPrefix(QString::number(0),SymbianHelpers::EngineTypeMTM));
 }
 
 QByteArray QMessageContentContainerPrivate::attachmentFilename(const QMessageContentContainer& container)
--- a/qtmobility/src/messaging/qmessagecontentcontainerid.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagecontentcontainerid.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
     \class QMessageContentContainerId
     \ingroup messaging
 
-    \preliminary
     \brief The QMessageContentContainerId class provides a unique identifier for 
     QMessageContentContainer internet media (MIME) type entities, within the scope of the
     containing message.
--- a/qtmobility/src/messaging/qmessagecontentcontainerid_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagecontentcontainerid_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -39,20 +39,15 @@
 **
 ****************************************************************************/
 #include "qmessagecontentcontainerid.h"
+#include <messagingutil_p.h>
+
 
 QTM_BEGIN_NAMESPACE
 
 class QMessageContentContainerIdPrivate
 {
 public:
-    enum {
-		Invalid = -1, 
-		Body = 0 
-	};
-
-    int _number;
-
-    QMessageContentContainerIdPrivate() : _number(Invalid) {}
+    QString _id;
 };
 
 QMessageContentContainerId::QMessageContentContainerId()
@@ -69,9 +64,8 @@
 QMessageContentContainerId::QMessageContentContainerId(const QString& id)
 : d_ptr(new QMessageContentContainerIdPrivate)
 {
-	if (!id.isEmpty()) {
-		d_ptr->_number = id.toUInt();
-	}
+    if(!SymbianHelpers::stripIdPrefix(id).isEmpty())
+        d_ptr->_id = id;
 }
 
 QMessageContentContainerId::~QMessageContentContainerId()
@@ -81,26 +75,29 @@
 
 bool QMessageContentContainerId::operator==(const QMessageContentContainerId& other) const
 {
-	return (d_ptr->_number == other.d_ptr->_number);
+	return (d_ptr->_id == other.d_ptr->_id);
 }
 
 QMessageContentContainerId& QMessageContentContainerId::operator=(const QMessageContentContainerId& other)
 {
 	if (&other != this) {
-		d_ptr->_number = other.d_ptr->_number;
+		d_ptr->_id = other.d_ptr->_id;
 	}
-	
-	return *this;
+
+    return *this;
 }
 
 QString QMessageContentContainerId::toString() const
 {
-	return QString::number(d_ptr->_number);
+    if(!isValid())
+        return QString();
+
+	return d_ptr->_id;
 }
 
 bool QMessageContentContainerId::isValid() const
 {
-	return (d_ptr->_number != QMessageContentContainerIdPrivate::Invalid);
+	return !d_ptr->_id.isEmpty();
 }
 
 QTM_END_NAMESPACE
--- a/qtmobility/src/messaging/qmessagecontentcontainerid_win.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagecontentcontainerid_win.cpp	Thu May 27 13:42:11 2010 +0300
@@ -41,6 +41,7 @@
 #include "qmessagecontentcontainerid.h"
 #include "qmessagecontentcontainerid_p.h"
 #include "winhelpers_p.h"
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -59,7 +60,7 @@
     : d_ptr(new QMessageContentContainerIdPrivate)
 {
     if (!id.isEmpty()) {
-		d_ptr->_number = WinHelpers::stripIdPrefix(id).toUInt();
+        d_ptr->_number = MessagingUtil::stripIdPrefix(id).toUInt();
     }
 }
 
@@ -84,7 +85,7 @@
 
 QString QMessageContentContainerId::toString() const
 {
-	return WinHelpers::addIdPrefix(QString::number(d_ptr->_number));
+    return MessagingUtil::addIdPrefix(QString::number(d_ptr->_number));
 }
 
 bool QMessageContentContainerId::isValid() const
--- a/qtmobility/src/messaging/qmessagefilter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefilter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
 /*!
     \class QMessageFilter
 
-    \preliminary
     \brief The QMessageFilter class defines the parameters used for querying a subset of
     all available messages from the messaging store.
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessagefolder.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefolder.cpp	Thu May 27 13:42:11 2010 +0300
@@ -43,7 +43,6 @@
 /*!
     \class QMessageFolder
 
-    \preliminary
     \brief The QMessageFolder class provides an interface for folders containing messages in the 
     messaging store.
     
--- a/qtmobility/src/messaging/qmessagefolderfilter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefolderfilter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
 /*!
     \class QMessageFolderFilter
 
-    \preliminary
     \brief The QMessageFolderFilter class defines the parameters used for querying a subset of
     all available folders from the messaging store.
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessagefolderid.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefolderid.cpp	Thu May 27 13:42:11 2010 +0300
@@ -46,7 +46,6 @@
     \class QMessageFolderId
     \ingroup messaging
 
-    \preliminary
     \brief The QMessageFolderId class provides a unique identifier for a QMessageFolder message 
     folder, within the scope of the messaging store.
 
--- a/qtmobility/src/messaging/qmessagefolderid.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefolderid.h	Thu May 27 13:42:11 2010 +0300
@@ -55,7 +55,7 @@
 public:
     QMessageFolderId();
     QMessageFolderId(const QMessageFolderId &other);
-    QMessageFolderId(const QString &id);
+    QMessageFolderId(const QString& id);
     ~QMessageFolderId();
 
     QMessageFolderId& operator=(const QMessageFolderId &other);
--- a/qtmobility/src/messaging/qmessagefolderid_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefolderid_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -41,6 +41,7 @@
 #include "qmessagefolderid.h"
 #include "qmessagefolderid_p.h"
 #include <qhash.h>
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -114,7 +115,7 @@
     if (!isValid()) {
         return QString();
     }
-    
+
     return d_ptr->_id;
 }
 
--- a/qtmobility/src/messaging/qmessagefolderid_win.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefolderid_win.cpp	Thu May 27 13:42:11 2010 +0300
@@ -44,6 +44,7 @@
 #include <QDataStream>
 #include <MAPIUtil.h>
 #include <QDebug>
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -108,7 +109,7 @@
 QMessageFolderId::QMessageFolderId(const QString& id)
     : d_ptr(new QMessageFolderIdPrivate(this))
 {
-	QDataStream idStream(QByteArray::fromBase64(WinHelpers::stripIdPrefix(id).toLatin1()));
+	QDataStream idStream(QByteArray::fromBase64(MessagingUtil::stripIdPrefix(id).toLatin1()));
     d_ptr->_valid = true;
 #ifdef _WIN32_WCE
     idStream >> d_ptr->_entryId;
@@ -185,7 +186,7 @@
 QString QMessageFolderId::toString() const
 {
     if (!isValid())
-        return QString();
+        return MessagingUtil::addIdPrefix(QString());
     QByteArray encodedId;
     QDataStream encodedIdStream(&encodedId, QIODevice::WriteOnly);
 #ifdef _WIN32_WCE
@@ -201,7 +202,7 @@
     if (d_ptr->_entryId.count())
         encodedIdStream << d_ptr->_entryId;
 #endif
-	return WinHelpers::addIdPrefix(encodedId.toBase64());
+	return MessagingUtil::addIdPrefix(encodedId.toBase64());
 }
 
 bool QMessageFolderId::isValid() const
--- a/qtmobility/src/messaging/qmessagefoldersortorder.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagefoldersortorder.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,7 +45,6 @@
 /*!
     \class QMessageFolderSortOrder
 
-    \preliminary
     \brief The QMessageFolderSortOrder class defines the parameters used for sorting a subset of 
     queried folders from the messaging store.
     \ingroup messaging
--- a/qtmobility/src/messaging/qmessageglobal.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageglobal.h	Thu May 27 13:42:11 2010 +0300
@@ -43,6 +43,7 @@
 #define QMESSAGINGGLOBAL_H
 
 #include <qmobilityglobal.h>
+#include <QString>
 
 // A variant of Q_GLOBAL_STATIC for use in class scope
 #define Q_SCOPED_STATIC_DECLARE(TYPE, NAME)                      \
--- a/qtmobility/src/messaging/qmessageid.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageid.cpp	Thu May 27 13:42:11 2010 +0300
@@ -47,7 +47,6 @@
     \class QMessageId
     \ingroup messaging
 
-    \preliminary
     \brief The QMessageId class provides a unique identifier for a QMessage message within the 
     scope of the messaging store.
 
--- a/qtmobility/src/messaging/qmessageid.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageid.h	Thu May 27 13:42:11 2010 +0300
@@ -50,14 +50,14 @@
 
 class QMessageIdPrivate;
 
-class Q_MESSAGING_EXPORT QMessageId 
+class Q_MESSAGING_EXPORT QMessageId
 {
     friend class QMessageIdPrivate;
 
 public:
     QMessageId();
     QMessageId(const QMessageId &other);
-    QMessageId(const QString &id);
+    QMessageId(const QString& id);
     ~QMessageId();
 
     QMessageId& operator=(const QMessageId &other);
--- a/qtmobility/src/messaging/qmessageid_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageid_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -40,7 +40,7 @@
 ****************************************************************************/
 #include "qmessageid.h"
 #include <qhash.h>
-
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -81,9 +81,9 @@
 
     if (!d_ptr)
         d_ptr = new QMessageIdPrivate;
-    
+
     d_ptr->_id = other.d_ptr->_id;
-        
+
     return *this;
 }
 
@@ -91,10 +91,10 @@
 {
     if (!other.d_ptr && !d_ptr)
         return true;
-    
+
     if (!other.d_ptr || !d_ptr)
         return false;
-    
+
     return (d_ptr->_id == other.d_ptr->_id);
 }
 
@@ -103,12 +103,12 @@
     long left = 0;
     long right = 0;
     if (d_ptr) {
-        left = d_ptr->_id.toLong();
+        left = SymbianHelpers::stripIdPrefix(d_ptr->_id).toLong();
     }
     if (other.d_ptr) {
-        right = other.d_ptr->_id.toLong();
+        right = SymbianHelpers::stripIdPrefix(other.d_ptr->_id).toLong();
     }
-    
+
     return (left < right);
 }
 
--- a/qtmobility/src/messaging/qmessageid_win.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageid_win.cpp	Thu May 27 13:42:11 2010 +0300
@@ -43,7 +43,7 @@
 #include <QDataStream>
 #include <MAPIUtil.h>
 #include <QDebug>
-
+#include <messagingutil_p.h>
 
 QTM_BEGIN_NAMESPACE
 
@@ -180,7 +180,7 @@
 QMessageId::QMessageId(const QString& id)
     : d_ptr(new QMessageIdPrivate(this))
 {
-	QDataStream idStream(QByteArray::fromBase64(WinHelpers::stripIdPrefix(id).toLatin1()));
+	QDataStream idStream(QByteArray::fromBase64(MessagingUtil::stripIdPrefix(id).toLatin1()));
 
 #ifdef _WIN32_WCE
     idStream >> d_ptr->_entryId;
@@ -270,7 +270,7 @@
 QString QMessageId::toString() const
 {
     if (!isValid())
-        return QString();
+        return MessagingUtil::addIdPrefix(QString());
 
 #ifndef _WIN32_WCE
     if (d_ptr->_messageRecordKey.isEmpty())
@@ -290,7 +290,7 @@
     encodedIdStream << d_ptr->_folderRecordKey;
     encodedIdStream << d_ptr->_storeRecordKey;
 
-	return WinHelpers::addIdPrefix(encodedId.toBase64());
+	return MessagingUtil::addIdPrefix(encodedId.toBase64());
 }
 
 bool QMessageId::isValid() const
--- a/qtmobility/src/messaging/qmessagemanager.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagemanager.cpp	Thu May 27 13:42:11 2010 +0300
@@ -48,7 +48,6 @@
 /*!
     \class QMessageManager
 
-    \preliminary
     \brief The QMessageManager class represents the main interface for storage and retrieval
     of messages, folders and accounts in the system message store.
 
--- a/qtmobility/src/messaging/qmessageservice.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageservice.cpp	Thu May 27 13:42:11 2010 +0300
@@ -49,7 +49,6 @@
 /*!
     \class QMessageService
 
-    \preliminary
     \ingroup messaging
 
     \brief The QMessageService class provides the interface for requesting 
--- a/qtmobility/src/messaging/qmessageservice_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageservice_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,8 +45,12 @@
 #include "modestengine_maemo_p.h"
 #include "telepathyengine_maemo_p.h"
 #include "eventloggerengine_maemo_p.h"
+#include <QUrl>
+#include "hildon-uri.h"
 
 QTM_BEGIN_NAMESPACE
+#define EVENTLOGGER_THREAD
+
 
 QMessageServicePrivate::QMessageServicePrivate(QMessageService* parent)
  : q_ptr(parent),
@@ -55,6 +59,10 @@
    _active(false), _actionId(-1),
    _pendingRequestCount(0)
 {
+#ifdef EVENTLOGGER_THREAD
+    connect(EventLoggerEngine::instance(),SIGNAL(messagesFound(const QMessageIdList &,bool,bool)),this,SLOT(messagesFound(const QMessageIdList &,bool,bool)));
+
+#endif
 }
 
 QMessageServicePrivate::~QMessageServicePrivate()
@@ -89,8 +97,12 @@
     _pendingRequestCount = 0;
 
     if (enginesToCall & EnginesToCallTelepathy) {
-        _ids = EventLoggerEngine::instance()->filterAndOrderMessages(filter,sortOrder,QString(),QMessageDataComparator::MatchFlags());
+#ifndef EVENTLOGGER_THREAD
+      _ids = EventLoggerEngine::instance()->filterAndOrderMessages(filter,sortOrder,QString(),QMessageDataComparator::MatchFlags());
         QMetaObject::invokeMethod(this, "messagesFoundSlot", Qt::QueuedConnection);
+#else
+        EventLoggerEngine::instance()->filterMessages(_filter,sortOrder,QString(),QMessageDataComparator::MatchFlags());
+#endif
         _pendingRequestCount++;
     }
 
@@ -139,8 +151,12 @@
     _pendingRequestCount = 0;
 
     if (enginesToCall & EnginesToCallTelepathy) {
+#ifndef EVENTLOGGER_THREAD
         _ids= EventLoggerEngine::instance()->filterAndOrderMessages(filter,sortOrder,body,matchFlags); 
         QMetaObject::invokeMethod(this, "messagesFoundSlot", Qt::QueuedConnection);
+#else
+        EventLoggerEngine::instance()->filterMessages(_filter,sortOrder,body,matchFlags);
+#endif
         _pendingRequestCount++;
     }
 
@@ -327,7 +343,7 @@
 
 bool QMessageService::send(QMessage &message)
 {
-  //  qDebug() << "QMessageService::send";
+   qDebug() << "QMessageService::send";
     if (d_ptr->_active) {
         return false;
     }
@@ -418,11 +434,13 @@
     }
 
     d_ptr->setFinished(retVal);
+    qDebug() << "send returns=" << retVal;
     return retVal;
 }
 
 bool QMessageService::compose(const QMessage &message)
 {
+  //  qDebug() << "qMessageService::compose";
     if (d_ptr->_active) {
         return false;
     }
@@ -430,14 +448,19 @@
     d_ptr->_active = true;
     d_ptr->_error = QMessageManager::NoError;
 
-    bool retVal = true;
+    bool retVal=false;
     d_ptr->_state = QMessageService::ActiveState;
     emit stateChanged(d_ptr->_state);
+    qDebug() << "qMessageService::compose stateChanged";
 
-    if (message.type() == QMessage::Sms) {
-        d_ptr->_error = QMessageManager::NotYetImplemented; //TODO:
-        qWarning() << "QMessageService::compose not yet implemented for SMS";
-        retVal = false;
+    if (message.type() == QMessage::Sms && !message.to().isEmpty() && !message.to().first().addressee().isEmpty()) {
+      QUrl smsUrl((QString("sms:%1").arg(message.to().first().addressee())));
+      smsUrl.addQueryItem("body",message.textContent());
+      //      qDebug() << "compose SMS url=" << smsUrl.toString();
+      hildon_uri_open(smsUrl.toString().toStdString().c_str(),NULL,NULL);
+      retVal = true;
+
+
     } else if (message.type() == QMessage::Mms) {
         d_ptr->_error = QMessageManager::NotYetImplemented; //TODO:
         qWarning() << "QMessageService::compose not yet implemented for MMS";
@@ -446,10 +469,13 @@
         retVal = ModestEngine::instance()->composeEmail(message);
     }
 
-    d_ptr->setFinished(retVal);
+    d_ptr->setFinished(retVal); 
+    //    qDebug() << "compose returns=" << retVal;
     return retVal;
 }
 
+
+
 bool QMessageService::retrieveHeader(const QMessageId& id)
 {
     Q_UNUSED(id)
--- a/qtmobility/src/messaging/qmessageservice_maemo_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessageservice_maemo_p.h	Thu May 27 13:42:11 2010 +0300
@@ -74,15 +74,14 @@
                        EnginesToCall enginesToCall = EnginesToCallAll);
 
     void setFinished(bool successful);
-    void stateChanged(QMessageService::State state);
-    void messagesFound(const QMessageIdList &ids, bool isFiltered, bool isSorted);
     void messagesCounted(int count);
     void progressChanged(uint value, uint total);
 
 public slots:
     void messagesFoundSlot();
     void messagesCountedSlot();
-
+    void messagesFound(const QMessageIdList &ids, bool isFiltered, bool isSorted);
+    void stateChanged(QMessageService::State state);
 public:
     QMessageService* q_ptr;
     QMessageService::State _state;
--- a/qtmobility/src/messaging/qmessagesortorder.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmessagesortorder.cpp	Thu May 27 13:42:11 2010 +0300
@@ -47,7 +47,6 @@
 /*!
     \class QMessageSortOrder
 
-    \preliminary
     \brief The QMessageSortOrder class defines the parameters used for sorting a subset of 
     queried messages from the messaging store.
     \ingroup messaging
--- a/qtmobility/src/messaging/qmtmengine_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmtmengine_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -88,8 +88,11 @@
 #include <miutmsg.h>
 #include <charconv.h>
 #include <imcvtext.h> // KImcvMultipart declaration
+#include <smscmds.h>
 
 #include <QTextCodec>
+#include <messagingutil_p.h>
+
 
 QTM_BEGIN_NAMESPACE
 
@@ -105,7 +108,7 @@
     CActiveScheduler::Add(this);
     iTimer.CreateLocal();
 
-    TRAPD(err, 
+    TRAPD(err,
         ipMsvSession = CMsvSession::OpenSyncL(*this);
         iSessionReady = ETrue;
         ipClientMtmReg = CClientMtmRegistry::NewL(*ipMsvSession);
@@ -119,7 +122,7 @@
 
     // Create & Add SMS Account
     TRAPD(accountError,
-        iSMSAccountidAsString = QString::number(mtmServiceEntryIdL(CMTMEngine::MTMTypeSMS));
+        iSMSAccountidAsString = SymbianHelpers::addIdPrefix(QString::number(mtmServiceEntryIdL(CMTMEngine::MTMTypeSMS)),SymbianHelpers::EngineTypeMTM);
         QMessageAccount smsAcc = QMessageAccountPrivate::from(QMessageAccountId(iSMSAccountidAsString),
                                                               QString("SMS"),
                                                               mtmServiceEntryIdL(CMTMEngine::MTMTypeSMS),
@@ -129,7 +132,7 @@
 
 
         // Create & Add MMS Account
-        iMMSAccountidAsString = QString::number(mtmServiceEntryIdL(CMTMEngine::MTMTypeMMS));
+        iMMSAccountidAsString = SymbianHelpers::addIdPrefix(QString::number(mtmServiceEntryIdL(CMTMEngine::MTMTypeMMS)),SymbianHelpers::EngineTypeMTM);
         QMessageAccount mmsAcc = QMessageAccountPrivate::from(QMessageAccountId(iMMSAccountidAsString),
                                                               QString("MMS"),
                                                               mtmServiceEntryIdL(CMTMEngine::MTMTypeMMS),
@@ -375,9 +378,9 @@
     if (err == KErrNone) {
         QString idAsString;
         if (defaultAccount.iRelatedService != 0) {
-            idAsString = QString::number(defaultAccount.iRelatedService);
+            idAsString = SymbianHelpers::addIdPrefix(QString::number(defaultAccount.iRelatedService),SymbianHelpers::EngineTypeMTM);
         } else {
-            idAsString = QString::number(defaultAccount.iSmtpService);
+            idAsString = SymbianHelpers::addIdPrefix(QString::number(defaultAccount.iSmtpService),SymbianHelpers::EngineTypeMTM);
         }
         if (!iAccounts.contains(idAsString)) {
             QMessageAccount account = QMessageAccountPrivate::from(QMessageAccountId(idAsString),
@@ -398,7 +401,7 @@
     pEmailAccounts->GetImapAccountsL(imapAccounts);
     CleanupClosePushL(imapAccounts);
     for (int i=0; i < imapAccounts.Count(); i++) {
-        QString idAsString = QString::number(imapAccounts[i].iImapService);
+        QString idAsString = SymbianHelpers::addIdPrefix(QString::number(imapAccounts[i].iImapService),SymbianHelpers::EngineTypeMTM);
         if (!iAccounts.contains(idAsString)) {
             QMessageAccount account = QMessageAccountPrivate::from(QMessageAccountId(idAsString),
                                                                    QString::fromUtf16(imapAccounts[i].iImapAccountName.Ptr(), imapAccounts[i].iImapAccountName.Length()),
@@ -416,9 +419,9 @@
     pEmailAccounts->GetPopAccountsL(popAccounts);
     CleanupClosePushL(popAccounts);
     for (int i=0; i < popAccounts.Count(); i++) {
-        QString idAsString = QString::number(popAccounts[i].iPopService);
+        QString idAsString = SymbianHelpers::addIdPrefix(QString::number(popAccounts[i].iPopService),SymbianHelpers::EngineTypeMTM);
         if (!iAccounts.contains(idAsString)) {
-            QMessageAccount account = QMessageAccountPrivate::from(QMessageAccountId(QString::number(popAccounts[i].iPopService)),
+            QMessageAccount account = QMessageAccountPrivate::from(QMessageAccountId(SymbianHelpers::addIdPrefix(QString::number(popAccounts[i].iPopService),SymbianHelpers::EngineTypeMTM)),
                                                                    QString::fromUtf16(popAccounts[i].iPopAccountName.Ptr(), popAccounts[i].iPopAccountName.Length()),
                                                                    popAccounts[i].iPopService,
                                                                    popAccounts[i].iSmtpService,
@@ -435,9 +438,9 @@
     CleanupClosePushL(smtpAccounts);
     for (int i=0; i < smtpAccounts.Count(); i++) {
         if (smtpAccounts[i].iRelatedService == 0) {
-            QString idAsString = QString::number(smtpAccounts[i].iSmtpService);
+            QString idAsString = SymbianHelpers::addIdPrefix(QString::number(smtpAccounts[i].iSmtpService),SymbianHelpers::EngineTypeMTM);
             if (!iAccounts.contains(idAsString)) {
-                QMessageAccount account = QMessageAccountPrivate::from(QMessageAccountId(QString::number(smtpAccounts[i].iSmtpService)),
+                QMessageAccount account = QMessageAccountPrivate::from(QMessageAccountId(SymbianHelpers::addIdPrefix(QString::number(smtpAccounts[i].iSmtpService),SymbianHelpers::EngineTypeMTM)),
                                                                        QString::fromUtf16(smtpAccounts[i].iSmtpAccountName.Ptr(), smtpAccounts[i].iSmtpAccountName.Length()),
                                                                        smtpAccounts[i].iRelatedService,
                                                                        smtpAccounts[i].iSmtpService,
@@ -699,7 +702,7 @@
 
 void CMTMEngine::showMessageL(const QMessageId &id)
 {
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     
     CMsvEntry* pEntry = ipMsvSession->GetEntryL(messageId);
     CleanupStack::PushL(pEntry);
@@ -967,7 +970,7 @@
 {
     Q_UNUSED(id); // all attachments are retrieved (cannot retrieve only one)
     
-    long int messId = messageId.toString().toLong();
+    long int messId = SymbianHelpers::stripIdPrefix(messageId.toString()).toLong();
     
     CMsvEntry* pEntry = ipMsvSession->GetEntryL(messId);
     CleanupStack::PushL(pEntry);
@@ -1074,7 +1077,7 @@
 
 void CMTMEngine::retrieveBodyL(const QMessageId& id) const
 {
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     
     CMsvEntry* pEntry = ipMsvSession->GetEntryL(messageId);
     CleanupStack::PushL(pEntry);
@@ -1181,7 +1184,7 @@
 
 void CMTMEngine::retrieveHeaderL(const QMessageId& id) const
 {
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     
     CMsvEntry* pEntry = ipMsvSession->GetEntryL(messageId);
     CleanupStack::PushL(pEntry);
@@ -1325,7 +1328,7 @@
 
 bool CMTMEngine::removeMessageL(const QMessageId &id, QMessageManager::RemovalOption /*option*/)
 {
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     CMsvEntry* pEntry = ipMsvSession->GetEntryL(messageId);
     CleanupStack::PushL(pEntry);
     
@@ -1764,6 +1767,7 @@
     iMessageQueries.removeAt(index);
 }
 
+
 void CMTMEngine::applyOffsetAndLimitToMsgIds(QMessageIdList& idList, int offset, int limit) const
 {
     if (offset > 0) {
@@ -1812,7 +1816,7 @@
             {
             if (pf->_comparatorType == QMessageFolderFilterPrivate::Equality) {
                 QMessageDataComparator::EqualityComparator cmp(static_cast<QMessageDataComparator::EqualityComparator>(pf->_comparatorValue));
-                if (pf->_value.toString().length() > 0) {
+                if (pf->_value.toString().length() > QString(SymbianHelpers::mtmPrefix).length()) {
                     bool folderOk = false;
                     long int folderId = folderIdFromQMessageFolderId(QMessageFolderId(pf->_value.toString()));
                     CMsvEntry* pEntry = retrieveCMsvEntryAndPushToCleanupStack(folderId);
@@ -1926,12 +1930,12 @@
             if (pf->_comparatorType == QMessageFolderFilterPrivate::Equality) {
                 QMessageDataComparator::EqualityComparator cmp(static_cast<QMessageDataComparator::EqualityComparator>(pf->_comparatorValue));
                 if (cmp == QMessageDataComparator::Equal) {
-                    if (pf->_value.toString().length() > 0) {
+                    if (pf->_value.toString().length() > QString(SymbianHelpers::mtmPrefix).length()) {
                         ids = folderIdsByAccountId(QMessageAccountId(pf->_value.toString()));
                     }
                 } else { // NotEqual
                     ids = allFolders();
-                    if (pf->_value.toString().length() > 0) {
+                    if (pf->_value.toString().length() > QString(SymbianHelpers::mtmPrefix).length()) {
                         QMessageFolderIdList ids2 = folderIdsByAccountId(QMessageAccountId(pf->_value.toString()));
                         for (int i = 0; i < ids2.count(); i++) {
                             ids.removeOne(ids2[i]);
@@ -1963,7 +1967,7 @@
                             CleanupStack::PushL(pSelection);
                             if (pSelection->Count() > 0) {
                                 for(TInt i = 0; i < pSelection->Count(); i++) {
-                                    ids.append(QMessageFolderId(QString::number(pSelection->At(i))));
+                                    ids.append(QMessageFolderId(SymbianHelpers::addIdPrefix(QString::number(pSelection->At(i)),SymbianHelpers::EngineTypeMTM)));
                                 }
                             }
                             CleanupStack::PopAndDestroy(pSelection);
@@ -2092,17 +2096,17 @@
     serviceEntryIdString = nullString.left(8-serviceEntryIdString.length()) + serviceEntryIdString;
     QString folderIdString = QString::number(folderId);
     folderIdString = nullString.left(8-folderIdString.length()) + folderIdString;
-    return serviceEntryIdString+folderIdString;
+    return SymbianHelpers::addIdPrefix(serviceEntryIdString+folderIdString,SymbianHelpers::EngineTypeMTM);
 }
 
 TMsvId CMTMEngine::serviceEntryIdFromQMessageFolderId(const QMessageFolderId& folderId) const
 {
-    return folderId.toString().left(8).toLong(); 
+    return SymbianHelpers::stripIdPrefix(folderId.toString()).left(8).toLong(); 
 }
 
 TMsvId CMTMEngine::folderIdFromQMessageFolderId(const QMessageFolderId& folderId) const
 {
-    return folderId.toString().right(8).toLong(); 
+    return SymbianHelpers::stripIdPrefix(folderId.toString()).right(8).toLong(); 
 }
 
 void CMTMEngine::handleNestedFiltersFromFolderFilter(QMessageFolderFilter &filter) const
@@ -2310,7 +2314,7 @@
 {
     QMessage message;
 
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     CMsvEntry* pEntry = ipMsvSession->GetEntryL(messageId);
     CleanupStack::PushL(pEntry);
     
@@ -2429,12 +2433,35 @@
         destinationFolderId =  standardFolderId(message.standardFolder());
     }
     
-    // Current entry is the Draft folder.    
-    ipSmsMtm->SwitchCurrentEntryL(destinationFolderId);     
-    // Create a new SMS message entry as a child of the current context.    
-    ipSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);     
-    TMsvEntry entry = ipSmsMtm->Entry().Entry();
-    
+    // Switch current SMS MTM context to folder entry    
+    ipSmsMtm->SwitchCurrentEntryL(destinationFolderId);
+
+    // Create a new SMS message entry as a child of the current context
+    //
+    // Note: CreateMessageL sets following values to new message entry:
+    //       entry.iType = KUidMsvMessageEntry;
+    //       entry.iRelatedId = <ID of the current SMS service>;
+    //       entry.iServiceId = KMsvLocalServiceIndexEntryId;
+    //       entry.iMtm = <SMS Message Type UID>;
+    //       entry.SetVisible(EFalse);
+    //       entry.SetInPreparation(ETrue);
+    //       entry.iDate.UniversalTime(); <= Not set in older platforms
+    //
+    // Note: CreateMessageL automatically creates SMS header
+    //       that contains default service settings & default
+    //       service center address
+    //
+    // Note: CreateMessageL switches current SMS MTM context to
+    //       a new SMS message context
+    ipSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);
+    
+    // Get the current context (new message context)
+    CMsvEntry& newMessageContext = ipSmsMtm->Entry();
+    
+    // Copy entry values from the new message context index entry
+    TMsvEntry entry = newMessageContext.Entry();
+    
+    // Set priority values to message entry
     switch (message.priority()) {
     case QMessage::HighPriority:
         entry.SetPriority(EMsvHighPriority);
@@ -2446,6 +2473,8 @@
         entry.SetPriority(EMsvLowPriority);
         break;
     }
+    
+    // Set message read status to message entry
     if (message.status() & QMessage::Read) { 
         entry.SetUnread(false);
         entry.SetNew(false);
@@ -2453,8 +2482,9 @@
         entry.SetUnread(true);
         entry.SetNew(true);
     }
-    ipSmsMtm->Entry().ChangeL(entry);
-    
+    
+    // Set first message addressee to message entry
+    // and all message addressees to SMS message
     QList<QMessageAddress> list(message.to());
     if (!list.empty()){
         TPtrC16 receiver(KNullDesC);
@@ -2462,45 +2492,51 @@
         for (int i = 0; i < list.size(); ++i) {
             qreceiver = list.at(i).addressee();
             receiver.Set(reinterpret_cast<const TUint16*>(qreceiver.utf16()));
-            ipSmsMtm->AddAddresseeL(receiver); 
-            ipSmsMtm->SaveMessageL();
+            if (i == 0) {
+                // Set addressee to message entry 
+                entry.iDetails.Set(receiver);
             }
-    }
-    
-    CMsvStore* store = ipSmsMtm->Entry().EditStoreL(); 
-    CleanupStack::PushL(store);
-    
+            // Add addressee to SMS message
+            ipSmsMtm->AddAddresseeL(receiver); 
+        }
+    }
+    
+    // Set body to message entry and SMS message
     QString body = message.textContent();
     if (!body.isEmpty()){
         TPtrC16 msg(reinterpret_cast<const TUint16*>(body.utf16()));
-        if (!ipRichText) {
-            ipCharFormatLayer = CCharFormatLayer::NewL();
-            ipParaFormatLayer = CParaFormatLayer::NewL();
-            ipRichText=CRichText::NewL(ipParaFormatLayer,ipCharFormatLayer);
+
+        // Set body to message entry 
+        entry.iDescription.Set(msg);
+
+        // Set body to SMS message
+        CRichText& body = ipSmsMtm->Body();
+        body.Reset();
+        body.InsertL(0, msg);
+    }
+
+    // Set date to message entry
+    if (!message.receivedDate().isNull() || !message.date().isNull()) {
+        if (!message.date().isNull()) {
+            entry.iDate = qDateTimeToSymbianTTime(message.date());
+        } else {
+            entry.iDate = qDateTimeToSymbianTTime(message.receivedDate());
         }
-        ipRichText->Reset();
-        ipRichText->InsertL(0, msg);
-        store->StoreBodyTextL(*ipRichText);
-        store->CommitL();
-    } 
-    CleanupStack::PopAndDestroy(store);
-    
+    }
+    
+    // Set new message's context's index entry to the specified values.
+    // <=> Changes are set into cache only
+    newMessageContext.ChangeL(entry);
+    
+    // Commit cached changes to the storage
+    // Note: SaveMessageL sets following values to message entry:
+    //       entry.SetVisible(ETrue);
+    //       entry.SetInPreparation(EFalse);
+    ipSmsMtm->SaveMessageL();  
+
+    // Get message id from new SMS message index entry 
     QMessagePrivate* privateMessage = QMessagePrivate::implementation(message);
-    privateMessage->_id = QMessageId(QString::number(entry.Id()));
-    
-    if (!message.receivedDate().isNull() || !message.date().isNull()) {
-        // Change the date to given date
-        CMsvEntry* pEntry = ipMsvSession->GetEntryL(entry.Id());
-        CleanupStack::PushL(pEntry);
-        TMsvEntry changedEntry = pEntry->Entry();
-        if (!message.date().isNull()) {
-            changedEntry.iDate = qDateTimeToSymbianTTime(message.date());
-        } else {
-            changedEntry.iDate = qDateTimeToSymbianTTime(message.receivedDate());
-        }
-        pEntry->ChangeL(changedEntry);
-        CleanupStack::PopAndDestroy(pEntry);
-    }
+    privateMessage->_id = QMessageId(SymbianHelpers::addIdPrefix(QString::number(entry.Id())));
 }
 
 bool CMTMEngine::sendSMS(QMessage &message)
@@ -2517,34 +2553,126 @@
     return true;
 }
 
+bool CMTMEngine::validateSMS()
+{
+    
+    // Validate SMS body.
+    TMsvPartList result(KMsvMessagePartNone);
+    result = ipSmsMtm->ValidateMessage(KMsvMessagePartBody);
+    if (result != KMsvMessagePartNone ) {
+        return false;
+    }
+    
+    // Validate SMS recipient
+    result = ipSmsMtm->ValidateMessage(KMsvMessagePartRecipient);
+    if ( result != KMsvMessagePartNone ) {
+        return false;
+    }
+    
+    return true;
+}
+
 void CMTMEngine::sendSMSL(QMessage &message)
 {
     if (!iSessionReady) {
         User::Leave(KErrNotReady);
     }
-    
+
     if (!message.id().isValid()) {
         QMessagePrivate::setStandardFolder(message, QMessage::DraftsFolder);
         storeSMSL(message);
     }
-    
-    long int messageId = message.id().toString().toLong();
+
+    long int messageId = SymbianHelpers::stripIdPrefix(message.id().toString()).toLong();
     if (messageId == 0) {
         User::Leave(KErrNotReady);
     }
-    
-    CMsvEntry* pMsvEntry = retrieveCMsvEntryAndPushToCleanupStack(messageId);
-    CMsvOperationWait* pMsvOperationWait = CMsvOperationWait::NewLC();
-    
-    ipSmsMtm->SwitchCurrentEntryL(pMsvEntry->Entry().Parent());
-    // Following sends SMS and _moves_ SMS from Drafts Folder to Sent Folder
-    CMsvOperation* pMsvOperation = ipSmsMtm->Entry().CopyL(messageId, ipSmsMtm->ServiceId(), pMsvOperationWait->iStatus);
-    pMsvOperationWait->Start();
-    CActiveScheduler::Start();
-    delete pMsvOperation;    
-    
-    CleanupStack::PopAndDestroy(pMsvOperationWait);
-    releaseCMsvEntryAndPopFromCleanupStack(pMsvEntry);    
+
+    // Switch current SMS MTM context to message entry    
+    ipSmsMtm->SwitchCurrentEntryL(messageId);
+    
+    // Load the cache with the message data 
+    ipSmsMtm->LoadMessageL(); 
+    
+    // Copy entry values from the message context index entry
+    TMsvEntry entry = ipSmsMtm->Entry().Entry();    
+
+    // Update date to UniversalTime
+    // <=> Date field is used to control message send time
+    entry.iDate.UniversalTime();
+
+    // Update message sending state
+    entry.SetSendingState(KMsvSendStateWaiting);
+    
+    // Set SMS Service & delivery settings to the SMS header
+    CSmsHeader& smsHeader = ipSmsMtm->SmsHeader();
+    CSmsSettings* pSmsSettings = CSmsSettings::NewL();
+    CleanupStack::PushL(pSmsSettings);
+ 
+    pSmsSettings->CopyL(ipSmsMtm->ServiceSettings());
+    pSmsSettings->SetDelivery(ESmsDeliveryImmediately);
+    pSmsSettings->SetDeliveryReport(EFalse);
+    smsHeader.SetSmsSettingsL(*pSmsSettings);
+ 
+    if (smsHeader.Message().ServiceCenterAddress().Length() == 0) {
+        CSmsSettings* pSmsServiceSettings = &(ipSmsMtm->ServiceSettings());
+        if (!pSmsServiceSettings->ServiceCenterCount()) {
+            User::Leave(KErrNotReady);
+        } else {
+            CSmsNumber* pSmsCenterNumber = CSmsNumber::NewL();
+            CleanupStack::PushL(pSmsCenterNumber);
+            pSmsCenterNumber->SetAddressL((pSmsServiceSettings->GetServiceCenter(pSmsServiceSettings->DefaultServiceCenter())).Address());
+            smsHeader.Message().SetServiceCenterAddressL(pSmsCenterNumber->Address());
+            CleanupStack::PopAndDestroy(pSmsCenterNumber);
+        }
+    }
+ 
+    CleanupStack::PopAndDestroy(pSmsSettings);    
+
+    // Update message's context's index entry to the new values.
+    // <=> Changes are set into cache only
+    ipSmsMtm->Entry().ChangeL(entry);
+    
+    // Commit cached changes to the storage
+    ipSmsMtm->SaveMessageL();
+    
+    if (validateSMS()) {
+        // Switch current SMS MTM context to SMS message parent folder entry
+        ipSmsMtm->SwitchCurrentEntryL(ipSmsMtm->Entry().Entry().Parent());
+        
+        CMsvOperationWait* pMsvOperationWait = CMsvOperationWait::NewLC();
+    
+        // Move SMS Message to Outbox
+        CMsvOperation* pMsvOperation = ipSmsMtm->Entry().MoveL(messageId,
+                                                               KMsvGlobalOutBoxIndexEntryId,
+                                                               pMsvOperationWait->iStatus);
+        pMsvOperationWait->Start();
+        CActiveScheduler::Start();
+        delete pMsvOperation;
+        
+        // Send SMS Message
+        CMsvEntrySelection* pMsvEntrySelection = new(ELeave) CMsvEntrySelection;
+        CleanupStack::PushL(pMsvEntrySelection);
+    
+        // Add SMS Message Id to selection
+        pMsvEntrySelection->AppendL(messageId); 
+     
+        // Add selection (containing SMS Message Id) to task scheduler
+        TBuf8<1> dummyParams;
+        pMsvOperation = ipSmsMtm->InvokeAsyncFunctionL(ESmsMtmCommandScheduleCopy,
+                                                       *pMsvEntrySelection,
+                                                       dummyParams,
+                                                       pMsvOperationWait->iStatus);
+        pMsvOperationWait->Start();
+        CActiveScheduler::Start();
+        delete pMsvOperation;    
+     
+        CleanupStack::PopAndDestroy(pMsvEntrySelection);    
+    
+        CleanupStack::PopAndDestroy(pMsvOperationWait);
+    } else {
+        User::Leave(KErrCorrupt);
+    }
 }
 
 void CMTMEngine::storeMMSL(QMessage &message)
@@ -2737,7 +2865,7 @@
     CleanupStack::PopAndDestroy(); // store    
     
     QMessagePrivate* privateMessage = QMessagePrivate::implementation(message);
-    privateMessage->_id = QMessageId(QString::number(indexEntry)); 
+    privateMessage->_id = QMessageId(SymbianHelpers::addIdPrefix(QString::number(indexEntry,SymbianHelpers::EngineTypeMTM)));
     // Save the changes
     ipMmsMtm->SaveMessageL();
     
@@ -2763,7 +2891,7 @@
     }
     
     QMessageId id = message.id();
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     if (messageId == 0)
         return;
     
@@ -2849,7 +2977,7 @@
     }
     
     QMessageId id = message.id();
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     if (messageId == 0)
         return;
     
@@ -3042,7 +3170,7 @@
     }
 
     QMessageId id = message.id();
-    long int messageId = id.toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(id.toString()).toLong();
     if (messageId == 0)
         return;
     
@@ -3310,7 +3438,7 @@
         messageCreated = true;
     }
     
-    long int messageId = message.id().toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(message.id().toString()).toLong();
     if (messageId == 0) {
         User::Leave(KErrNotReady);
     }
@@ -3654,7 +3782,7 @@
     CleanupStack::PopAndDestroy(pMsvOperationWait);
     
     QMessagePrivate* privateMessage = QMessagePrivate::implementation(message);
-    privateMessage->_id = QMessageId(QString::number(newMessageId)); 
+    privateMessage->_id = QMessageId(SymbianHelpers::addIdPrefix(QString::number(newMessageId),SymbianHelpers::EngineTypeMTM));
 }
 
 void CMTMEngine::sendEmailL(QMessage &message)
@@ -3683,7 +3811,7 @@
         messageCreated = true;
     }    
     
-    long int messageId = message.id().toString().toLong();
+    long int messageId = SymbianHelpers::stripIdPrefix(message.id().toString()).toLong();
     if (messageId == 0) {
         User::Leave(KErrNotReady);
     }    
@@ -4438,7 +4566,7 @@
                 } else {
                     message.setType(QMessage::NoType);
                 }
-            } else if ((privateMessageFilter->_field == QMessageFilterPrivate::StandardFolder) && 
+            } else if ((privateMessageFilter->_field == QMessageFilterPrivate::StandardFolder) &&
                        (aMsgType == KUidMsgTypeSMS || aMsgType == KUidMsgTypeMultimedia)) {
                 if (aFolderId == KMsvGlobalInBoxIndexEntryId) {
                     QMessagePrivate::setStandardFolder(message,QMessage::InboxFolder);
@@ -4448,9 +4576,9 @@
                     QMessagePrivate::setStandardFolder(message,QMessage::SentFolder);
                 } else if (aFolderId == KMsvDeletedEntryFolderEntryId) {
                     QMessagePrivate::setStandardFolder(message,QMessage::TrashFolder);
-                }       
+                }
             } else if (!messageRetrieved) {
-                message = this->message(QMessageId(QString::number(aMessageId)));
+                message = this->message(QMessageId(SymbianHelpers::addIdPrefix(QString::number(aMessageId),SymbianHelpers::EngineTypeMTM)));
                 if (message.type() == QMessage::NoType) {
                     unableToReadAndFilterMessage = true;
                     matchingFilters.clear();
@@ -4502,7 +4630,7 @@
             // No pending notification events for this messageId.
             // => Deliver notification immediately
             ipMessageStorePrivate->messageNotification(notificationType,
-                                                       QMessageId(QString::number(aMessageId)),
+                                                       QMessageId(SymbianHelpers::addIdPrefix(QString::number(aMessageId),SymbianHelpers::EngineTypeMTM)),
                                                        matchingFilters);
         }
     } else if (unableToReadAndFilterMessage) {
@@ -4538,7 +4666,7 @@
             MessageEvent event = iUndeliveredMessageEvents[0];
             bool eventHandlingPossible = true;
             if (event.notificationType != QMessageStorePrivate::Removed && event.unfiltered) {
-                QMessage message = this->message(QMessageId(QString::number(event.messageId)));
+                QMessage message = this->message(QMessageId(SymbianHelpers::addIdPrefix(QString::number(event.messageId),SymbianHelpers::EngineTypeMTM)));
                 if (message.type() == QMessage::NoType) {
                     eventHandlingPossible = false;
                 } else {
@@ -4569,7 +4697,7 @@
                 if (event.matchingFilters.count() > 0) { 
                     // Deliver message event notification
                     ipMessageStorePrivate->messageNotification(event.notificationType,
-                                                               QMessageId(QString::number(event.messageId)),
+                                                               QMessageId(SymbianHelpers::addIdPrefix(QString::number(event.messageId),SymbianHelpers::EngineTypeMTM)),
                                                                event.matchingFilters);
                 }
             } else {
@@ -4707,7 +4835,7 @@
             getAllMessagesL(iOrdering);
             iIdList = QMessageIdList();
             for (int i=0; i < ipEntrySelection->Count(); i++) {
-                iIdList.append(QMessageId(QString::number((*ipEntrySelection)[i]))); 
+                iIdList.append(QMessageId(SymbianHelpers::addIdPrefix(QString::number((*ipEntrySelection)[i]),SymbianHelpers::EngineTypeMTM)));
             }
         }
         iNumberOfHandledFilters++;
@@ -4793,9 +4921,9 @@
         iNumberOfHandledFilters++;
         if (pf->_comparatorType == QMessageFilterPrivate::Equality) { // QMessageId
             QMessageDataComparator::EqualityComparator cmp(static_cast<QMessageDataComparator::EqualityComparator>(pf->_comparatorValue));
-            if (!pf->_value.isNull() && pf->_value.toString().length() > 0) {
+            if (!pf->_value.isNull() && pf->_value.toString().length() > QString(SymbianHelpers::mtmPrefix).length()) {
                 if (cmp == QMessageDataComparator::Equal) {
-                    long int messageId = pf->_value.toString().toLong();
+                    long int messageId = SymbianHelpers::stripIdPrefix(pf->_value.toString()).toLong();
                     CMsvEntry* pEntry = iOwner.retrieveCMsvEntryAndPushToCleanupStack(messageId);
                     if (pEntry) {
                         const TMsvEntry& entry = pEntry->Entry();
@@ -4809,7 +4937,7 @@
                 } else { // NotEqual
                     ipEntrySelection = new(ELeave)CMsvEntrySelection;
                     getAllMessagesL(iOrdering);
-                    long int messageId = pf->_value.toString().toLong();
+                    long int messageId = SymbianHelpers::stripIdPrefix(pf->_value.toString()).toLong();
                     for (int i=0; i < ipEntrySelection->Count(); i++) {
                         if (ipEntrySelection->At(i) == messageId) {
                             ipEntrySelection->Delete(i);
@@ -4829,7 +4957,7 @@
                 if (cmp == QMessageDataComparator::Includes) {
                     ipEntrySelection = new(ELeave)CMsvEntrySelection;
                     for (int i=0; i < pf->_ids.count(); i++) {
-                        long int messageId = pf->_ids[i].toString().toLong();
+                        long int messageId = SymbianHelpers::stripIdPrefix(pf->_ids[i].toString()).toLong();
                         CMsvEntry* pEntry = iOwner.retrieveCMsvEntryAndPushToCleanupStack(messageId);
                         if (pEntry) {
                             const TMsvEntry& entry = pEntry->Entry();
@@ -4843,7 +4971,7 @@
                     ipEntrySelection = new(ELeave)CMsvEntrySelection;
                     getAllMessagesL(iOrdering);
                     for (int i=0; i < pf->_ids.count(); i++) {
-                        long int messageId = pf->_ids[i].toString().toLong();
+                        long int messageId = SymbianHelpers::stripIdPrefix(pf->_ids[i].toString()).toLong();
                         for (int i=0; i < ipEntrySelection->Count(); i++) {
                             if (ipEntrySelection->At(i) == messageId) {
                                 ipEntrySelection->Delete(i);
@@ -4944,7 +5072,7 @@
         if (pf->_comparatorType == QMessageFilterPrivate::Equality) { // QMessageFolderId
             QMessageDataComparator::EqualityComparator cmp(static_cast<QMessageDataComparator::EqualityComparator>(pf->_comparatorValue));
             if (cmp == QMessageDataComparator::Equal) {
-                long int folderId = iOwner.folderIdFromQMessageFolderId(QMessageFolderId(pf->_value.toString())); 
+                long int folderId = iOwner.folderIdFromQMessageFolderId(QMessageFolderId(pf->_value.toString()));
                 long int serviceEntryId = iOwner.serviceEntryIdFromQMessageFolderId(QMessageFolderId(pf->_value.toString()));
                 QMessageAccount messageAccount = iOwner.account(iOwner.accountIdByServiceId(serviceEntryId));
                 if (messageAccount.messageTypes() == QMessage::Email) {
@@ -5349,7 +5477,7 @@
     } else {
         iIdList = QMessageIdList();
         for (int i=0; i < ipEntrySelection->Count(); i++) {
-            iIdList.append(QMessageId(QString::number((*ipEntrySelection)[i]))); 
+            iIdList.append(QMessageId(SymbianHelpers::addIdPrefix(QString::number((*ipEntrySelection)[i]),SymbianHelpers::EngineTypeMTM)));
         }
         iTimer.After(iStatus, 100);
         if (!IsActive()) {
@@ -5367,7 +5495,7 @@
             const CMsvFindResultSelection& findResultSelection = ipMsvFindOperation->GetFindResult();
             QMessageIdList msgIds;
             for (int i=0; i < findResultSelection.Count(); i++) {
-                msgIds.append(QMessageId(QString::number(findResultSelection[i].iId))); 
+                msgIds.append(QMessageId(SymbianHelpers::addIdPrefix(QString::number(findResultSelection[i].iId),SymbianHelpers::EngineTypeMTM)));
             }
             iOwner.filterAndOrderMessagesReady(true, iOperationId, msgIds, iNumberOfHandledFilters, iResultCorrectlyOrdered);
         } else {
--- a/qtmobility/src/messaging/qmtmengine_symbian_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/qmtmengine_symbian_p.h	Thu May 27 13:42:11 2010 +0300
@@ -57,8 +57,6 @@
 #include "qmessageservice.h"
 
 
-
-
 class CRichText;
 class CCharFormatLayer;
 class CParaFormatLayer;
@@ -73,6 +71,7 @@
 
 
 QTM_BEGIN_NAMESPACE
+
 class CMessagesFindOperation;
 class QMessageId;
 class QMessageAccount;
@@ -163,6 +162,7 @@
                                      bool resultSetOrdered);
 
     inline RFs& FsSession() const { return((RFs&)iFsSession); }
+
 private:
     void updateEmailAccountsL() const;
     bool switchToMTMRootEntry(MTMType aMTMType);
@@ -226,6 +226,7 @@
     void storeEmailL(QMessage &message);
     void sendEmailL(QMessage &message);
     void storeSMSL(QMessage &message);
+    bool validateSMS();
     void sendSMSL(QMessage &message);
     void retrieveL(const QMessageId &messageId, const QMessageContentContainerId& id);
     void retrieveBodyL(const QMessageId& id) const;
--- a/qtmobility/src/messaging/win32wce/qmailcodec.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/win32wce/qmailcodec.cpp	Thu May 27 13:42:11 2010 +0300
@@ -57,7 +57,6 @@
 /*!
   \class QMailCodec
 
-  \preliminary
   \brief The QMailCodec class provides mechanisms for encoding and decoding between 7-bit ASCII strings
   and arbitrary octet sequences.
 
@@ -398,7 +397,6 @@
 /*!
   \class QMailBase64Codec
 
-  \preliminary
   \brief The QMailBase64Codec class encodes or decodes between 8-bit data and 7-bit ASCII, using the Base64
   character mapping scheme.
 
@@ -703,7 +701,6 @@
 /*!
   \class QMailQuotedPrintableCodec
 
-  \preliminary
   \brief The QMailQuotedPrintableCodec class encodes or decodes between 8-bit data and 7-bit ASCII, 
   using the 'quoted printable' character mapping scheme.
 
@@ -974,7 +971,6 @@
 /*!
   \class QMailPassThroughCodec
 
-  \preliminary
   \brief The QMailPassThroughCodec class uses the QMailCodec interface to move data between streams
   without coding or decoding.
 
@@ -1027,7 +1023,6 @@
 /*!
   \class QMailLineEndingCodec
 
-  \preliminary
   \brief The QMailLineEndingCodec class encodes textual data to use CR/LF line endings required for SMTP transmission.
 
   \ingroup messaginglibrary
--- a/qtmobility/src/messaging/win32wce/qmailid.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/win32wce/qmailid.cpp	Thu May 27 13:42:11 2010 +0300
@@ -128,7 +128,6 @@
     \class QMailAccountId
     \ingroup messaginglibrary
 
-    \preliminary
     \brief The QMailAccountId class is used to identify accounts stored by QMailStore.
 
     QMailAccountId is a class used to represent accounts stored by the QMailStore, identified
@@ -266,7 +265,6 @@
     \class QMailFolderId
     \ingroup messaginglibrary
 
-    \preliminary
     \brief The QMailFolderId class is used to identify folders stored by QMailStore.
 
     QMailFolderId is a class used to represent folders stored by the QMailStore, identified
@@ -412,7 +410,6 @@
     \class QMailMessageId
     \ingroup messaginglibrary
 
-    \preliminary
     \brief The QMailMessageId class is used to identify messages stored by QMailStore.
 
     QMailMessageId is a class used to represent messages stored by the QMailStore, identified
--- a/qtmobility/src/messaging/win32wce/qmailmessage.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/win32wce/qmailmessage.cpp	Thu May 27 13:42:11 2010 +0300
@@ -1366,7 +1366,6 @@
 /*!
     \class QMailMessageHeaderField
 
-    \preliminary
     \brief The QMailMessageHeaderField class encapsulates the parsing of message header fields.
     
     \ingroup messaginglibrary
@@ -1681,7 +1680,6 @@
 /*!
     \class QMailMessageContentType
 
-    \preliminary
     \brief The QMailMessageContentType class encapsulates the parsing of the RFC 2822
     'Content-Type' header field.
     
@@ -1874,7 +1872,6 @@
 /*!
     \class QMailMessageContentDisposition
 
-    \preliminary
     \brief The QMailMessageContentDisposition class encapsulates the parsing of the RFC 2822
     'Content-Disposition' header field.
     
@@ -2657,7 +2654,6 @@
 /*!
     \class QMailMessageBody
 
-    \preliminary
     \brief The QMailMessageBody class contains the body element of a message or message part.
     
     \ingroup messaginglibrary
@@ -3631,7 +3627,6 @@
 /*!
     \class QMailMessagePartContainer
 
-    \preliminary
     \brief The QMailMessagePartContainer class provides access to a collection of message parts.
     
     \ingroup messaginglibrary
@@ -4275,7 +4270,6 @@
 
 /*!
     \class QMailMessagePart
-    \preliminary
 
     \brief The QMailMessagePart class provides a convenient interface for working 
     with message attachments.
@@ -4308,7 +4302,6 @@
 
 /*!
     \class QMailMessagePart::Location
-    \preliminary
 
     \brief The Location class contains a specification of the location of a message part
     with the message that contains it.
@@ -5335,7 +5328,6 @@
 /*!
     \class QMailMessageMetaData
 
-    \preliminary
     \brief The QMailMessageMetaData class provides information about a message stored by Qtopia.
     
     \ingroup messaginglibrary
@@ -6376,7 +6368,6 @@
 /*!
     \class QMailMessage
 
-    \preliminary
     \brief The QMailMessage class provides a convenient interface for working with messages.
     
     \ingroup messaginglibrary
--- a/qtmobility/src/messaging/win32wce/qmailmessagefwd.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/win32wce/qmailmessagefwd.cpp	Thu May 27 13:42:11 2010 +0300
@@ -41,7 +41,6 @@
 
 /*!
     \class QMailMessageHeaderFieldFwd
-    \preliminary
     \brief The QMailMessageHeaderFieldFwd class declares enumerations used by QMailMessageHeaderField
    
     QMailMessageHeaderFieldFwd allows QMailMessageHeaderField::FieldType 
@@ -59,7 +58,6 @@
 
 /*!
     \class QMailMessageContentDispositionFwd
-    \preliminary
     \brief The QMailMessageContentDispositionFwd class declares enumerations used by QMailMessageContentDisposition
    
     QMailMessageContentDispositionFwd allows QMailMessageContentDisposition::DispositionType 
@@ -78,7 +76,6 @@
 
 /*!
     \class QMailMessageBodyFwd
-    \preliminary
     \brief The QMailMessageBodyFwd class declares enumerations used by QMailMessageBody
    
     QMailMessageBodyFwd allows QMailMessageBody::TransferEncoding and QMailMessageBody::EncodingStatus
@@ -122,7 +119,6 @@
 
 /*!
     \class QMailMessagePartContainerFwd
-    \preliminary
     \brief The QMailMessagePartContainerFwd class declares enumerations used by QMailMessagePartContainer
    
     QMailMessagePartContainerFwd allows QMailMessagePartContainerFwd::MultipartType
@@ -148,7 +144,6 @@
 
 /*!
     \class QMailMessagePartFwd 
-    \preliminary
     \brief The QMailMessagePartFwd class declares enumerations used by QMailMessagePart
    
     QMailMessagePartFwd allows QMailMessagePartFwd::ReferenceType
@@ -167,7 +162,6 @@
 
 /*!
     \class QMailMessageMetaDataFwd
-    \preliminary
     \brief The QMailMessageMetaDataFwd class declares enumerations used by QMailMessageMetaData
    
     QMailMessageMetaDataFwd allows QMailMessageMetaData::MessageType, QMailMessageMetaData::ContentType and QMailMessageMetaData::ResponseType
@@ -227,7 +221,6 @@
 
 /*!
     \class QMailMessageFwd
-    \preliminary
     \brief The QMailMessageFwd class declares enumerations used by QMailMessage
    
     QMailMessageFwd allows QMailMessage::AttachmentsAction and QMailMessage::EncodingFormat
--- a/qtmobility/src/messaging/winhelpers.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/winhelpers.cpp	Thu May 27 13:42:11 2010 +0300
@@ -82,6 +82,7 @@
 #include "qmessageaccountfilter_p.h"
 #include "qmessageaccountsortorder_p.h"
 #include "qmessagestore_p.h"
+#include "messagingutil_p.h"
 
 #include <QCoreApplication>
 #include <QDebug>
@@ -91,25 +92,6 @@
 #include <QTimer>
 #include <QMutexLocker>
 
-QTM_BEGIN_NAMESPACE
-
-namespace WinHelpers {
-	QString addIdPrefix(const QString& id)
-	{
-		Q_ASSERT(!id.startsWith(QString(idPrefix)));
-		return QString(idPrefix) + id;
-	}
-
-	QString stripIdPrefix(const QString& id)
-	{
-		Q_ASSERT(id.startsWith(QString(id)));
-		return id.right(id.length() - QString(idPrefix).length());
-	}
-}
-
-QTM_END_NAMESPACE
-
-
 #include <shlwapi.h>
 #include <shlguid.h>
 #include <tchar.h>
@@ -573,20 +555,21 @@
                 if (HR_SUCCEEDED(attachment->OpenProperty(PR_ATTACH_DATA_BIN, &IID_IStream, 0, MAPI_MODIFY | MAPI_CREATE, (LPUNKNOWN*)&os))) {
                     const int BUF_SIZE=4096;
                     char pData[BUF_SIZE];
-                    ULONG ulSize=0,ulRead,ulWritten;
+                    ULONG ulSize=0,ulRead,ulWritten, ulTotalWritten=0;
 
                     QDataStream attachmentStream(attachmentContainer.content());
 
                     ulRead=attachmentStream.readRawData(static_cast<char*>(pData), BUF_SIZE);
                     while (ulRead) {
                         os->Write(pData,ulRead, &ulWritten);
+                        ulTotalWritten += ulWritten;
 
                         ulSize += ulRead;
                         ulRead = attachmentStream.readRawData(static_cast<char*>(pData), BUF_SIZE);
                     }
 
                     ULARGE_INTEGER uli = { 0 };
-                    uli.LowPart = ulWritten;
+                    uli.LowPart = ulTotalWritten;
                     os->SetSize(uli);
 
                     os->Commit(STGC_DEFAULT);
--- a/qtmobility/src/messaging/winhelpers_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/messaging/winhelpers_p.h	Thu May 27 13:42:11 2010 +0300
@@ -55,12 +55,6 @@
 
 QTM_BEGIN_NAMESPACE
 
-namespace WinHelpers {
-	QString addIdPrefix(const QString& id);
-	QString stripIdPrefix(const QString& id);
-	static const char* idPrefix = "WIN_";
-};
-
 QTM_END_NAMESPACE
 
 #ifndef _WIN32_WCE
--- a/qtmobility/src/multimedia/multimedia.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/multimedia/multimedia.pro	Thu May 27 13:42:11 2010 +0300
@@ -12,7 +12,6 @@
 
 !static:DEFINES += QT_MAKEDLL
 DEFINES += QT_BUILD_MEDIA_LIB
-!symbian:DEFINES += QTM_PLUGIN_PATH=\\\"$$replace(QT_MOBILITY_PREFIX, \\\\, /)/plugins\\\"
 
 PRIVATE_HEADERS += \
     qmediacontrol_p.h \
@@ -123,6 +122,7 @@
     DEPLOYMENT += QtMediaDeployment
     TARGET.UID3=0x2002AC77
     TARGET.CAPABILITY = ALL -TCB
+    LIBS += -lefsrv
 }
 
 CONFIG += middleware
--- a/qtmobility/src/multimedia/qmediapluginloader.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/multimedia/qmediapluginloader.cpp	Thu May 27 13:42:11 2010 +0300
@@ -39,7 +39,6 @@
 **
 ****************************************************************************/
 
-#include <src/global/qbuildcfg.h>
 #include "qmediapluginloader_p.h"
 #include <QtCore/qcoreapplication.h>
 #include <QtCore/qpluginloader.h>
@@ -47,10 +46,10 @@
 #include <QtCore/qdebug.h>
 
 #include "qmediaserviceproviderplugin.h"
+#include "qmobilitypluginsearch.h"
 
 QT_BEGIN_NAMESPACE
 
-
 typedef QMap<QString,QObjectList> ObjectListMap;
 Q_GLOBAL_STATIC(ObjectListMap, staticMediaPlugins);
 
@@ -98,43 +97,23 @@
             }
         }
     } else {
-        QStringList     paths = QCoreApplication::libraryPaths();
-        QString val = qt_mobility_configure_prefix_path_str;
-        if(val.length() > 0){
-            val += "/plugins";
-            paths << val;
-        }
-
-
-#ifdef QTM_PLUGIN_PATH
-        paths << QTM_PLUGIN_PATH;
-#endif
-
-        foreach (QString const &path, paths) {
-            QString     pluginPathName(path + m_location);
-            QDir        pluginDir(pluginPathName);
-
-            if (!pluginDir.exists())
-                continue;
+        QStringList plugins = QTM_PREPEND_NAMESPACE(mobilityPlugins)(m_location);
+        for (int i=0; i < plugins.count(); i++) {
+            QPluginLoader   loader(plugins.at(i));
+            QObject *o = loader.instance();
+            if (o != 0 && o->qt_metacast(m_iid) != 0) {
+                QFactoryInterface* p = qobject_cast<QFactoryInterface*>(o);
+                if (p != 0) {
+                    foreach (QString const &key, p->keys())
+                        m_instances.insertMulti(key, o);
+                }
 
-            foreach (QString pluginLib, pluginDir.entryList(QDir::Files)) {
-                QPluginLoader   loader(pluginPathName + pluginLib);
-
-                QObject *o = loader.instance();
-                if (o != 0 && o->qt_metacast(m_iid) != 0) {
-                    QFactoryInterface* p = qobject_cast<QFactoryInterface*>(o);
-                    if (p != 0) {
-                        foreach (QString const &key, p->keys())
-                            m_instances.insertMulti(key, o);
-                    }
-
-                    continue;
-                } else {
-                    qWarning() << "QMediaPluginLoader: Failed to load plugin: " << pluginLib << loader.errorString();
-                }
-                delete o;
-                loader.unload();
+                continue;
+            } else {
+                qWarning() << "QMediaPluginLoader: Failed to load plugin: " << plugins.at(i) << loader.errorString();
             }
+            delete o;
+            loader.unload();
         }
     }
 }
--- a/qtmobility/src/publishsubscribe/GConfItem	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-#include "gconfitem.h"
--- a/qtmobility/src/s60installs/bwins/QtContactsu.def	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/s60installs/bwins/QtContactsu.def	Thu May 27 13:42:11 2010 +0300
@@ -994,4 +994,75 @@
 	?d_func@QContactUnionFilter@QtMobility@@AAEPAVQContactUnionFilterPrivate@2@XZ @ 993 NONAME ; class QtMobility::QContactUnionFilterPrivate * QtMobility::QContactUnionFilter::d_func(void)
 	??_EQContactDetailDefinitionRemoveRequest@QtMobility@@UAE@I@Z @ 994 NONAME ; QtMobility::QContactDetailDefinitionRemoveRequest::~QContactDetailDefinitionRemoveRequest(unsigned int)
 	?staticMetaObject@QContactDetailDefinitionSaveRequest@QtMobility@@2UQMetaObject@@B @ 995 NONAME ; struct QMetaObject const QtMobility::QContactDetailDefinitionSaveRequest::staticMetaObject
+	??0QContactActionDescriptor@QtMobility@@QAE@ABV01@@Z @ 996 NONAME ; QtMobility::QContactActionDescriptor::QContactActionDescriptor(class QtMobility::QContactActionDescriptor const &)
+	??0QContactActionDescriptor@QtMobility@@QAE@ABVQString@@0H@Z @ 997 NONAME ; QtMobility::QContactActionDescriptor::QContactActionDescriptor(class QString const &, class QString const &, int)
+	??0QContactActionFilter@QtMobility@@QAE@ABVQContactFilter@1@@Z @ 998 NONAME ; QtMobility::QContactActionFilter::QContactActionFilter(class QtMobility::QContactFilter const &)
+	??0QContactActionFilter@QtMobility@@QAE@XZ @ 999 NONAME ; QtMobility::QContactActionFilter::QContactActionFilter(void)
+	??1QContactAction@QtMobility@@UAE@XZ @ 1000 NONAME ; QtMobility::QContactAction::~QContactAction(void)
+	??1QContactActionDescriptor@QtMobility@@QAE@XZ @ 1001 NONAME ; QtMobility::QContactActionDescriptor::~QContactActionDescriptor(void)
+	??1QContactActionFactory@QtMobility@@UAE@XZ @ 1002 NONAME ; QtMobility::QContactActionFactory::~QContactActionFactory(void)
+	??1QContactActionFilter@QtMobility@@QAE@XZ @ 1003 NONAME ; QtMobility::QContactActionFilter::~QContactActionFilter(void)
+	??4QContactActionDescriptor@QtMobility@@QAEAAV01@ABV01@@Z @ 1004 NONAME ; class QtMobility::QContactActionDescriptor & QtMobility::QContactActionDescriptor::operator=(class QtMobility::QContactActionDescriptor const &)
+	??8QContactActionDescriptor@QtMobility@@QBE_NABV01@@Z @ 1005 NONAME ; bool QtMobility::QContactActionDescriptor::operator==(class QtMobility::QContactActionDescriptor const &) const
+	??9QContactActionDescriptor@QtMobility@@QBE_NABV01@@Z @ 1006 NONAME ; bool QtMobility::QContactActionDescriptor::operator!=(class QtMobility::QContactActionDescriptor const &) const
+	??MQContactActionDescriptor@QtMobility@@QBE_NABV01@@Z @ 1007 NONAME ; bool QtMobility::QContactActionDescriptor::operator<(class QtMobility::QContactActionDescriptor const &) const
+	??_EQContact@QtMobility@@QAE@I@Z @ 1008 NONAME ; QtMobility::QContact::~QContact(unsigned int)
+	??_EQContactAction@QtMobility@@UAE@I@Z @ 1009 NONAME ; QtMobility::QContactAction::~QContactAction(unsigned int)
+	??_EQContactActionDescriptor@QtMobility@@QAE@I@Z @ 1010 NONAME ; QtMobility::QContactActionDescriptor::~QContactActionDescriptor(unsigned int)
+	??_EQContactActionFactory@QtMobility@@UAE@I@Z @ 1011 NONAME ; QtMobility::QContactActionFactory::~QContactActionFactory(unsigned int)
+	??_EQContactDetail@QtMobility@@QAE@I@Z @ 1012 NONAME ; QtMobility::QContactDetail::~QContactDetail(unsigned int)
+	??_EQContactDetailDefinition@QtMobility@@QAE@I@Z @ 1013 NONAME ; QtMobility::QContactDetailDefinition::~QContactDetailDefinition(unsigned int)
+	??_EQContactFilter@QtMobility@@QAE@I@Z @ 1014 NONAME ; QtMobility::QContactFilter::~QContactFilter(unsigned int)
+	??_EQContactId@QtMobility@@QAE@I@Z @ 1015 NONAME ; QtMobility::QContactId::~QContactId(unsigned int)
+	??_EQContactRelationship@QtMobility@@QAE@I@Z @ 1016 NONAME ; QtMobility::QContactRelationship::~QContactRelationship(unsigned int)
+	??_EQContactSortOrder@QtMobility@@QAE@I@Z @ 1017 NONAME ; QtMobility::QContactSortOrder::~QContactSortOrder(unsigned int)
+	?action@QContactAction@QtMobility@@SAPAV12@ABVQContactActionDescriptor@2@@Z @ 1018 NONAME ; class QtMobility::QContactAction * QtMobility::QContactAction::action(class QtMobility::QContactActionDescriptor const &)
+	?actionDescriptors@QContactAction@QtMobility@@SA?AV?$QList@VQContactActionDescriptor@QtMobility@@@@ABVQString@@0H@Z @ 1019 NONAME ; class QList<class QtMobility::QContactActionDescriptor> QtMobility::QContactAction::actionDescriptors(class QString const &, class QString const &, int)
+	?actionName@QContactActionDescriptor@QtMobility@@QBE?AVQString@@XZ @ 1020 NONAME ; class QString QtMobility::QContactActionDescriptor::actionName(void) const
+	?actionName@QContactActionFilter@QtMobility@@QBE?AVQString@@XZ @ 1021 NONAME ; class QString QtMobility::QContactActionFilter::actionName(void) const
+	?availableActions@QContact@QtMobility@@QBE?AV?$QList@VQContactActionDescriptor@QtMobility@@@@ABVQString@@H@Z @ 1022 NONAME ; class QList<class QtMobility::QContactActionDescriptor> QtMobility::QContact::availableActions(class QString const &, int) const
+	?availableActions@QContactAction@QtMobility@@SA?AVQStringList@@ABVQString@@H@Z @ 1023 NONAME ; class QStringList QtMobility::QContactAction::availableActions(class QString const &, int)
+	?d_func@QContactActionFilter@QtMobility@@AAEPAVQContactActionFilterPrivate@2@XZ @ 1024 NONAME ; class QtMobility::QContactActionFilterPrivate * QtMobility::QContactActionFilter::d_func(void)
+	?d_func@QContactActionFilter@QtMobility@@ABEPBVQContactActionFilterPrivate@2@XZ @ 1025 NONAME ; class QtMobility::QContactActionFilterPrivate const * QtMobility::QContactActionFilter::d_func(void) const
+	?detailWithAction@QContact@QtMobility@@QBE?AVQContactDetail@2@PAVQContactAction@2@@Z @ 1026 NONAME ; class QtMobility::QContactDetail QtMobility::QContact::detailWithAction(class QtMobility::QContactAction *) const
+	?detailsWithAction@QContact@QtMobility@@QBE?AV?$QList@VQContactDetail@QtMobility@@@@PAVQContactAction@2@@Z @ 1027 NONAME ; class QList<class QtMobility::QContactDetail> QtMobility::QContact::detailsWithAction(class QtMobility::QContactAction *) const
+	?getStaticMetaObject@QContactAction@QtMobility@@SAABUQMetaObject@@XZ @ 1028 NONAME ; struct QMetaObject const & QtMobility::QContactAction::getStaticMetaObject(void)
+	?getStaticMetaObject@QContactActionFactory@QtMobility@@SAABUQMetaObject@@XZ @ 1029 NONAME ; struct QMetaObject const & QtMobility::QContactActionFactory::getStaticMetaObject(void)
+	?implementationVersion@QContactActionDescriptor@QtMobility@@QBEHXZ @ 1030 NONAME ; int QtMobility::QContactActionDescriptor::implementationVersion(void) const
+	?implementationVersion@QContactActionFilter@QtMobility@@QBEHXZ @ 1031 NONAME ; int QtMobility::QContactActionFilter::implementationVersion(void) const
+	?isEmpty@QContactActionDescriptor@QtMobility@@QBE_NXZ @ 1032 NONAME ; bool QtMobility::QContactActionDescriptor::isEmpty(void) const
+	?isPreferredDetail@QContact@QtMobility@@QBE_NABVQString@@ABVQContactDetail@2@@Z @ 1033 NONAME ; bool QtMobility::QContact::isPreferredDetail(class QString const &, class QtMobility::QContactDetail const &) const
+	?metaObject@QContactAction@QtMobility@@UBEPBUQMetaObject@@XZ @ 1034 NONAME ; struct QMetaObject const * QtMobility::QContactAction::metaObject(void) const
+	?metaObject@QContactActionFactory@QtMobility@@UBEPBUQMetaObject@@XZ @ 1035 NONAME ; struct QMetaObject const * QtMobility::QContactActionFactory::metaObject(void) const
+	?preferredDetail@QContact@QtMobility@@QBE?AVQContactDetail@2@ABVQString@@@Z @ 1036 NONAME ; class QtMobility::QContactDetail QtMobility::QContact::preferredDetail(class QString const &) const
+	?preferredDetails@QContact@QtMobility@@QBE?AV?$QMap@VQString@@VQContactDetail@QtMobility@@@@XZ @ 1037 NONAME ; class QMap<class QString, class QtMobility::QContactDetail> QtMobility::QContact::preferredDetails(void) const
+	?qHash@QtMobility@@YAIABVQContactActionDescriptor@1@@Z @ 1038 NONAME ; unsigned int QtMobility::qHash(class QtMobility::QContactActionDescriptor const &)
+	?qt_metacall@QContactAction@QtMobility@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1039 NONAME ; int QtMobility::QContactAction::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@QContactActionFactory@QtMobility@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1040 NONAME ; int QtMobility::QContactActionFactory::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacast@QContactAction@QtMobility@@UAEPAXPBD@Z @ 1041 NONAME ; void * QtMobility::QContactAction::qt_metacast(char const *)
+	?qt_metacast@QContactActionFactory@QtMobility@@UAEPAXPBD@Z @ 1042 NONAME ; void * QtMobility::QContactActionFactory::qt_metacast(char const *)
+	?resultsAvailable@QContactAction@QtMobility@@IAEXXZ @ 1043 NONAME ; void QtMobility::QContactAction::resultsAvailable(void)
+	?setActionName@QContactActionDescriptor@QtMobility@@QAEXABVQString@@@Z @ 1044 NONAME ; void QtMobility::QContactActionDescriptor::setActionName(class QString const &)
+	?setActionName@QContactActionFilter@QtMobility@@QAEXABVQString@@@Z @ 1045 NONAME ; void QtMobility::QContactActionFilter::setActionName(class QString const &)
+	?setImplementationVersion@QContactActionDescriptor@QtMobility@@QAEXH@Z @ 1046 NONAME ; void QtMobility::QContactActionDescriptor::setImplementationVersion(int)
+	?setPreferredDetail@QContact@QtMobility@@QAE_NABVQString@@ABVQContactDetail@2@@Z @ 1047 NONAME ; bool QtMobility::QContact::setPreferredDetail(class QString const &, class QtMobility::QContactDetail const &)
+	?setValue@QContactActionFilter@QtMobility@@QAEXABVQVariant@@@Z @ 1048 NONAME ; void QtMobility::QContactActionFilter::setValue(class QVariant const &)
+	?setVendor@QContactActionFilter@QtMobility@@QAEXABVQString@@H@Z @ 1049 NONAME ; void QtMobility::QContactActionFilter::setVendor(class QString const &, int)
+	?setVendorName@QContactActionDescriptor@QtMobility@@QAEXABVQString@@@Z @ 1050 NONAME ; void QtMobility::QContactActionDescriptor::setVendorName(class QString const &)
+	?stateChanged@QContactAction@QtMobility@@IAEXW4State@12@@Z @ 1051 NONAME ; void QtMobility::QContactAction::stateChanged(enum QtMobility::QContactAction::State)
+	?supportedDetails@QContactAction@QtMobility@@UBE?AV?$QList@VQContactDetail@QtMobility@@@@ABVQContact@2@@Z @ 1052 NONAME ; class QList<class QtMobility::QContactDetail> QtMobility::QContactAction::supportedDetails(class QtMobility::QContact const &) const
+	?tr@QContactAction@QtMobility@@SA?AVQString@@PBD0@Z @ 1053 NONAME ; class QString QtMobility::QContactAction::tr(char const *, char const *)
+	?tr@QContactAction@QtMobility@@SA?AVQString@@PBD0H@Z @ 1054 NONAME ; class QString QtMobility::QContactAction::tr(char const *, char const *, int)
+	?tr@QContactActionFactory@QtMobility@@SA?AVQString@@PBD0@Z @ 1055 NONAME ; class QString QtMobility::QContactActionFactory::tr(char const *, char const *)
+	?tr@QContactActionFactory@QtMobility@@SA?AVQString@@PBD0H@Z @ 1056 NONAME ; class QString QtMobility::QContactActionFactory::tr(char const *, char const *, int)
+	?trUtf8@QContactAction@QtMobility@@SA?AVQString@@PBD0@Z @ 1057 NONAME ; class QString QtMobility::QContactAction::trUtf8(char const *, char const *)
+	?trUtf8@QContactAction@QtMobility@@SA?AVQString@@PBD0H@Z @ 1058 NONAME ; class QString QtMobility::QContactAction::trUtf8(char const *, char const *, int)
+	?trUtf8@QContactActionFactory@QtMobility@@SA?AVQString@@PBD0@Z @ 1059 NONAME ; class QString QtMobility::QContactActionFactory::trUtf8(char const *, char const *)
+	?trUtf8@QContactActionFactory@QtMobility@@SA?AVQString@@PBD0H@Z @ 1060 NONAME ; class QString QtMobility::QContactActionFactory::trUtf8(char const *, char const *, int)
+	?validateActionFilter@QContactManagerEngine@QtMobility@@SA_NABVQContactFilter@2@@Z @ 1061 NONAME ; bool QtMobility::QContactManagerEngine::validateActionFilter(class QtMobility::QContactFilter const &)
+	?value@QContactActionFilter@QtMobility@@QBE?AVQVariant@@XZ @ 1062 NONAME ; class QVariant QtMobility::QContactActionFilter::value(void) const
+	?vendorName@QContactActionDescriptor@QtMobility@@QBE?AVQString@@XZ @ 1063 NONAME ; class QString QtMobility::QContactActionDescriptor::vendorName(void) const
+	?vendorName@QContactActionFilter@QtMobility@@QBE?AVQString@@XZ @ 1064 NONAME ; class QString QtMobility::QContactActionFilter::vendorName(void) const
+	?staticMetaObject@QContactActionFactory@QtMobility@@2UQMetaObject@@B @ 1065 NONAME ; struct QMetaObject const QtMobility::QContactActionFactory::staticMetaObject
+	?staticMetaObject@QContactAction@QtMobility@@2UQMetaObject@@B @ 1066 NONAME ; struct QMetaObject const QtMobility::QContactAction::staticMetaObject
 
--- a/qtmobility/src/s60installs/eabi/QtContactsu.def	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/s60installs/eabi/QtContactsu.def	Thu May 27 13:42:11 2010 +0300
@@ -729,4 +729,67 @@
 	_ZTVN10QtMobility35QContactDetailDefinitionSaveRequestE @ 728 NONAME
 	_ZTVN10QtMobility36QContactDetailDefinitionFetchRequestE @ 729 NONAME
 	_ZTVN10QtMobility37QContactDetailDefinitionRemoveRequestE @ 730 NONAME
+	_ZN10QtMobility14QContactAction11qt_metacallEN11QMetaObject4CallEiPPv @ 731 NONAME
+	_ZN10QtMobility14QContactAction11qt_metacastEPKc @ 732 NONAME
+	_ZN10QtMobility14QContactAction12stateChangedENS0_5StateE @ 733 NONAME
+	_ZN10QtMobility14QContactAction16availableActionsERK7QStringi @ 734 NONAME
+	_ZN10QtMobility14QContactAction16resultsAvailableEv @ 735 NONAME
+	_ZN10QtMobility14QContactAction16staticMetaObjectE @ 736 NONAME DATA 16
+	_ZN10QtMobility14QContactAction17actionDescriptorsERK7QStringS3_i @ 737 NONAME
+	_ZN10QtMobility14QContactAction19getStaticMetaObjectEv @ 738 NONAME
+	_ZN10QtMobility14QContactAction6actionERKNS_24QContactActionDescriptorE @ 739 NONAME
+	_ZN10QtMobility14QContactActionD0Ev @ 740 NONAME
+	_ZN10QtMobility14QContactActionD1Ev @ 741 NONAME
+	_ZN10QtMobility14QContactActionD2Ev @ 742 NONAME
+	_ZN10QtMobility20QContactActionFilter13setActionNameERK7QString @ 743 NONAME
+	_ZN10QtMobility20QContactActionFilter8setValueERK8QVariant @ 744 NONAME
+	_ZN10QtMobility20QContactActionFilter9setVendorERK7QStringi @ 745 NONAME
+	_ZN10QtMobility20QContactActionFilterC1ERKNS_14QContactFilterE @ 746 NONAME
+	_ZN10QtMobility20QContactActionFilterC1Ev @ 747 NONAME
+	_ZN10QtMobility20QContactActionFilterC2ERKNS_14QContactFilterE @ 748 NONAME
+	_ZN10QtMobility20QContactActionFilterC2Ev @ 749 NONAME
+	_ZN10QtMobility21QContactActionFactory11qt_metacallEN11QMetaObject4CallEiPPv @ 750 NONAME
+	_ZN10QtMobility21QContactActionFactory11qt_metacastEPKc @ 751 NONAME
+	_ZN10QtMobility21QContactActionFactory16staticMetaObjectE @ 752 NONAME DATA 16
+	_ZN10QtMobility21QContactActionFactory19getStaticMetaObjectEv @ 753 NONAME
+	_ZN10QtMobility21QContactActionFactoryD0Ev @ 754 NONAME
+	_ZN10QtMobility21QContactActionFactoryD1Ev @ 755 NONAME
+	_ZN10QtMobility21QContactActionFactoryD2Ev @ 756 NONAME
+	_ZN10QtMobility21QContactManagerEngine20validateActionFilterERKNS_14QContactFilterE @ 757 NONAME
+	_ZN10QtMobility24QContactActionDescriptor13setActionNameERK7QString @ 758 NONAME
+	_ZN10QtMobility24QContactActionDescriptor13setVendorNameERK7QString @ 759 NONAME
+	_ZN10QtMobility24QContactActionDescriptor24setImplementationVersionEi @ 760 NONAME
+	_ZN10QtMobility24QContactActionDescriptorC1ERK7QStringS3_i @ 761 NONAME
+	_ZN10QtMobility24QContactActionDescriptorC1ERKS0_ @ 762 NONAME
+	_ZN10QtMobility24QContactActionDescriptorC2ERK7QStringS3_i @ 763 NONAME
+	_ZN10QtMobility24QContactActionDescriptorC2ERKS0_ @ 764 NONAME
+	_ZN10QtMobility24QContactActionDescriptorD1Ev @ 765 NONAME
+	_ZN10QtMobility24QContactActionDescriptorD2Ev @ 766 NONAME
+	_ZN10QtMobility24QContactActionDescriptoraSERKS0_ @ 767 NONAME
+	_ZN10QtMobility5qHashERKNS_24QContactActionDescriptorE @ 768 NONAME
+	_ZN10QtMobility8QContact18setPreferredDetailERK7QStringRKNS_14QContactDetailE @ 769 NONAME
+	_ZNK10QtMobility14QContactAction10metaObjectEv @ 770 NONAME
+	_ZNK10QtMobility14QContactAction16supportedDetailsERKNS_8QContactE @ 771 NONAME
+	_ZNK10QtMobility20QContactActionFilter10actionNameEv @ 772 NONAME
+	_ZNK10QtMobility20QContactActionFilter10vendorNameEv @ 773 NONAME
+	_ZNK10QtMobility20QContactActionFilter21implementationVersionEv @ 774 NONAME
+	_ZNK10QtMobility20QContactActionFilter5valueEv @ 775 NONAME
+	_ZNK10QtMobility21QContactActionFactory10metaObjectEv @ 776 NONAME
+	_ZNK10QtMobility24QContactActionDescriptor10actionNameEv @ 777 NONAME
+	_ZNK10QtMobility24QContactActionDescriptor10vendorNameEv @ 778 NONAME
+	_ZNK10QtMobility24QContactActionDescriptor21implementationVersionEv @ 779 NONAME
+	_ZNK10QtMobility24QContactActionDescriptor7isEmptyEv @ 780 NONAME
+	_ZNK10QtMobility24QContactActionDescriptoreqERKS0_ @ 781 NONAME
+	_ZNK10QtMobility24QContactActionDescriptorltERKS0_ @ 782 NONAME
+	_ZNK10QtMobility24QContactActionDescriptorneERKS0_ @ 783 NONAME
+	_ZNK10QtMobility8QContact15preferredDetailERK7QString @ 784 NONAME
+	_ZNK10QtMobility8QContact16availableActionsERK7QStringi @ 785 NONAME
+	_ZNK10QtMobility8QContact16detailWithActionEPNS_14QContactActionE @ 786 NONAME
+	_ZNK10QtMobility8QContact16preferredDetailsEv @ 787 NONAME
+	_ZNK10QtMobility8QContact17detailsWithActionEPNS_14QContactActionE @ 788 NONAME
+	_ZNK10QtMobility8QContact17isPreferredDetailERK7QStringRKNS_14QContactDetailE @ 789 NONAME
+	_ZTIN10QtMobility14QContactActionE @ 790 NONAME ; #<TI>#
+	_ZTIN10QtMobility21QContactActionFactoryE @ 791 NONAME ; #<TI>#
+	_ZTVN10QtMobility14QContactActionE @ 792 NONAME ; #<VT>#
+	_ZTVN10QtMobility21QContactActionFactoryE @ 793 NONAME ; #<VT>#
 
--- a/qtmobility/src/s60installs/qtmobility.iby	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/s60installs/qtmobility.iby	Thu May 27 13:42:11 2010 +0300
@@ -36,24 +36,19 @@
 file=ABI_DIR\BUILD_DIR\qsfwdatabasemanagerserver.exe                                     PROGRAMS_DIR\qsfwdatabasemanagerserver.exe PAGED
 file=ABI_DIR\BUILD_DIR\qtsysteminfo.dll                                                  SHARED_LIB_DIR\qtsysteminfo.dll PAGED
 file=ABI_DIR\BUILD_DIR\qtmessaging.dll                                                   SHARED_LIB_DIR\qtmessaging.dll PAGED
-
-/*
-file=ABI_DIR\BUILD_DIR\qtmedia.dll                                                       SHARED_LIB_DIR\qtmedia.dll PAGED
+//file=ABI_DIR\BUILD_DIR\qtmedia.dll                                                       SHARED_LIB_DIR\qtmedia.dll PAGED
 file=ABI_DIR\BUILD_DIR\qtsensors.dll                                                     SHARED_LIB_DIR\qtsensors.dll PAGED
-*/
 
 //Plugins
-/*
-file=ABI_DIR\BUILD_DIR\qtmedia_m3u.dll                                                   SHARED_LIB_DIR\qtmedia_m3u.dll PAGED
-data=\epoc32\data\z\resource\qt\plugins\playlistformats\qtmedia_m3u.qtplugin             resource\qt\plugins\playlistformats\qtmedia_m3u.qtplugin
-file=ABI_DIR\BUILD_DIR\qtmedia_xarecordservice.dll                                       SHARED_LIB_DIR\qtmedia_xarecordservice.dll PAGED
-data=\epoc32\data\z\resource\qt\plugins\mediaservice\qtmedia_xarecordservice.qtplugin    resource\qt\plugins\mediaservice\qtmedia_xarecordservice.qtplugin
-file=ABI_DIR\BUILD_DIR\qtmedia_mmfengine.dll                                             SHARED_LIB_DIR\qtmedia_mmfengine.dll PAGED
-data=\epoc32\data\z\resource\qt\plugins\mediaservice\qtmedia_mmfengine.qtplugin          resource\qt\plugins\mediaservice\qtmedia_mmfengine.qtplugin
+//file=ABI_DIR\BUILD_DIR\qtmedia_m3u.dll                                                   SHARED_LIB_DIR\qtmedia_m3u.dll PAGED
+//data=\epoc32\data\z\resource\qt\plugins\playlistformats\qtmedia_m3u.qtplugin             resource\qt\plugins\playlistformats\qtmedia_m3u.qtplugin
+//file=ABI_DIR\BUILD_DIR\qtmedia_xarecordservice.dll                                       SHARED_LIB_DIR\qtmedia_xarecordservice.dll PAGED
+//data=\epoc32\data\z\resource\qt\plugins\mediaservice\qtmedia_xarecordservice.qtplugin    resource\qt\plugins\mediaservice\qtmedia_xarecordservice.qtplugin
+//file=ABI_DIR\BUILD_DIR\qtmedia_mmfengine.dll                                             SHARED_LIB_DIR\qtmedia_mmfengine.dll PAGED
+//data=\epoc32\data\z\resource\qt\plugins\mediaservice\qtmedia_mmfengine.qtplugin          resource\qt\plugins\mediaservice\qtmedia_mmfengine.qtplugin
 file=ABI_DIR\BUILD_DIR\qtsensors_generic.dll                                             SHARED_LIB_DIR\qtsensors_generic.dll PAGED
 data=\epoc32\data\z\resource\qt\plugins\sensors\qtsensors_generic.qtplugin               resource\qt\plugins\sensors\qtsensors_generic.qtplugin
 file=ABI_DIR\BUILD_DIR\qtsensors_sym.dll                                                 SHARED_LIB_DIR\qtsensors_sym.dll PAGED
 data=\epoc32\data\z\resource\qt\plugins\sensors\qtsensors_sym.qtplugin                   resource\qt\plugins\sensors\qtsensors_sym.qtplugin
-*/
 
 #endif // __QT_MOBILITY_IBY__
--- a/qtmobility/src/s60installs/qtmobility_stub.pkg	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/s60installs/qtmobility_stub.pkg	Thu May 27 13:42:11 2010 +0300
@@ -3,7 +3,7 @@
 &EN
 
 ; SIS header: name, uid, version
-#{"QtMobility"},(0x2002AC89),1,0,0,TYPE=SA
+#{"QtMobility"},(0x2002AC89),1,0,1,TYPE=SA
 
 ; Localised Vendor name
 %{"Nokia"}
Binary file qtmobility/src/s60installs/qtmobility_stub.sis has changed
--- a/qtmobility/src/s60installs/s60installs.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/s60installs/s60installs.pro	Thu May 27 13:42:11 2010 +0300
@@ -8,11 +8,8 @@
     SUBDIRS =
     TARGET = "QtMobility"
     TARGET.UID3 = 0x2002AC89
-    # TP preview 0.1.0
-    # Beta 0.2.0
-    # Final 1.0.0
 
-    VERSION = 1.0.0
+    VERSION = 1.0.1
 
     vendorinfo = \
         "; Localised Vendor name" \
--- a/qtmobility/src/sensors/make_sensor.pl	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/make_sensor.pl	Thu May 27 13:42:11 2010 +0300
@@ -181,7 +181,6 @@
     \class '.$reading.'
     \ingroup sensors_reading
 
-    \preliminary
     \brief The '.$reading.' class holds readings from the [X] sensor.
 
     [Fill this out]
@@ -218,7 +217,6 @@
     \class '.$filter.'
     \ingroup sensors_filter
 
-    \preliminary
     \brief The '.$filter.' class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to '.$reading.'
@@ -239,7 +237,6 @@
     \class '.$sensor.'
     \ingroup sensors_type
 
-    \preliminary
     \brief The '.$sensor.' class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qaccelerometer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qaccelerometer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
     \class QAccelerometerReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QAccelerometerReading class reports on linear acceleration
            along the X, Y and Z axes.
 
@@ -58,29 +57,11 @@
     The scale of the values is meters per second squared.
     The axes are arranged as follows.
 
-\code
-             +z
-              |
-              |      +y
-              |     /
-              |----/----
-             /| NOKIA  /|
-            //|--/--- / |
-           // | /   //  /
-          //  |/   //  /
-         //   '--------------- +x
-        //       //  /
-       //       //  /
-      /---------/  /
-     /    O    /  /
-    /         /  /
-    ----------  /
-    |_________!/
-\endcode
+    \image sensors-coordinates2.jpg
 
     A monoblock device sitting at rest, face up on a desk will experience
     a force of approximately 9.8 on the Z axis (ie. towards the roof).
-    This is the proper acceleration the device experiences relative to 
+    This is the proper acceleration the device experiences relative to
     freefall.
 */
 
@@ -153,7 +134,6 @@
     \class QAccelerometerFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QAccelerometerFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QAccelerometerReading
@@ -174,7 +154,6 @@
     \class QAccelerometer
     \ingroup sensors_type
 
-    \preliminary
     \brief The QAccelerometer class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qambientlightsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qambientlightsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
     \class QAmbientLightReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QAmbientLightReading class represents one reading from the
            ambient light sensor.
 
@@ -100,7 +99,6 @@
     \class QAmbientLightFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QAmbientLightFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QAmbientLightReading
@@ -121,7 +119,6 @@
     \class QAmbientLightSensor
     \ingroup sensors_type
 
-    \preliminary
     \brief The QAmbientLightSensor class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qcompass.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qcompass.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
     \class QCompassReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QCompassReading class represents one reading from a
            compass.
 
@@ -120,7 +119,6 @@
     \class QCompassFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QCompassFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QCompassReading
@@ -141,7 +139,6 @@
     \class QCompass
     \ingroup sensors_type
 
-    \preliminary
     \brief The QCompass class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qmagnetometer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qmagnetometer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
     \class QMagnetometerReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QMagnetometerReading class represents one reading from the
            magnetometer.
 
@@ -58,25 +57,7 @@
     The magnetometer returns magnetic flux density values along 3 axes.
     The scale of the values is teslas. The axes are arranged as follows.
 
-\code
-             +z
-              |
-              |      +y
-              |     /
-              |----/----
-             /| NOKIA  /|
-            //|--/--- / |
-           // | /   //  /
-          //  |/   //  /
-         //   '--------------- +x
-        //       //  /
-       //       //  /
-      /---------/  /
-     /    O    /  /
-    /         /  /
-    ----------  /
-    |_________!/
-\endcode
+    \image sensors-coordinates2.jpg
 
     The magnetometer can report on either raw magnetic flux values or geomagnetic flux values.
     By default it returns raw magnetic flux values. The QMagnetometer::returnGeoValues property
@@ -87,6 +68,11 @@
     represent only the effect of the Earth's magnetic field. This process is not perfect
     and the accuracy of each reading may change.
 
+    The image below shows the difference between geomagnetic (on the left) and raw (on the right)
+    readings for a phone that is being subjected to magnetic interference.
+
+    \image sensors-geo-vs-raw-magnetism.jpg
+
     The accuracy of each reading is measured as a number from 0 to 1.
     A value of 1 is the highest level that the device can support and 0 is
     the worst.
@@ -185,7 +171,6 @@
     \class QMagnetometerFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QMagnetometerFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QMagnetometerReading
@@ -206,7 +191,6 @@
     \class QMagnetometer
     \ingroup sensors_type
 
-    \preliminary
     \brief The QMagnetometer class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qorientationsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qorientationsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
     \class QOrientationReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QOrientationReading class represents one reading from the
            orientation sensor.
 
@@ -67,31 +66,15 @@
 
     To explain the meaning of each value it is helpful to refer to the following diagram.
 
-\code
-                      Top
-
+    \image sensors-sides.jpg
 
-              ----------
-             /  NOKIA  /|
-            /-------- / |
-           //       //  /
-          //       //  /
-  Left   //  Face //  /    Right
-        //       //  /
-       //       //  /
-      /---------/  /
-     /    O    /  /
-    /         /  /
-    ----------  /
-    |_________!/
+    The orientations are shown here in order: TopUp, TopDown, LeftUp, RightUp, FaceUp, FaceDown.
 
-
-      Bottom
-\endcode
+    \image sensors-orientation.jpg
 
     \value Undefined        The orientation is unknown.
     \value TopUp            The Top edge of the device is pointing up.
-    \value TopDown          The Bottom edge of the device is pointing up.
+    \value TopDown          The Top edge of the device is pointing down.
     \value LeftUp           The Left edge of the device is pointing up.
     \value RightUp          The Right edge of the device is pointing up.
     \value FaceUp           The Face of the device is pointing up.
@@ -125,7 +108,6 @@
     \class QOrientationFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QOrientationFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QOrientationReading
@@ -146,7 +128,6 @@
     \class QOrientationSensor
     \ingroup sensors_type
 
-    \preliminary
     \brief The QOrientationSensor class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qproximitysensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qproximitysensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
     \class QProximityReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QProximityReading class represents one reading from the
            proximity sensor.
 
@@ -90,7 +89,6 @@
     \class QProximityFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QProximityFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QProximityReading
@@ -111,7 +109,6 @@
     \class QProximitySensor
     \ingroup sensors_type
 
-    \preliminary
     \brief The QProximitySensor class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qrotationsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qrotationsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,43 +50,51 @@
     \class QRotationReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QRotationReading class represents one reading from the
            rotation sensor.
 
     \section2 QRotationReading Units
 
     The rotation reading contains 3 angles, measured in degrees that define
-    the orientation of the device in three-dimensional space. The rotations
-    should not be confused with relative rotations such as yaw and pitch.
-    These rotations are of the devices axes relative to the external
-    reference points that define the reference co-ordinate axes: X, Y and Z
-    in the diagram.
-    
+    the orientation of the device in three-dimensional space. These angles
+    are similar to yaw, pitch and roll but are defined using only right hand
+    rotation with axes as defined by the right hand cartesian coordinate system.
+
+    \image sensors-rotation.jpg
+
     The three angles are applied to the device in the following order.
 
     \list
-    \o Right-handed rotation z (-180, 180]. Starting from the x-axis and
-     incrementing in the direction of the y-axis.
+    \o Right-handed rotation z (-180, 180]. Starting from the y-axis and
+     incrementing in the counter-clockwise direction.
     \o Right-handed rotation x [-90, 90]. Starting from the new
      (once-rotated) y-axis and incrementing towards the z-axis.
     \o Right-handed rotation y (-180, 180]. Starting from the new
      (twice-rotated) z-axis and incrementing towards the x-axis.
     \endlist
 
-    \image Rotation_angles.png Visual representation of the rotation angles.
+    Here is a visualisation showing the order in which angles are applied.
+
+    \image sensors-rotation-anim.gif
 
     The 0 point for the z angle is defined as a fixed, external entity and
     is device-specific. While magnetic North is typically used as this
     reference point it may not be. Do not attempt to compare values
     for the z angle between devices or even on the same device if it has
     moved a significant distance.
-    
+
     If the device cannot detect a fixed, external entity the z angle will
     always be 0 and the QRotationSensor::hasZ property will be set to false.
 
     The 0 point for the x and y angles are defined as when the x and y axes
-    of the device are oriented towards the horizon.
+    of the device are oriented towards the horizon. Here is an example of
+    how the x value will change with device movement.
+
+    \image sensors-rotation2.jpg
+
+    Here is an example of how the y value will change with device movement.
+
+    \image sensors-rotation3.jpg
 
     Note that when x is 90 or -90, values for z and y achieve rotation around
     the same axis (due to the order of operations). In this case the y
@@ -162,7 +170,6 @@
     \class QRotationFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QRotationFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QRotationReading
@@ -183,7 +190,6 @@
     \class QRotationSensor
     \ingroup sensors_type
 
-    \preliminary
     \brief The QRotationSensor class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/qsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -73,7 +73,6 @@
     \class QSensor
     \ingroup sensors_main
 
-    \preliminary
     \brief The QSensor class represents a single hardware sensor.
 
     The life cycle of a sensor is typically:
@@ -231,6 +230,8 @@
     \brief the data rates that the sensor supports.
 
     This is a list of the data rates that the sensor supports.
+    Measured in Hertz.
+
     Entries in the list can represent discrete rates or a
     continuous range of rates.
     A discrete rate is noted by having both values the same.
@@ -250,6 +251,8 @@
     \property QSensor::dataRate
     \brief the data rate that the sensor should be run at.
 
+    Measured in Hertz.
+
     The default value is determined by the backend.
 
     This should be set before calling start() because the sensor may not
@@ -451,7 +454,6 @@
     \class QSensorFilter
     \ingroup sensors_main
 
-    \preliminary
     \brief The QSensorFilter class provides an efficient
            callback facility for asynchronous notifications of
            sensor changes.
@@ -516,7 +518,6 @@
     \class QSensorReading
     \ingroup sensors_main
 
-    \preliminary
     \brief The QSensorReading class holds the readings from the sensor.
 
     Note that QSensorReading is not particularly useful by itself. The interesting
--- a/qtmobility/src/sensors/qsensorbackend.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qsensorbackend.cpp	Thu May 27 13:42:11 2010 +0300
@@ -49,7 +49,6 @@
     \class QSensorBackend
     \ingroup sensors_backend
 
-    \preliminary
     \brief The QSensorBackend class is a sensor implementation.
 
     Sensors on a device will be represented by sub-classes of
--- a/qtmobility/src/sensors/qsensormanager.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qsensormanager.cpp	Thu May 27 13:42:11 2010 +0300
@@ -97,7 +97,6 @@
     \class QSensorManager
     \ingroup sensors_backend
 
-    \preliminary
     \brief The QSensorManager class handles registration and creation of sensor backends.
 
     Sensor plugins register backends using the registerBackend() function.
@@ -263,7 +262,6 @@
     \class QSensorBackendFactory
     \ingroup sensors_backend
 
-    \preliminary
     \brief The QSensorBackendFactory class instantiates instances of
            QSensorBackend.
 
--- a/qtmobility/src/sensors/qsensorpluginloader.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qsensorpluginloader.cpp	Thu May 27 13:42:11 2010 +0300
@@ -39,13 +39,13 @@
 **
 ****************************************************************************/
 
-#include <src/global/qbuildcfg.h>
 #include "qsensorpluginloader_p.h"
 #include <QtCore/qcoreapplication.h>
 #include <QtCore/qdir.h>
 #include <QtCore/qdebug.h>
 
 #include "qsensorplugin.h"
+#include "qmobilitypluginsearch.h"
 
 QTM_BEGIN_NAMESPACE
 
@@ -70,42 +70,31 @@
     if (!m_plugins.isEmpty())
         return;
 
-    QStringList     paths = QCoreApplication::libraryPaths();
-    QString val = QLatin1String(qt_mobility_configure_prefix_path_str);
-    if(val.length() > 0){
-        val += QLatin1String("/plugins");
-        paths << val;
-    }
+    QStringList plugins;
+    plugins = mobilityPlugins(QLatin1String("sensors"));
 
-    Q_FOREACH (QString const &path, paths) {
-        QString pluginPathName(path + m_location);
-        QDir pluginDir(pluginPathName);
-
-        if (!pluginDir.exists())
-            continue;
-
-        Q_FOREACH (QString pluginLib, pluginDir.entryList(QDir::Files)) {
-            QPluginLoader *loader = new QPluginLoader(pluginPathName + pluginLib);
+    /* Now discover the dynamic plugins */
+    for (int i=0; i < plugins.count(); i++) {
+        QPluginLoader *loader = new QPluginLoader(plugins.at(i));
 
-            QObject *o = loader->instance();
-            if (o != 0 && o->qt_metacast(m_iid) != 0) {
-                QSensorPluginInterface *p = qobject_cast<QSensorPluginInterface*>(o);
-                if (p != 0) {
-                    m_plugins << p;
-                    m_loaders << loader;
-                } else {
-                    loader->unload();
-                    delete loader;
-                }
+        QObject *o = loader->instance();
+        if (o != 0 && o->qt_metacast(m_iid) != 0) {
+            QSensorPluginInterface *p = qobject_cast<QSensorPluginInterface*>(o);
+            if (p != 0) {
+                m_plugins << p;
+                m_loaders << loader;
+            } else {
+                loader->unload();
+                delete loader;
+            }
 
-                continue;
-            } else {
-                qWarning() << "QSensorPluginLoader: Failed to load plugin: " << pluginLib << loader->errorString();
-            }
-            delete o;
-            loader->unload();
-            delete loader;
+            continue;
+        } else {
+            qWarning() << "QSensorPluginLoader: Failed to load plugin: " << plugins.at(i) << loader->errorString();
         }
+        delete o;
+        loader->unload();
+        delete loader;
     }
 }
 
--- a/qtmobility/src/sensors/qtapsensor.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/qtapsensor.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,32 +50,14 @@
     \class QTapReading
     \ingroup sensors_reading
 
-    \preliminary
     \brief The QTapReading class represents one reading from the
            tap sensor.
 
     \section2 QTapReading Units
     The tap sensor registers tap events in one of the six directions.
     There are 3 axes that originate from the phone. They are arranged as follows.
-\code
-             +z
-              |
-              |      +y
-              |     /
-              |----/----
-             /| NOKIA  /|
-            //|--/--- / |
-           // | /   //  /
-          //  |/   //  /
-         //   '--------------- +x
-        //       //  /
-       //       //  /
-      /---------/  /
-     /    O    /  /
-    /         /  /
-    ----------  /
-    |_________!/
-\endcode
+
+    \image sensors-coordinates2.jpg
 
     By default it returns double tap events. The QTapSensor::returnDoubleTapEvents property
     must be set to false to return individual tap events.
@@ -149,7 +131,6 @@
     \class QTapFilter
     \ingroup sensors_filter
 
-    \preliminary
     \brief The QTapFilter class is a convenience wrapper around QSensorFilter.
 
     The only difference is that the filter() method features a pointer to QTapReading
@@ -170,7 +151,6 @@
     \class QTapSensor
     \ingroup sensors_type
 
-    \preliminary
     \brief The QTapSensor class is a convenience wrapper around QSensor.
 
     The only behavioural difference is that this class sets the type properly.
--- a/qtmobility/src/sensors/sensors.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/sensors/sensors.pro	Thu May 27 13:42:11 2010 +0300
@@ -13,6 +13,7 @@
     SENSORS_DEPLOYMENT.sources = QtSensors.dll
     SENSORS_DEPLOYMENT.path = \sys\bin
     DEPLOYMENT += SENSORS_DEPLOYMENT
+    LIBS += -lefsrv
 }
 
 CONFIG += strict_flags
--- a/qtmobility/src/serviceframework/servicedatabase.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/serviceframework/servicedatabase.cpp	Thu May 27 13:42:11 2010 +0300
@@ -1676,10 +1676,8 @@
 #elif defined(Q_OS_SYMBIAN)
         QString qtVersion(qVersion());
         qtVersion = qtVersion.left(qtVersion.size() -2); //strip off patch version
-        path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() +
-                                        "\\Nokia\\" + "QtServiceFramework_" +
-                                        qtVersion + "_system" +
-                                        QLatin1String(".db"));
+        path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "QtServiceFramework_" +
+                                        qtVersion + "_system" + QLatin1String(".db"));
 #else
         QSettings settings(QSettings::SystemScope, "Nokia", "Services");
         path = settings.value("ServicesDB/Path").toString();
--- a/qtmobility/src/systeminfo/gconfitem.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/gconfitem.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,7 +45,7 @@
 #include <QVariant>
 #include <QtDebug>
 
-#include "gconfitem.h"
+#include "gconfitem_p.h"
 
 #include <glib.h>
 #include <gconf/gconf-value.h>
--- a/qtmobility/src/systeminfo/gconfitem.h	Fri May 14 16:41:33 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef GCONFITEM_H
-#define GCONFITEM_H
-
-#include <QVariant>
-#include <QStringList>
-#include <QObject>
-
-/*!
-
-  \brief GConfItem is a simple C++ wrapper for GConf.
-
-  Creating a GConfItem instance gives you access to a single GConf
-  key.  You can get and set its value, and connect to its
-  valueChanged() signal to be notified about changes.
-
-  The value of a GConf key is returned to you as a QVariant, and you
-  pass in a QVariant when setting the value.  GConfItem converts
-  between a QVariant and GConf values as needed, and according to the
-  following rules:
-
-  - A QVariant of type QVariant::Invalid denotes an unset GConf key.
-
-  - QVariant::Int, QVariant::Double, QVariant::Bool are converted to
-    and from the obvious equivalents.
-
-  - QVariant::String is converted to/from a GConf string and always
-    uses the UTF-8 encoding.  No other encoding is supported.
-
-  - QVariant::StringList is converted to a list of UTF-8 strings.
-
-  - QVariant::List (which denotes a QList<QVariant>) is converted
-    to/from a GConf list.  All elements of such a list must have the
-    same type, and that type must be one of QVariant::Int,
-    QVariant::Double, QVariant::Bool, or QVariant::String.  (A list of
-    strings is returned as a QVariant::StringList, however, when you
-    get it back.)
-
-  - Any other QVariant or GConf value is essentially ignored.
-
-  \warning GConfItem is as thread-safe as GConf.
-
-*/
-
-class GConfItem : public QObject
-{
-    Q_OBJECT
-
- public:
-    /*! Initializes a GConfItem to access the GConf key denoted by
-        \a key.  Key names should follow the normal GConf conventions
-        like "/myapp/settings/first".
-
-        \param key    The name of the key.
-        \param parent Parent object
-    */
-    explicit GConfItem(const QString &key, QObject *parent = 0);
-
-    /*! Finalizes a GConfItem.
-     */
-    virtual ~GConfItem();
-
-    /*! Returns the key of this item, as given to the constructor.
-     */
-    QString key() const;
-
-    /*! Returns the current value of this item, as a QVariant.
-     */
-    QVariant value() const;
-
-    /*! Returns the current value of this item, as a QVariant.  If
-     *  there is no value for this item, return \a def instead.
-     */
-    QVariant value(const QVariant &def) const;
-
-    /*! Set the value of this item to \a val.  If \a val can not be
-        represented in GConf or GConf refuses to accept it for other
-        reasons, the current value is not changed and nothing happens.
-
-        When the new value is different from the old value, the
-        changedValue() signal is emitted on this GConfItem as part
-        of calling set(), but other GConfItem:s for the same key do
-        only receive a notification once the main loop runs.
-
-        \param val  The new value.
-    */
-    void set(const QVariant &val);
-
-    /*! Unset this item.  This is equivalent to
-
-        \code
-        item.set(QVariant(QVariant::Invalid));
-        \endcode
-     */
-    void unset();
-
-    /*! Return a list of the directories below this item.  The
-        returned strings are absolute key names like
-        "/myapp/settings".
-
-        A directory is a key that has children.  The same key might
-        also have a value, but that is confusing and best avoided.
-    */
-    QList<QString> listDirs() const;
-
-    /*! Return a list of entries below this item.  The returned
-        strings are absolute key names like "/myapp/settings/first".
-
-        A entry is a key that has a value.  The same key might also
-        have children, but that is confusing and is best avoided.
-    */
-    QList<QString> listEntries() const;
-
- signals:
-    /*! Emitted when the value of this item has changed.
-     */
-    void valueChanged();
-
- private:
-    friend struct GConfItemPrivate;
-    struct GConfItemPrivate *priv;
-
-    void update_value(bool emit_signal);
-};
-
-#endif // GCONFITEM_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/src/systeminfo/gconfitem_p.h	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,166 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Mobility Components.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef GCONFITEM_H
+#define GCONFITEM_H
+
+#include <QVariant>
+#include <QStringList>
+#include <QObject>
+
+/*!
+
+  \brief GConfItem is a simple C++ wrapper for GConf.
+
+  Creating a GConfItem instance gives you access to a single GConf
+  key.  You can get and set its value, and connect to its
+  valueChanged() signal to be notified about changes.
+
+  The value of a GConf key is returned to you as a QVariant, and you
+  pass in a QVariant when setting the value.  GConfItem converts
+  between a QVariant and GConf values as needed, and according to the
+  following rules:
+
+  - A QVariant of type QVariant::Invalid denotes an unset GConf key.
+
+  - QVariant::Int, QVariant::Double, QVariant::Bool are converted to
+    and from the obvious equivalents.
+
+  - QVariant::String is converted to/from a GConf string and always
+    uses the UTF-8 encoding.  No other encoding is supported.
+
+  - QVariant::StringList is converted to a list of UTF-8 strings.
+
+  - QVariant::List (which denotes a QList<QVariant>) is converted
+    to/from a GConf list.  All elements of such a list must have the
+    same type, and that type must be one of QVariant::Int,
+    QVariant::Double, QVariant::Bool, or QVariant::String.  (A list of
+    strings is returned as a QVariant::StringList, however, when you
+    get it back.)
+
+  - Any other QVariant or GConf value is essentially ignored.
+
+  \warning GConfItem is as thread-safe as GConf.
+
+*/
+
+class GConfItem : public QObject
+{
+    Q_OBJECT
+
+ public:
+    /*! Initializes a GConfItem to access the GConf key denoted by
+        \a key.  Key names should follow the normal GConf conventions
+        like "/myapp/settings/first".
+
+        \param key    The name of the key.
+        \param parent Parent object
+    */
+    explicit GConfItem(const QString &key, QObject *parent = 0);
+
+    /*! Finalizes a GConfItem.
+     */
+    virtual ~GConfItem();
+
+    /*! Returns the key of this item, as given to the constructor.
+     */
+    QString key() const;
+
+    /*! Returns the current value of this item, as a QVariant.
+     */
+    QVariant value() const;
+
+    /*! Returns the current value of this item, as a QVariant.  If
+     *  there is no value for this item, return \a def instead.
+     */
+    QVariant value(const QVariant &def) const;
+
+    /*! Set the value of this item to \a val.  If \a val can not be
+        represented in GConf or GConf refuses to accept it for other
+        reasons, the current value is not changed and nothing happens.
+
+        When the new value is different from the old value, the
+        changedValue() signal is emitted on this GConfItem as part
+        of calling set(), but other GConfItem:s for the same key do
+        only receive a notification once the main loop runs.
+
+        \param val  The new value.
+    */
+    void set(const QVariant &val);
+
+    /*! Unset this item.  This is equivalent to
+
+        \code
+        item.set(QVariant(QVariant::Invalid));
+        \endcode
+     */
+    void unset();
+
+    /*! Return a list of the directories below this item.  The
+        returned strings are absolute key names like
+        "/myapp/settings".
+
+        A directory is a key that has children.  The same key might
+        also have a value, but that is confusing and best avoided.
+    */
+    QList<QString> listDirs() const;
+
+    /*! Return a list of entries below this item.  The returned
+        strings are absolute key names like "/myapp/settings/first".
+
+        A entry is a key that has a value.  The same key might also
+        have children, but that is confusing and is best avoided.
+    */
+    QList<QString> listEntries() const;
+
+ signals:
+    /*! Emitted when the value of this item has changed.
+     */
+    void valueChanged();
+
+ private:
+    friend struct GConfItemPrivate;
+    struct GConfItemPrivate *priv;
+
+    void update_value(bool emit_signal);
+};
+
+#endif // GCONFITEM_H
--- a/qtmobility/src/systeminfo/qsysteminfo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/qsysteminfo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -539,7 +539,7 @@
   \property QSystemNetworkInfo::homeMobileCountryCode
   \brief The home MNC.
 
-    Returns the home Mobile Network Code. In the case of none such as a Desktop, an empty string.
+    Returns the home Mobile Country Code. In the case of none such as a Desktop, an empty string.
 */
 QString QSystemNetworkInfo::homeMobileCountryCode()
 {
@@ -550,7 +550,9 @@
   \property QSystemNetworkInfo::homeMobileNetworkCode
   \brief The home MCC.
 
-    Returns the home Mobile Country Code. In the case of none such as a Desktop, an empty string.
+    Returns the home Mobile Network Code. In the case of none such as a Desktop, an empty string.
+    Note: Some platforms don't support retrieving this info. In this case the Network Code is
+    returned only when the device is registered on home network.
 */
 QString QSystemNetworkInfo::homeMobileNetworkCode()
 {
--- a/qtmobility/src/systeminfo/qsysteminfo_linux_common.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/qsysteminfo_linux_common.cpp	Thu May 27 13:42:11 2010 +0300
@@ -113,7 +113,6 @@
         }
     }
 #endif
-  //  qDebug() << "Hal is not running";
     return false;
 }
 
@@ -357,7 +356,7 @@
             const QString versionPath = QLatin1String("/proc/version");
             QFile versionFile(versionPath);
             if(!versionFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                qWarning() << "File not opened";
+                qDebug() << "File not opened";
             } else {
                 QString  strvalue;
                 strvalue = QLatin1String(versionFile.readAll().trimmed());
@@ -507,7 +506,7 @@
                     netname = ssid;
                 }
             } else {
-                qWarning() << "no socket";
+                qDebug() << "no socket";
             }
             close(sock);
         }
@@ -605,7 +604,7 @@
 {
     int ctl = socket(PF_BLUETOOTH,SOCK_RAW,BTPROTO_BNEP);
     if (ctl < 0) {
-        qWarning() << "Cannot open bnep socket";
+        qDebug() << "Cannot open bnep socket";
         return QSystemNetworkInfo::UndefinedStatus;
     }
 
@@ -616,7 +615,7 @@
     req.cnum = 36;
 
     if (ioctl(ctl,BNEPGETCONNLIST,&req) < 0) {
-        qWarning() << "Cannot get bnep connection list.";
+        qDebug() << "Cannot get bnep connection list.";
         return QSystemNetworkInfo::UndefinedStatus;
     }
     for (uint j = 0; j< req.cnum; j++) {
@@ -917,7 +916,7 @@
             float curLevel = 0.0;
             QFile curBrightnessFile(backlightPath+brightnessFileName+"/LCD/brightness");
             if(!curBrightnessFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                qWarning()<<"File not opened";
+                qDebug()<<"File not opened";
             } else {
                 const QString strvalue = curBrightnessFile.readAll().trimmed();
                 if(strvalue.contains("levels")) {
@@ -947,7 +946,7 @@
         float curLevel = 0.0;
         QFile curBrightnessFile(backlightPath+brightnessFileName+"/brightness");
         if(!curBrightnessFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-            qWarning()<<"File not opened";
+            qDebug()<<"File not opened";
         } else {
             QString strvalue;
             strvalue = curBrightnessFile.readLine().trimmed();
@@ -956,7 +955,7 @@
 
             QFile maxBrightnessFile(backlightPath+brightnessFileName+"/max_brightness");
             if(!maxBrightnessFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-                qWarning()<<"File not opened";
+                qDebug()<<"File not opened";
             } else {
                 QString strvalue;
                 strvalue = maxBrightnessFile.readLine().trimmed();
@@ -1061,7 +1060,7 @@
 
         QFile file(dmFile);
         if (!file.open(QIODevice::ReadOnly)) {
-            qWarning() << "Could not open sys file";
+            qDebug() << "Could not open sys file";
         } else {
             QTextStream sysinfo(&file);
             QString line = sysinfo.readAll();
@@ -1155,7 +1154,7 @@
                         if(halIfaceDevice->setConnections() ) {
                             if(!connect(halIfaceDevice,SIGNAL(propertyModified(int, QVariantList)),
                                         this,SLOT(halChanged(int,QVariantList)))) {
-                                qWarning() << "connection malfunction";
+                                qDebug() << "connection malfunction";
                             }
                         }
                         break;
@@ -1172,7 +1171,7 @@
                     if(halIfaceDevice->setConnections() ) {
                         if(!connect(halIfaceDevice,SIGNAL(propertyModified(int, QVariantList)),
                                     this,SLOT(halChanged(int,QVariantList)))) {
-                            qWarning() << "connection malfunction";
+                            qDebug() << "connection malfunction";
                         }
                     }
                     break;
@@ -1188,7 +1187,7 @@
                     if(halIfaceDevice->setConnections()) {
                         if(!connect(halIfaceDevice,SIGNAL(propertyModified(int, QVariantList)),
                                     this,SLOT(halChanged(int,QVariantList)))) {
-                            qWarning() << "connection malfunction";
+                            qDebug() << "connection malfunction";
                         }
                     }
                     break;
@@ -1251,10 +1250,9 @@
         QTextStream cpuinfo(&vendorId);
         return cpuinfo.readLine().trimmed();
     } else {
-        //        qWarning() << "Could not open /sys/devices/virtual/dmi/id/board_vendor";
         QFile file("/proc/cpuinfo");
         if (!file.open(QIODevice::ReadOnly)) {
-            qWarning() << "Could not open /proc/cpuinfo";
+            qDebug() << "Could not open /proc/cpuinfo";
         } else {
             QTextStream cpuinfo(&file);
             QString line = cpuinfo.readLine();
@@ -1287,7 +1285,7 @@
     }
     QFile file("/proc/cpuinfo");
     if (!file.open(QIODevice::ReadOnly)) {
-        qWarning() << "Could not open /proc/cpuinfo";
+        qDebug() << "Could not open /proc/cpuinfo";
     } else {
         QTextStream cpuinfo(&file);
         QString line = cpuinfo.readLine();
@@ -1347,7 +1345,7 @@
 
     QFile file("/etc/issue");
     if (!file.open(QIODevice::ReadOnly)) {
-        qWarning() << "Could not open /proc/cpuinfo";
+        qDebug() << "Could not open /proc/cpuinfo";
     } else {
         QTextStream prodinfo(&file);
         QString line = prodinfo.readLine();
@@ -1374,10 +1372,10 @@
         QHalInterface iface2;
         if (iface2.isValid()) {
             QStringList capList;
-            capList << QLatin1String("input.keyboard") 
+            capList << QLatin1String("input.keyboard")
                     << QLatin1String("input.keys")
-                    << QLatin1String("input.keypad") 
-                    << QLatin1String("input.mouse") 
+                    << QLatin1String("input.keypad")
+                    << QLatin1String("input.mouse")
                     << QLatin1String("input.tablet")
                     << QLatin1String("input.touchpad");
             for(int i = 0; i < capList.count(); i++) {
@@ -1418,7 +1416,7 @@
     foreach(const QString inputFileName, inputList) {
         QFile file(inputsPath+inputFileName+"/device/name");
         if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
-            qWarning()<<"File not opened";
+            qDebug()<<"File not opened";
         } else {
             QString strvalue;
             strvalue = file.readLine();
@@ -1461,12 +1459,9 @@
             foreach(const QString dev, list) {
                 QHalDeviceInterface ifaceDevice(dev);
                 if (ifaceDevice.isValid()) {
-//                    qWarning() << ifaceDevice.getPropertyString("battery.type")
-//                            << ifaceDevice.getPropertyInt("battery.charge_level.percentage");
                     if(!ifaceDevice.getPropertyBool("battery.present")
                         && (ifaceDevice.getPropertyString("battery.type") != "pda"
                              || ifaceDevice.getPropertyString("battery.type") != "primary")) {
-                        qWarning() << "XXXXXXXXXXXXX";
                         return 0;
                     } else {
                         level = ifaceDevice.getPropertyInt("battery.charge_level.percentage");
@@ -1479,7 +1474,6 @@
     } else {
         QFile infofile("/proc/acpi/battery/BAT0/info");
         if (!infofile.open(QIODevice::ReadOnly)) {
-            //   qWarning() << "Could not open /proc/acpi/battery/BAT0/info";
             return QSystemDeviceInfo::NoBatteryLevel;
         } else {
             QTextStream batinfo(&infofile);
@@ -1487,7 +1481,6 @@
             while (!line.isNull()) {
                 if(line.contains("design capacity")) {
                     levelWhenFull = line.split(" ").at(1).trimmed().toFloat();
-                    //qWarning() << levelWhenFull;
                     infofile.close();
                     break;
                 }
@@ -1498,7 +1491,6 @@
 
         QFile statefile("/proc/acpi/battery/BAT0/state");
         if (!statefile.open(QIODevice::ReadOnly)) {
-            //     qWarning() << "Could not open /proc/acpi/battery/BAT0/state";
             return QSystemDeviceInfo::NoBatteryLevel;
         } else {
             QTextStream batstate(&statefile);
@@ -1506,7 +1498,6 @@
             while (!line.isNull()) {
                 if(line.contains("remaining capacity")) {
                     level = line.split(" ").at(1).trimmed().toFloat();
-                    //qWarning() << level;
                     statefile.close();
                     break;
                 }
@@ -1554,7 +1545,6 @@
 #else
        QFile statefile("/proc/acpi/battery/BAT0/state");
        if (!statefile.open(QIODevice::ReadOnly)) {
-           //  qWarning() << "Could not open /proc/acpi/battery/BAT0/state";
        } else {
            QTextStream batstate(&statefile);
            QString line = batstate.readLine();
@@ -1597,7 +1587,7 @@
                                             "org.bluez.Adapter",
                                             "PropertyChanged",
                                             this,SLOT(bluezPropertyChanged(QString, QDBusVariant)))) {
-                     qWarning() << "bluez could not connect signal";
+                     qDebug() << "bluez could not connect signal";
                  }
              }
          }
--- a/qtmobility/src/systeminfo/qsysteminfo_maemo.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/qsysteminfo_maemo.cpp	Thu May 27 13:42:11 2010 +0300
@@ -55,7 +55,7 @@
 #include <QMapIterator>
 
 #if !defined(QT_NO_DBUS)
-#include "gconfitem.h" // Temporarily here.
+#include "gconfitem_p.h" // Temporarily here.
 #endif
 
 #ifdef Q_WS_X11
--- a/qtmobility/src/systeminfo/qsysteminfo_s60.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/qsysteminfo_s60.cpp	Thu May 27 13:42:11 2010 +0300
@@ -421,6 +421,11 @@
 
 QString QSystemNetworkInfoPrivate::homeMobileNetworkCode()
 {
+    CTelephony::TRegistrationStatus networkStatus = DeviceInfo::instance()
+        ->cellNetworkRegistrationInfo()->cellNetworkStatus();
+    if (networkStatus == CTelephony::ERegisteredOnHomeNetwork) {
+        return DeviceInfo::instance()->cellNetworkInfo()->networkCode();
+    }
     return QString();
 }
 
--- a/qtmobility/src/systeminfo/systeminfo.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/systeminfo/systeminfo.pro	Thu May 27 13:42:11 2010 +0300
@@ -67,7 +67,7 @@
             #Qt GConf wrapper added here until a proper place is found for it.
             CONFIG += link_pkgconfig
             SOURCES += qsysteminfo_maemo.cpp gconfitem.cpp
-            HEADERS += qsysteminfo_maemo_p.h gconfitem.h
+            HEADERS += qsysteminfo_maemo_p.h gconfitem_p.h
         contains(QT_CONFIG,dbus): {
                 QT += dbus
                 SOURCES += qhalservice_linux.cpp
--- a/qtmobility/src/versit/qversitcontactexporter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitcontactexporter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -51,7 +51,6 @@
 
 /*!
   \class QVersitContactExporterDetailHandler
-  \preliminary
   \brief The QVersitContactExporterDetailHandler class is an interface for clients wishing to
   implement custom export behaviour for certain contact details.
   \ingroup versit
@@ -90,7 +89,6 @@
 
 /*!
  * \class QVersitContactExporter
- * \preliminary
  * \brief The QVersitContactExporter class converts \l {QContact}{QContacts} into
  * \l {QVersitDocument}{QVersitDocuments}.
  * \ingroup versit
--- a/qtmobility/src/versit/qversitcontactexporter_p.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitcontactexporter_p.cpp	Thu May 27 13:42:11 2010 +0300
@@ -257,7 +257,12 @@
     const QContactDetail& detail)
 {
     QContactPhoneNumber phoneNumber = static_cast<QContactPhoneNumber>(detail);
-    encodeParameters(property, phoneNumber.contexts(), phoneNumber.subTypes());
+    QStringList subTypes = phoneNumber.subTypes();
+    encodeParameters(property, phoneNumber.contexts(), subTypes);
+    if (subTypes.contains(QContactPhoneNumber::SubTypeAssistant))
+        property.setName(QLatin1String("X-ASSISTANT-TEL"));
+    else
+        property.setName(QLatin1String("TEL"));
     property.setValue(phoneNumber.number());
 }
 
--- a/qtmobility/src/versit/qversitcontactimporter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitcontactimporter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
 
 /*!
   \class QVersitContactImporterPropertyHandler
-  \preliminary
   \brief The QVersitContactImporterPropertyHandler class is an interface for clients wishing to
   implement custom import behaviour for versit properties
 
@@ -95,7 +94,6 @@
 
 /*!
  * \class QVersitContactImporter
- * \preliminary
  * \brief The QVersitContactImporter class creates QContacts from QVersitDocuments.
  *
  * \ingroup versit
--- a/qtmobility/src/versit/qversitcontactimporter_p.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitcontactimporter_p.cpp	Thu May 27 13:42:11 2010 +0300
@@ -248,6 +248,8 @@
     QContactPhoneNumber phone;
     phone.setNumber(property.value());
     phone.setSubTypes(extractSubTypes(property));
+    if (property.name() == QLatin1String("X-ASSISTANT-TEL"))
+        phone.setSubTypes(QContactPhoneNumber::SubTypeAssistant);
 
     saveDetailWithContext(contact, &phone, extractContexts(property));
     return true;
--- a/qtmobility/src/versit/qversitdefs_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitdefs_p.h	Thu May 27 13:42:11 2010 +0300
@@ -135,6 +135,8 @@
                       ""},
     {"X-ASSISTANT",   QContactOrganization::DefinitionName.latin1(),
                       QContactOrganization::FieldAssistantName.latin1()},
+    {"X-ASSISTANT-TEL", QContactPhoneNumber::DefinitionName.latin1(),
+                      QContactPhoneNumber::SubTypeAssistant.latin1()},
     {"X-CHILDREN",    QContactFamily::DefinitionName.latin1(),
                       QContactFamily::FieldChildren.latin1()},
     {"X-EPOCSECONDNAME",QContactNickname::DefinitionName.latin1(),
--- a/qtmobility/src/versit/qversitdocument.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitdocument.cpp	Thu May 27 13:42:11 2010 +0300
@@ -49,7 +49,6 @@
 
 /*!
   \class QVersitDocument
-  \preliminary
   \brief The QVersitDocument class is a container for a list of versit properties.
   \ingroup versit
 
--- a/qtmobility/src/versit/qversitproperty.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitproperty.cpp	Thu May 27 13:42:11 2010 +0300
@@ -50,7 +50,6 @@
 
 /*!
   \class QVersitProperty
-  \preliminary
   \brief The QVersitProperty class stores the name, value, groups and parameters of a Versit property.
   \ingroup versit
 
@@ -120,10 +119,19 @@
 /*! Returns true if this is equal to \a other; false otherwise. */
 bool QVersitProperty::operator==(const QVersitProperty& other) const
 {
-    return d->mGroups == other.d->mGroups &&
+    bool equal = d->mGroups == other.d->mGroups &&
             d->mName == other.d->mName &&
             d->mParameters == other.d->mParameters &&
-            d->mValue == other.d->mValue;
+            d->mValueType == other.d->mValueType;
+    if (!equal)
+        return false;
+
+    // QVariant doesn't support == on QVersitDocuments - do it manually
+    if (d->mValue.userType() == qMetaTypeId<QVersitDocument>())
+        return  other.d->mValue.userType() == qMetaTypeId<QVersitDocument>()
+            && d->mValue.value<QVersitDocument>() == other.d->mValue.value<QVersitDocument>();
+    else
+        return d->mValue == other.d->mValue;
 }
 
 /*! Returns true if this is not equal to \a other; false otherwise. */
--- a/qtmobility/src/versit/qversitreader.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitreader.cpp	Thu May 27 13:42:11 2010 +0300
@@ -53,7 +53,6 @@
 
 /*!
   \class QVersitReader
-  \preliminary
   \brief The QVersitReader class reads Versit documents such as vCards from a device.
   \ingroup versit
 
--- a/qtmobility/src/versit/qversitreader_p.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitreader_p.cpp	Thu May 27 13:42:11 2010 +0300
@@ -242,6 +242,14 @@
                          QVersitProperty::ListType);
     mValueTypeMap.insert(qMakePair(QVersitDocument::VCard30Type, QString::fromAscii("CATEGORIES")),
                          QVersitProperty::ListType);
+    mValueTypeMap.insert(qMakePair(QVersitDocument::VCard21Type, QString::fromAscii("X-CHILDREN")),
+                         QVersitProperty::ListType);
+    mValueTypeMap.insert(qMakePair(QVersitDocument::VCard30Type, QString::fromAscii("X-CHILDREN")),
+                         QVersitProperty::ListType);
+    mValueTypeMap.insert(qMakePair(QVersitDocument::VCard21Type, QString::fromAscii("X-NICKNAME")),
+                         QVersitProperty::ListType);
+    mValueTypeMap.insert(qMakePair(QVersitDocument::VCard30Type, QString::fromAscii("X-NICKNAME")),
+                         QVersitProperty::ListType);
 }
 
 /*! Destroy a reader. */
@@ -422,6 +430,11 @@
     QVersitProperty property;
     property.setGroups(groupsAndName.first);
     property.setName(groupsAndName.second);
+    // set the propertyValueType
+    QPair<QVersitDocument::VersitType, QString> key =
+        qMakePair(versitType, property.name());
+    if (mValueTypeMap.contains(key))
+        property.setValueType(mValueTypeMap.value(key));
 
     if (versitType == QVersitDocument::VCard21Type)
         parseVCard21Property(cursor, property, lineReader);
@@ -440,8 +453,7 @@
     property.setParameters(extractVCard21PropertyParams(cursor, lineReader.codec()));
 
     QByteArray value = extractPropertyValue(cursor);
-    if (mValueTypeMap.value(qMakePair(QVersitDocument::VCard21Type, property.name()))
-            == QVersitProperty::VersitDocumentType) {
+    if (property.valueType() == QVersitProperty::VersitDocumentType) {
         // Hack to handle cases where start of document is on the same or next line as "AGENT:"
         bool foundBegin = false;
         if (value == "BEGIN:VCARD") {
@@ -462,9 +474,10 @@
         QVariant valueVariant(decodeCharset(value, property, lineReader.codec(), &codec));
         bool isBinary = unencode(valueVariant, cursor, property, codec, lineReader);
         property.setValue(valueVariant);
-        if (!isBinary) {
-            splitStructuredValue(QVersitDocument::VCard21Type, property, false);
-        }
+        if (isBinary)
+            property.setValueType(QVersitProperty::BinaryType);
+        else
+            splitStructuredValue(property, false);
     }
 }
 
@@ -481,8 +494,7 @@
     QTextCodec* codec;
     QString valueString(decodeCharset(value, property, lineReader.codec(), &codec));
 
-    if (mValueTypeMap.value(qMakePair(QVersitDocument::VCard30Type, property.name()))
-            == QVersitProperty::VersitDocumentType) {
+    if (property.valueType() == QVersitProperty::VersitDocumentType) {
         removeBackSlashEscaping(valueString);
         // Make a line reader from the value of the property.
         QByteArray subDocumentValue(codec->fromUnicode(valueString));
@@ -501,8 +513,10 @@
         QVariant valueVariant(valueString);
         bool isBinary = unencode(valueVariant, cursor, property, codec, lineReader);
         property.setValue(valueVariant);
-        if (!isBinary) {
-            bool isList = splitStructuredValue(QVersitDocument::VCard30Type, property, true);
+        if (isBinary) {
+            property.setValueType(QVersitProperty::BinaryType);
+        } else {
+            bool isList = splitStructuredValue(property, true);
             // Do backslash unescaping
             if (isList) {
                 QStringList list = property.value<QStringList>();
@@ -868,23 +882,19 @@
  * exit).
  */
 bool QVersitReaderPrivate::splitStructuredValue(
-        QVersitDocument::VersitType type, QVersitProperty& property,
+        QVersitProperty& property,
         bool hasEscapedBackslashes) const
 {
     QVariant variant = property.variantValue();
-    QPair<QVersitDocument::VersitType,QString> key = qMakePair(type, property.name());
-    if (mValueTypeMap.contains(key)) {
-        if (mValueTypeMap.value(key) == QVersitProperty::CompoundType) {
-            variant.setValue(splitValue(variant.toString(), QLatin1Char(';'),
-                                        QString::KeepEmptyParts, hasEscapedBackslashes));
-            property.setValue(variant);
-            property.setValueType(QVersitProperty::CompoundType);
-        } else if (mValueTypeMap.value(key) == QVersitProperty::ListType) {
-            variant.setValue(splitValue(variant.toString(), QLatin1Char(','),
-                                        QString::SkipEmptyParts, hasEscapedBackslashes));
-            property.setValue(variant);
-            property.setValueType(QVersitProperty::ListType);
-        }
+    if (property.valueType() == QVersitProperty::CompoundType) {
+        variant.setValue(splitValue(variant.toString(), QLatin1Char(';'),
+                                    QString::KeepEmptyParts, hasEscapedBackslashes));
+        property.setValue(variant);
+        return true;
+    } else if (property.valueType() == QVersitProperty::ListType) {
+        variant.setValue(splitValue(variant.toString(), QLatin1Char(','),
+                                    QString::SkipEmptyParts, hasEscapedBackslashes));
+        property.setValue(variant);
         return true;
     }
     return false;
--- a/qtmobility/src/versit/qversitreader_p.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitreader_p.h	Thu May 27 13:42:11 2010 +0300
@@ -208,8 +208,7 @@
     QString paramName(const QByteArray& parameter, QTextCodec* codec) const;
     QString paramValue(const QByteArray& parameter, QTextCodec* codec) const;
     static bool containsAt(const QByteArray& text, const QByteArray& ba, int index);
-    bool splitStructuredValue(QVersitDocument::VersitType type,
-                              QVersitProperty& property,
+    bool splitStructuredValue(QVersitProperty& property,
                               bool hasEscapedBackslashes) const;
     static QStringList splitValue(const QString& string,
                                   const QChar& sep,
--- a/qtmobility/src/versit/qversitresourcehandler.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitresourcehandler.cpp	Thu May 27 13:42:11 2010 +0300
@@ -49,7 +49,6 @@
 
 /*!
   \class QVersitResourceHandler
-  \preliminary
   \brief The QVersitResourceHandler class is an interface for clients wishing to implement custom
   behaviour for loading and saving files to disk when exporting and importing.
   \ingroup versit
--- a/qtmobility/src/versit/qversitwriter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/src/versit/qversitwriter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -52,7 +52,6 @@
 
 /*!
   \class QVersitWriter
-  \preliminary
   \brief The QVersitWriter class writes Versit documents such as vCards to a device.
   \ingroup versit
 
--- a/qtmobility/tests/auto/auto.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/auto.pro	Thu May 27 13:42:11 2010 +0300
@@ -100,21 +100,21 @@
 contains(mobility_modules,multimedia) {
     SUBDIRS += \             #Multimedia
         qaudiocapturesource \
-        qgraphicsvideoitem \
-        qmediaimageviewer \
+#        qgraphicsvideoitem \
+#        qmediaimageviewer \
         qmediaobject \
         qmediaplayer \
-        qmediaplaylist \
+#        qmediaplaylist \
         qmediaplaylistnavigator \
-        qmediapluginloader \
+#        qmediapluginloader \
         qmediarecorder \
         qmediaresource \
         qmediaservice \
-        qmediaserviceprovider \
+#        qmediaserviceprovider \
         qmediacontent \
         qradiotuner \
-        qpaintervideosurface \
-        qvideowidget \
+#        qpaintervideosurface \
+#        qvideowidget \
         qmediatimerange
 
     symbian: {
--- a/qtmobility/tests/auto/qmessagestore/tst_qmessagestore.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qmessagestore/tst_qmessagestore.cpp	Thu May 27 13:42:11 2010 +0300
@@ -222,7 +222,7 @@
     QVERIFY(accountId.isValid());
     QVERIFY(accountId != QMessageAccountId());
     QCOMPARE(manager->countAccounts(), originalCount + 1);
-    
+
     QMessageAccount account(accountId);
     QCOMPARE(account.id(), accountId);
     QCOMPARE(account.name(), name);
--- a/qtmobility/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qmessagestorekeys/tst_qmessagestorekeys.cpp	Thu May 27 13:42:11 2010 +0300
@@ -1463,6 +1463,7 @@
     }
 }
 
+
 void tst_QMessageStoreKeys::testMessageFilter_data()
 {
     QTest::addColumn<QMessageFilter>("filter");
@@ -1487,7 +1488,6 @@
         << ( QMessageIdList() << messageIds[1] )
         << ( QMessageIdList() << messageIds[0] << messageIds[2] << messageIds[3] << messageIds[4] )
         << "";
-
     QTest::newRow("id equality invalid")
         << QMessageFilter::byId(QMessageId(), QMessageDataComparator::Equal) 
         << QMessageIdList()
@@ -1578,7 +1578,6 @@
         << ( QMessageIdList() << messageIds[4] )
         << ( QMessageIdList() << messageIds[0] << messageIds[1] << messageIds[2] << messageIds[3] )
         << "";
-
     QTest::newRow("type equality 1")
         << QMessageFilter::byType(QMessage::Sms, QMessageDataComparator::Equal) 
 #if (defined(Q_OS_SYMBIAN) || defined(Q_OS_WIN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6))
@@ -2876,7 +2875,7 @@
     if (filter.isSupported()) {
         QVERIFY(filter == filter);
         QCOMPARE(filter != QMessageFilter(), !filter.isEmpty());
-        
+
         // Order is irrelevant for filtering
         if (body.isEmpty()) {
             QCOMPARE(manager->queryMessages(filter&~existingAccountsFilter).toSet().subtract(existingMessageIds), ids.toSet());
@@ -2889,7 +2888,6 @@
         QSKIP("Unsupported for this configuration", SkipSingle);
     }
 }
-
 void tst_QMessageStoreKeys::testMessageOrdering_data()
 {
     QTest::addColumn<MessageSortList>("sorts");
--- a/qtmobility/tests/auto/qvcard21writer/tst_qvcard21writer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qvcard21writer/tst_qvcard21writer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -40,7 +40,9 @@
 ****************************************************************************/
 
 #include "tst_qvcard21writer.h"
+#ifdef QT_BUILD_INTERNAL
 #include "qvcard21writer_p.h"
+#endif
 #include "qversitproperty.h"
 #include "qversitdocument.h"
 #include <QtTest/QtTest>
@@ -53,7 +55,7 @@
 QTM_USE_NAMESPACE
 
 Q_DECLARE_METATYPE(QVersitProperty)
-
+#ifdef QT_BUILD_INTERNAL
 void tst_QVCard21Writer::init()
 {
     mWriter = new QVCard21Writer;
@@ -343,6 +345,6 @@
     QVERIFY(mWriter->quotedPrintableEncode(inputOutput));
     QCOMPARE(inputOutput, QLatin1String("=7E"));
 }
-
+#endif
 QTEST_MAIN(tst_QVCard21Writer)
 
--- a/qtmobility/tests/auto/qvcard21writer/tst_qvcard21writer.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qvcard21writer/tst_qvcard21writer.h	Thu May 27 13:42:11 2010 +0300
@@ -56,15 +56,16 @@
      Q_OBJECT
 
 private slots: // Tests
-
+#ifdef QT_BUILD_INTERNAL
     void init();
     void cleanup();
-
     void testEncodeVersitProperty();
     void testEncodeVersitProperty_data();
     void testEncodeParameters();
     void testEncodeGroupsAndName();
     void testQuotedPrintableEncode();
+#endif
+
 private: // Data
     QVCard21Writer* mWriter;
 };
--- a/qtmobility/tests/auto/qvcard30writer/tst_qvcard30writer.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qvcard30writer/tst_qvcard30writer.cpp	Thu May 27 13:42:11 2010 +0300
@@ -40,7 +40,9 @@
 ****************************************************************************/
 
 #include "tst_qvcard30writer.h"
+#ifdef QT_BUILD_INTERNAL
 #include "qvcard30writer_p.h"
+#endif
 #include "qversitdocument.h"
 #include "qversitproperty.h"
 #include <QtTest/QtTest>
@@ -53,7 +55,7 @@
 QTM_USE_NAMESPACE
 
 Q_DECLARE_METATYPE(QVersitProperty)
-
+#ifdef QT_BUILD_INTERNAL
 void tst_QVCard30Writer::init()
 {
     mWriter = new QVCard30Writer;
@@ -302,6 +304,6 @@
     QVCard30Writer::backSlashEscape(input);
     QCOMPARE(input, QString::fromAscii("Escape these \\n \\; \\, \\\\ "));
 }
-
+#endif
 QTEST_MAIN(tst_QVCard30Writer)
 
--- a/qtmobility/tests/auto/qvcard30writer/tst_qvcard30writer.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qvcard30writer/tst_qvcard30writer.h	Thu May 27 13:42:11 2010 +0300
@@ -58,6 +58,7 @@
 
 private slots: // Tests
 
+#ifdef QT_BUILD_INTERNAL
     void init();
     void cleanup();
 
@@ -65,6 +66,7 @@
     void testEncodeVersitProperty_data();
     void testEncodeParameters();
     void testBackSlashEscape();
+#endif
 
 private: // Data
     QVCard30Writer* mWriter;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/qtmobility/tests/auto/qversit/testdata/test1.vcf	Thu May 27 13:42:11 2010 +0300
@@ -0,0 +1,11 @@
+BEGIN:VCARD
+VERSION:2.1
+N:;name;;;
+X-CHILDREN:Child1
+X-CHILDREN:Child2,Child3
+X-NICKNAME:Nick1
+NICKNAME:Nick2
+X-NICKNAME:Nick3,Nick4
+NICKNAME:Nick5,Nick6
+X-ASSISTANT-TEL:1234
+END:VCARD
--- a/qtmobility/tests/auto/qversit/tst_qversit.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qversit/tst_qversit.cpp	Thu May 27 13:42:11 2010 +0300
@@ -213,6 +213,41 @@
     QTEST_NEW_ROW("Entourage12-kevin.vcf", "UTF-8", QList<QContact>());
     QTEST_NEW_ROW("Entourage12-nonascii.vcf", "UTF-8", QList<QContact>());
     QTEST_NEW_ROW("gmail.vcf", "UTF-8", QList<QContact>());
+
+    {
+        QContact contact;
+        QContactName name;
+        name.setFirstName(QLatin1String("name"));
+        name.setLastName(QString());
+        name.setMiddleName(QString());
+        name.setPrefix(QString());
+        name.setSuffix(QString());
+        contact.saveDetail(&name);
+        QContactFamily family;
+        family.setChildren(QStringList(QLatin1String("Child1")));
+        contact.saveDetail(&family);
+        family.setChildren(QStringList(QLatin1String("Child2")) << QLatin1String("Child3"));
+        contact.saveDetail(&family);
+        QContactNickname nickname;
+        nickname.setNickname(QLatin1String("Nick6"));
+        contact.saveDetail(&nickname);
+        nickname.setNickname(QLatin1String("Nick5"));
+        contact.saveDetail(&nickname);
+        nickname.setNickname(QLatin1String("Nick4"));
+        contact.saveDetail(&nickname);
+        nickname.setNickname(QLatin1String("Nick3"));
+        contact.saveDetail(&nickname);
+        nickname.setNickname(QLatin1String("Nick2"));
+        contact.saveDetail(&nickname);
+        nickname.setNickname(QLatin1String("Nick1"));
+        contact.saveDetail(&nickname);
+        QContactPhoneNumber assistantphone;
+        assistantphone.setNumber(QLatin1String("1234"));
+        assistantphone.setSubTypes(QContactPhoneNumber::SubTypeAssistant);
+        contact.saveDetail(&assistantphone);
+        QContactManagerEngine::setContactDisplayLabel(&contact, QLatin1String("name"));
+        QTEST_NEW_ROW("test1.vcf", "UTF-8", QList<QContact>() << contact);
+    }
 }
 
 QTEST_MAIN(tst_QVersit)
--- a/qtmobility/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qversitcontactexporter/tst_qversitcontactexporter.cpp	Thu May 27 13:42:11 2010 +0300
@@ -337,6 +337,21 @@
         QString::fromAscii("TYPE"),QString::fromAscii("CELL")));
     // Check value
     QCOMPARE(property.value(), phoneNumber.number());
+
+    QContactPhoneNumber assistantNumber;
+    assistantNumber.setNumber(QLatin1String("4321"));
+    assistantNumber.setContexts(QContactDetail::ContextWork);
+    assistantNumber.setSubTypes(QContactPhoneNumber::SubTypeAssistant);
+    contact.saveDetail(&assistantNumber);
+    QVERIFY(mExporter->exportContacts(QList<QContact>() << contact, QVersitDocument::VCard30Type));
+    document = mExporter->documents().first();
+    QCOMPARE(document.properties().count(), BASE_PROPERTY_COUNT+2);
+    property = findPropertyByName(document, QLatin1String("X-ASSISTANT-TEL"));
+    QVERIFY(!property.isEmpty());
+    QCOMPARE(property.parameters().count(), 1);
+    QVERIFY(property.parameters().contains(
+        QString::fromAscii("TYPE"),QString::fromAscii("WORK")));
+    QCOMPARE(property.value(), assistantNumber.number());
 }
 
 void tst_QVersitContactExporter::testEncodeEmailAddress()
--- a/qtmobility/tests/auto/qversitreader/tst_qversitreader.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qversitreader/tst_qversitreader.cpp	Thu May 27 13:42:11 2010 +0300
@@ -41,8 +41,11 @@
 
 #include "tst_qversitreader.h"
 #include "qversitreader.h"
+#include "qversitproperty.h"
+#ifdef QT_BUILD_INTERNAL
 #include "qversitreader_p.h"
 #include "versitutils_p.h"
+#endif
 #include <QtTest/QtTest>
 #include <QSignalSpy>
 
@@ -66,6 +69,9 @@
 // This says "NOKIA" in Katakana encoded with UTF-8
 const QByteArray KATAKANA_NOKIA("\xe3\x83\x8e\xe3\x82\xad\xe3\x82\xa2");
 
+Q_DECLARE_METATYPE(QVersitDocument::VersitType);
+Q_DECLARE_METATYPE(QVersitProperty);
+
 QTM_USE_NAMESPACE
 
 void tst_QVersitReader::init()
@@ -73,7 +79,9 @@
     mInputDevice = new QBuffer;
     mInputDevice->open(QBuffer::ReadWrite);
     mReader = new QVersitReader;
+#ifdef QT_BUILD_INTERNAL    
     mReaderPrivate = new QVersitReaderPrivate;
+#endif
     mSignalCatcher = new SignalCatcher;
     connect(mReader, SIGNAL(stateChanged(QVersitReader::State)),
             mSignalCatcher, SLOT(stateChanged(QVersitReader::State)));
@@ -84,7 +92,9 @@
 
 void tst_QVersitReader::cleanup()
 {
+#ifdef QT_BUILD_INTERNAL
     delete mReaderPrivate;
+#endif
     delete mReader;
     delete mInputDevice;
     delete mSignalCatcher;
@@ -117,6 +127,7 @@
     QVERIFY(mReader->defaultCodec() == QTextCodec::codecForName("UTF-16BE"));
 }
 
+
 void tst_QVersitReader::testReading()
 {
     // No I/O device set
@@ -149,8 +160,10 @@
 
     // Wide charset with no byte-order mark
     QTextCodec* codec = QTextCodec::codecForName("UTF-16BE");
+    QTextCodec::ConverterState converterState(QTextCodec::IgnoreHeader);
+    QString document = QString::fromAscii("BEGIN:VCARD\r\nVERSION:2.1\r\nFN:John\r\nEND:VCARD\r\n");
     const QByteArray& wideDocument =
-            VersitUtils::encode("BEGIN:VCARD\r\nVERSION:2.1\r\nFN:John\r\nEND:VCARD\r\n", codec);
+        codec->fromUnicode(document.data(), document.length(), &converterState);
     mInputDevice->close();
     mInputDevice->setData(wideDocument);
     mInputDevice->open(QBuffer::ReadOnly);
@@ -280,6 +293,9 @@
 
 void tst_QVersitReader::testSetVersionFromProperty()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QVersitDocument document;
 
     // Some other property than VERSION
@@ -311,337 +327,314 @@
     // VERSION property with BASE64 encoded not supported value
     property.setValue(QString::fromAscii(QByteArray("4.0").toBase64()));
     QVERIFY(!mReaderPrivate->setVersionFromProperty(document,property));
+#endif
 }
 
-void tst_QVersitReader::testParseNextVersitPropertyVCard21()
+void tst_QVersitReader::testParseNextVersitProperty()
 {
-    QVersitDocument::VersitType type = QVersitDocument::VCard21Type;
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
+    QFETCH(QVersitDocument::VersitType, documentType);
+    QFETCH(QByteArray, input);
+    QFETCH(QVersitProperty, expectedProperty);
 
-    // Test a valid vCard 2.1 with properties having separate handling:
-    // AGENT property, ENCODING parameters (BASE64 and QUOTED-PRINTABLE) and CHARSET parameter
-    QTextCodec* codec = QTextCodec::codecForName("UTF-16BE");
-    QByteArray vCard("Begin:vcard\r\n");
-    vCard.append("VERSION:2.1\r\n");
-    vCard.append("FN:John\r\n");
-    // "NOTE:\;\,\:\\"
-    vCard.append("NOTE:\\;\\,\\:\\\\\r\n");
-    // "N:foo\;bar;foo\,bar;foo\:bar;foo\\bar;foo\\\;bar"
-    vCard.append("N:foo\\;bar;foo\\,bar;foo\\:bar;foo\\\\bar;foo\\\\\\;bar\r\n");
-    // missing structured value
-    vCard.append("ADR:\r\n");
-    // "NICKNAME:foo\;bar,foo\,bar,foo\:bar,foo\\bar,foo\\\,bar"
-    vCard.append("NICKNAME:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n");
-    // "CATEGORIES:foo\;bar,foo\,bar,foo\:bar,foo\\bar,foo\\\,bar"
-    vCard.append("CATEGORIES:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n");
-    vCard.append("ORG;CHARSET=UTF-8:");
-    vCard.append(KATAKANA_NOKIA);
-    vCard.append("\r\n");
-    // "NOKIA" in Katakana, UTF-8 encoded, then base-64 encoded:
-    vCard.append("NOTE;ENCODING=BASE64;CHARSET=UTF-8:");
-    vCard.append(KATAKANA_NOKIA.toBase64());
-    vCard.append("\r\n");
-    // The value here is "UXQgaXMgZ3JlYXQh", which is the base64 encoding of "Qt is great!".
-    vCard.append("PHOTO;ENCODING=BASE64: U\t XQgaX MgZ\t3Jl YXQh\r\n\r\n");
-    // Again, but without the explicit "ENCODING" parameter
-    vCard.append("PHOTO;BASE64: U\t XQgaX MgZ\t3Jl YXQh\r\n\r\n");
-    vCard.append("HOME.Springfield.EMAIL;Encoding=Quoted-Printable:john.citizen=40exam=\r\nple.com\r\n");
-    vCard.append("EMAIL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-16BE:");
-    vCard.append(codec->fromUnicode(QLatin1String("john.citizen=40exam=\r\nple.com")));
-    vCard.append("\r\n");
-    vCard.append("AGENT:\r\nBEGIN:VCARD\r\nFN:Jenny\r\nEND:VCARD\r\n\r\n");
-    vCard.append("End:VCARD\r\n");
-    QBuffer buffer(&vCard);
+    QBuffer buffer(&input);
     buffer.open(QIODevice::ReadOnly);
     LineReader lineReader(&buffer, mAsciiCodec);
-
-    QVersitProperty property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("BEGIN"));
-    QCOMPARE(property.value(),QString::fromAscii("vcard"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("VERSION"));
-    QCOMPARE(property.value(),QString::fromAscii("2.1"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("FN"));
-    QCOMPARE(property.value(),QString::fromAscii("John"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("NOTE"));
-    // Do not Unescape semicolons, commas, colons and backlashes
-    // "\;\,\:\\"
-    QCOMPARE(property.value(),QString::fromAscii("\\;\\,\\:\\\\"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("N"));
-    QCOMPARE(property.valueType(), QVersitProperty::CompoundType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    QStringList components = property.value<QStringList>();
-    QCOMPARE(components.size(), 5);
-    QCOMPARE(components.at(0), QLatin1String("foo;bar"));
-    QCOMPARE(components.at(1), QLatin1String("foo\\,bar"));
-    QCOMPARE(components.at(2), QLatin1String("foo\\:bar"));
-    QCOMPARE(components.at(3), QLatin1String("foo\\\\bar"));
-    QCOMPARE(components.at(4), QLatin1String("foo\\\\;bar"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("ADR"));
-    QCOMPARE(property.valueType(), QVersitProperty::CompoundType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    components = property.value<QStringList>();
-    QCOMPARE(components.size(), 1);
-    QVERIFY(components.at(0).isEmpty());
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("NICKNAME"));
-    QCOMPARE(property.valueType(), QVersitProperty::ListType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    components = property.value<QStringList>();
-    QCOMPARE(components.size(), 5);
-    QCOMPARE(components.at(0), QLatin1String("foo\\;bar"));
-    QCOMPARE(components.at(1), QLatin1String("foo,bar"));
-    QCOMPARE(components.at(2), QLatin1String("foo\\:bar"));
-    QCOMPARE(components.at(3), QLatin1String("foo\\\\bar"));
-    QCOMPARE(components.at(4), QLatin1String("foo\\\\,bar"));
+    QVersitProperty property = mReaderPrivate->parseNextVersitProperty(documentType, lineReader);
+    if (property != expectedProperty) {
+        // compare each part of the property separately for easier debugging
+        QCOMPARE(property.groups(), expectedProperty.groups());
+        QCOMPARE(property.name(), expectedProperty.name());
+        QCOMPARE(property.valueType(), expectedProperty.valueType());
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("CATEGORIES"));
-    QCOMPARE(property.valueType(), QVersitProperty::ListType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    components = property.value<QStringList>();
-    QCOMPARE(components.size(), 5);
-    QCOMPARE(components.at(0), QLatin1String("foo\\;bar"));
-    QCOMPARE(components.at(1), QLatin1String("foo,bar"));
-    QCOMPARE(components.at(2), QLatin1String("foo\\:bar"));
-    QCOMPARE(components.at(3), QLatin1String("foo\\\\bar"));
-    QCOMPARE(components.at(4), QLatin1String("foo\\\\,bar"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("ORG"));
-    QCOMPARE(property.value(),QString::fromUtf8(KATAKANA_NOKIA));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("NOTE"));
-    QCOMPARE(property.value(),QString::fromUtf8(KATAKANA_NOKIA));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("PHOTO"));
-    // Linear whitespaces (SPACEs and TABs) removed from the value and base64 decoded:
-    QCOMPARE(property.variantValue().type(), QVariant::ByteArray);
-    QCOMPARE(property.value<QByteArray>(), QByteArray("Qt is great!"));
-    // Ensure that base-64 encoded strings can be retrieved as strings.
-    QCOMPARE(property.value(), QLatin1String("Qt is great!"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("PHOTO"));
-    QCOMPARE(property.variantValue().type(), QVariant::ByteArray);
-    QCOMPARE(property.value<QByteArray>(), QByteArray("Qt is great!"));
-    QCOMPARE(property.value(), QLatin1String("Qt is great!"));
+        // QVariant doesn't support == on QVersitDocuments - do it manually
+        if (property.variantValue().userType() == qMetaTypeId<QVersitDocument>()) {
+            QVERIFY(expectedProperty.variantValue().userType() == qMetaTypeId<QVersitDocument>());
+            QCOMPARE(property.value<QVersitDocument>(), expectedProperty.value<QVersitDocument>());
+        }
+        else
+            QCOMPARE(property.variantValue(), expectedProperty.variantValue());
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QStringList propertyGroup(QString::fromAscii("HOME"));
-    propertyGroup.append(QString::fromAscii("Springfield"));
-    QCOMPARE(property.groups(),propertyGroup);
-    QCOMPARE(property.name(),QString::fromAscii("EMAIL"));
-    QCOMPARE(0,property.parameters().count());
-    QCOMPARE(property.value(),QString::fromAscii("john.citizen@example.com"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("EMAIL"));
-    // The encoding and charset parameters should be stripped by the reader.
-    QCOMPARE(property.parameters().count(), 0);
-    QCOMPARE(property.value(),QString::fromAscii("john.citizen@example.com"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("AGENT"));
-    QCOMPARE(property.value(),QString());
-    QVERIFY(property.variantValue().userType() == qMetaTypeId<QVersitDocument>());
-    QCOMPARE(property.value<QVersitDocument>().properties().count(), 1);
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("END"));
-    QCOMPARE(property.value(),QString::fromAscii("VCARD"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString());
-    QCOMPARE(property.value(),QString());
-
-    // Simulate a situation where the document nesting level is exceeded
-    // In practice this would mean a big number of nested AGENT properties
-    mReaderPrivate->mDocumentNestingLevel = 20;
-    QByteArray agentProperty("AGENT:BEGIN:VCARD\r\nN:Jenny\r\nEND:VCARD\r\n\r\n");
-    buffer.close();
-    buffer.setData(agentProperty);
-    buffer.open(QIODevice::ReadOnly);
-    LineReader agentLineReader(&buffer, mAsciiCodec);
-
-    property = mReaderPrivate->parseNextVersitProperty(type, agentLineReader);
-    QVERIFY(property.isEmpty());
+        // Don't check parameters because the reader can add random parameters of its own (like CHARSET)
+        // QCOMPARE(property.parameters(), expectedProperty.parameters());
+    }
+#endif
 }
 
-void tst_QVersitReader::testParseNextVersitPropertyVCard30()
+void tst_QVersitReader::testParseNextVersitProperty_data()
 {
-    QVersitDocument::VersitType type = QVersitDocument::VCard30Type;
+#ifdef QT_BUILD_INTERNAL
+    QTest::addColumn<QVersitDocument::VersitType>("documentType");
+    QTest::addColumn<QByteArray>("input");
+    QTest::addColumn<QVersitProperty>("expectedProperty");
+
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("BEGIN"));
+        expectedProperty.setValue(QLatin1String("vcard"));
+        QTest::newRow("begin")
+            << QVersitDocument::VCard21Type
+            << QByteArray("Begin:vcard\r\n")
+            << expectedProperty;
+    }
+
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("VERSION"));
+        expectedProperty.setValue(QLatin1String("2.1"));
+        expectedProperty.setValueType(QVersitProperty::PlainType);
+        QTest::newRow("version")
+            << QVersitDocument::VCard21Type
+            << QByteArray("VERSION:2.1\r\n")
+            << expectedProperty;
+    }
+
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("FN"));
+        expectedProperty.setValue(QLatin1String("John"));
+        expectedProperty.setValueType(QVersitProperty::PlainType);
+        QTest::newRow("fn")
+            << QVersitDocument::VCard21Type
+            << QByteArray("FN:John\r\n")
+            << expectedProperty;
+    }
+
+    {
+        // "NOTE:\;\,\:\\"
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("NOTE"));
+        expectedProperty.setValue(QLatin1String("\\;\\,\\:\\\\"));
+        expectedProperty.setValueType(QVersitProperty::PlainType);
+        QTest::newRow("vcard21 note")
+            << QVersitDocument::VCard21Type
+            << QByteArray("NOTE:\\;\\,\\:\\\\\r\n")
+            << expectedProperty;
+
+        expectedProperty.setValue(QLatin1String(";,:\\"));
+        QTest::newRow("vcard30 note")
+            << QVersitDocument::VCard30Type
+            << QByteArray("NOTE:\\;\\,\\:\\\\\r\n")
+            << expectedProperty;
+    }
 
-    // Test a valid vCard 3.0 with properties having separate handling:
-    // AGENT property and some other property
-    QByteArray vCard("Begin:vcard\r\n");
-    vCard.append("VERSION:3.0\r\n");
-    vCard.append("FN:John\r\n");
-    // "NOTE:\;\,\:\\"
-    vCard.append("NOTE:\\;\\,\\:\\\\\r\n");
-    // "N:foo\;bar;foo\,bar;foo\:bar;foo\\bar;foo\\\;bar"
-    vCard.append("N:foo\\;bar;foo\\,bar;foo\\:bar;foo\\\\bar;foo\\\\\\;bar\r\n");
-    // "NICKNAME:foo\;bar,foo\,bar,foo\:bar,foo\\bar,foo\\\,bar"
-    vCard.append("NICKNAME:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n");
-    // "CATEGORIES:foo\;bar,foo\,bar,foo\:bar,foo\\bar,foo\\\,bar"
-    vCard.append("CATEGORIES:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n");
-    // "CATEGORIES:foobar\\,foobar\\\\,foo\\\\\,bar"
-    vCard.append("CATEGORIES:foobar\\\\,foobar\\\\\\\\,foo\\\\\\\\\\,bar\r\n");
-    vCard.append("ORG;CHARSET=UTF-8:");
-    vCard.append(KATAKANA_NOKIA);
-    vCard.append("\r\n");
-    // "NOKIA" in Katakana, UTF-8 encoded, then base-64 encoded:
-    vCard.append("NOTE;ENCODING=B;CHARSET=UTF-8:");
-    vCard.append(KATAKANA_NOKIA.toBase64());
-    vCard.append("\r\n");
-    vCard.append("TEL;TYPE=PREF;HOME:123\r\n");
-    // The value here is "UXQgaXMgZ3JlYXQh", which is the base64 encoding of "Qt is great!".
-    vCard.append("PHOTO;ENCODING=B:UXQgaXMgZ3JlYXQh\r\n");
-    // Again, but without the explicity "ENCODING" parameter
-    vCard.append("PHOTO;B:UXQgaXMgZ3JlYXQh\r\n");
-    vCard.append("EMAIL:john.citizen@example.com\r\n");
-    vCard.append("AGENT:BEGIN:VCARD\\nFN:Jenny\\nEND:VCARD\\n\r\n");
-    vCard.append("End:VCARD\r\n");
-    QBuffer buffer(&vCard);
-    buffer.open(QIODevice::ReadOnly);
-    LineReader lineReader(&buffer, mAsciiCodec);
+    {
+        // "N:foo\;bar;foo\,bar;foo\:bar;foo\\bar;foo\\\;bar"
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("N"));
+        QStringList components;
+        components << QLatin1String("foo;bar")
+            << QLatin1String("foo\\,bar")
+            << QLatin1String("foo\\:bar")
+            << QLatin1String("foo\\\\bar")
+            << QLatin1String("foo\\\\;bar");
+        expectedProperty.setValue(components);
+        expectedProperty.setValueType(QVersitProperty::CompoundType);
+        QTest::newRow("vcard21 n")
+            << QVersitDocument::VCard21Type
+            << QByteArray("N:foo\\;bar;foo\\,bar;foo\\:bar;foo\\\\bar;foo\\\\\\;bar\r\n")
+            << expectedProperty;
+
+        components.clear();
+        components << QLatin1String("foo;bar")
+            << QLatin1String("foo,bar")
+            << QLatin1String("foo:bar")
+            << QLatin1String("foo\\bar")
+            << QLatin1String("foo\\;bar");
+        expectedProperty.setValue(components);
+        QTest::newRow("vcard30 n")
+            << QVersitDocument::VCard30Type
+            << QByteArray("N:foo\\;bar;foo\\,bar;foo\\:bar;foo\\\\bar;foo\\\\\\;bar\r\n")
+            << expectedProperty;
+    }
 
-    QVersitProperty property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("BEGIN"));
-    QCOMPARE(property.value(),QString::fromAscii("vcard"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("VERSION"));
-    QCOMPARE(property.value(),QString::fromAscii("3.0"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("FN"));
-    QCOMPARE(property.value(),QString::fromAscii("John"));
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("ADR"));
+        expectedProperty.setValue(QStringList(QString()));
+        expectedProperty.setValueType(QVersitProperty::CompoundType);
+        QTest::newRow("empty structured")
+            << QVersitDocument::VCard21Type
+            << QByteArray("ADR:\r\n")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("NOTE"));
-    QCOMPARE(property.valueType(), QVersitProperty::PlainType);
-    QCOMPARE(property.variantValue().type(), QVariant::String);
-    // Unescape semicolons, commas, colons and backlashes
-    QCOMPARE(property.value(), QString::fromAscii(";,:\\"));
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("X-CHILDREN"));
+        expectedProperty.setValue(QStringList() << QLatin1String("Child1") << QLatin1String("Child2"));
+        expectedProperty.setValueType(QVersitProperty::ListType);
+        QTest::newRow("children")
+            << QVersitDocument::VCard21Type
+            << QByteArray("X-CHILDREN:Child1,Child2\r\n")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("N"));
-    QCOMPARE(property.valueType(), QVersitProperty::CompoundType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    QStringList components = property.value<QStringList>();
-    QCOMPARE(components.size(), 5);
-    QCOMPARE(components.at(0), QLatin1String("foo;bar"));
-    QCOMPARE(components.at(1), QLatin1String("foo,bar"));
-    QCOMPARE(components.at(2), QLatin1String("foo:bar"));
-    QCOMPARE(components.at(3), QLatin1String("foo\\bar"));
-    QCOMPARE(components.at(4), QLatin1String("foo\\;bar"));
+    {
+        // "NICKNAME:foo\;bar,foo\,bar,foo\:bar,foo\\bar,foo\\\,bar"
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("NICKNAME"));
+        QStringList components;
+        components << QLatin1String("foo\\;bar")
+            << QLatin1String("foo,bar")
+            << QLatin1String("foo\\:bar")
+            << QLatin1String("foo\\\\bar")
+            << QLatin1String("foo\\\\,bar");
+        expectedProperty.setValue(components);
+        expectedProperty.setValueType(QVersitProperty::ListType);
+        QTest::newRow("vcard21 nickname")
+            << QVersitDocument::VCard21Type
+            << QByteArray("NICKNAME:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n")
+            << expectedProperty;
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("NICKNAME"));
-    QCOMPARE(property.valueType(), QVersitProperty::ListType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    components = property.value<QStringList>();
-    QCOMPARE(components.size(), 5);
-    QCOMPARE(components.at(0), QLatin1String("foo;bar"));
-    QCOMPARE(components.at(1), QLatin1String("foo,bar"));
-    QCOMPARE(components.at(2), QLatin1String("foo:bar"));
-    QCOMPARE(components.at(3), QLatin1String("foo\\bar"));
-    QCOMPARE(components.at(4), QLatin1String("foo\\,bar"));
+        components.clear();
+        components << QLatin1String("foo;bar")
+            << QLatin1String("foo,bar")
+            << QLatin1String("foo:bar")
+            << QLatin1String("foo\\bar")
+            << QLatin1String("foo\\,bar");
+        expectedProperty.setValue(components);
+        QTest::newRow("vcard30 nickname")
+            << QVersitDocument::VCard30Type
+            << QByteArray("NICKNAME:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n")
+            << expectedProperty;
+    }
+
+    {
+        // "CATEGORIES:foo\;bar,foo\,bar,foo\:bar,foo\\bar,foo\\\,bar"
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("CATEGORIES"));
+        QStringList components;
+        components << QLatin1String("foo\\;bar")
+            << QLatin1String("foo,bar")
+            << QLatin1String("foo\\:bar")
+            << QLatin1String("foo\\\\bar")
+            << QLatin1String("foo\\\\,bar");
+        expectedProperty.setValue(components);
+        expectedProperty.setValueType(QVersitProperty::ListType);
+        QTest::newRow("vcard21 categories")
+            << QVersitDocument::VCard21Type
+            << QByteArray("CATEGORIES:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n")
+            << expectedProperty;
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("CATEGORIES"));
-    QCOMPARE(property.valueType(), QVersitProperty::ListType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    components = property.value<QStringList>();
-    QCOMPARE(components.size(), 5);
-    QCOMPARE(components.at(0), QLatin1String("foo;bar"));
-    QCOMPARE(components.at(1), QLatin1String("foo,bar"));
-    QCOMPARE(components.at(2), QLatin1String("foo:bar"));
-    QCOMPARE(components.at(3), QLatin1String("foo\\bar"));
-    QCOMPARE(components.at(4), QLatin1String("foo\\,bar"));
+        components.clear();
+        components << QLatin1String("foo;bar")
+            << QLatin1String("foo,bar")
+            << QLatin1String("foo:bar")
+            << QLatin1String("foo\\bar")
+            << QLatin1String("foo\\,bar");
+        expectedProperty.setValue(components);
+        QTest::newRow("vcard30 categories")
+            << QVersitDocument::VCard30Type
+            << QByteArray("CATEGORIES:foo\\;bar,foo\\,bar,foo\\:bar,foo\\\\bar,foo\\\\\\,bar\r\n")
+            << expectedProperty;
 
-    // "CATEGORIES:foobar\\,foobar\\\\,foo\\\\\,bar"
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("CATEGORIES"));
-    QCOMPARE(property.valueType(), QVersitProperty::ListType);
-    QCOMPARE(property.variantValue().type(), QVariant::StringList);
-    components = property.value<QStringList>();
-    QCOMPARE(components.size(), 3);
-    QCOMPARE(components.at(0), QLatin1String("foobar\\"));
-    QCOMPARE(components.at(1), QLatin1String("foobar\\\\"));
-    QCOMPARE(components.at(2), QLatin1String("foo\\\\,bar"));
+        // "CATEGORIES:foobar\\,foobar\\\\,foo\\\\\,bar"
+        components.clear();
+        components << QLatin1String("foobar\\")
+            << QLatin1String("foobar\\\\")
+            << QLatin1String("foo\\\\,bar");
+        expectedProperty.setValue(components);
+        QTest::newRow("vcard30 unescaping")
+            << QVersitDocument::VCard30Type
+            << QByteArray("CATEGORIES:foobar\\\\,foobar\\\\\\\\,foo\\\\\\\\\\,bar")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("ORG"));
-    QCOMPARE(property.value(),QString::fromUtf8(KATAKANA_NOKIA));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("NOTE"));
-    QCOMPARE(property.value(),QString::fromUtf8(KATAKANA_NOKIA));
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("ORG"));
+        expectedProperty.setValue(QString::fromUtf8(KATAKANA_NOKIA));
+        expectedProperty.setValueType(QVersitProperty::CompoundType);
+        QTest::newRow("org utf8")
+            << QVersitDocument::VCard21Type
+            << QByteArray("ORG;CHARSET=UTF-8:" + KATAKANA_NOKIA + "\r\n")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("TEL"));
-    QCOMPARE(property.value(),QString::fromAscii("123"));
-    QCOMPARE(property.parameters().count(), 2);
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("PHOTO"));
+        expectedProperty.setValue(QLatin1String("Qt is great!"));
+        expectedProperty.setValueType(QVersitProperty::BinaryType);
+        QTest::newRow("vcard21 photo1")
+            << QVersitDocument::VCard21Type
+            << QByteArray("PHOTO;ENCODING=BASE64: U\t XQgaX MgZ\t3Jl YXQh\r\n\r\n")
+            << expectedProperty;
+
+        QTest::newRow("vcard30 photo1")
+            << QVersitDocument::VCard30Type
+            << QByteArray("PHOTO;ENCODING=B: U\t XQgaX MgZ\t3Jl YXQh\r\n\r\n")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("PHOTO"));
-    QCOMPARE(property.variantValue().type(), QVariant::ByteArray);
-    QCOMPARE(property.value<QByteArray>(), QByteArray("Qt is great!"));
-    // Ensure that base-64 encoded strings can be retrieved as strings.
-    QCOMPARE(property.value(), QLatin1String("Qt is great!"));
+    // Again, but without the explicit "ENCODING" parameter
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("PHOTO"));
+        expectedProperty.setValue(QLatin1String("Qt is great!"));
+        expectedProperty.setValueType(QVersitProperty::BinaryType);
+        QTest::newRow("photo2")
+            << QVersitDocument::VCard21Type
+            << QByteArray("PHOTO;BASE64: U\t XQgaX MgZ\t3Jl YXQh\r\n\r\n")
+            << expectedProperty;
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("PHOTO"));
-    QCOMPARE(property.variantValue().type(), QVariant::ByteArray);
-    QCOMPARE(property.value<QByteArray>(), QByteArray("Qt is great!"));
-    QCOMPARE(property.value(), QLatin1String("Qt is great!"));
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("EMAIL"));
-    QCOMPARE(0,property.parameters().count());
-    QCOMPARE(property.value(),QString::fromAscii("john.citizen@example.com"));
+        QTest::newRow("photo2")
+            << QVersitDocument::VCard30Type
+            << QByteArray("PHOTO;B: U\t XQgaX MgZ\t3Jl YXQh\r\n\r\n")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("AGENT"));
-    QVERIFY(property.variantValue().userType() == qMetaTypeId<QVersitDocument>());
-    QCOMPARE(property.value<QVersitDocument>().properties().count(), 1);
-
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString::fromAscii("END"));
-    QCOMPARE(property.value(),QString::fromAscii("VCARD"));
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setGroups(QStringList() << QLatin1String("HOME") << QLatin1String("Springfield"));
+        expectedProperty.setName(QLatin1String("EMAIL"));
+        expectedProperty.setValue(QLatin1String("john.citizen@example.com"));
+        expectedProperty.setValueType(QVersitProperty::PlainType);
+        QTest::newRow("email qp")
+            << QVersitDocument::VCard21Type
+            << QByteArray("HOME.Springfield.EMAIL;Encoding=Quoted-Printable:john.citizen=40exam=\r\nple.com\r\n")
+            << expectedProperty;
+    }
 
-    property = mReaderPrivate->parseNextVersitProperty(type, lineReader);
-    QCOMPARE(property.name(),QString());
-    QCOMPARE(property.value(),QString());
+    {
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("EMAIL"));
+        expectedProperty.setValue(QLatin1String("john.citizen@example.com"));
+        expectedProperty.setValueType(QVersitProperty::PlainType);
+        QTest::newRow("email qp utf16")
+            << QVersitDocument::VCard21Type
+            << QByteArray("EMAIL;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-16BE:" + QTextCodec::codecForName("UTF-16BE")->fromUnicode(QLatin1String("john.citizen=40exam=\r\nple.com")) + "\r\n")
+            << expectedProperty;
+    }
 
-    // Simulate a situation where the document nesting level is exceeded
-    // In practice this would mean a big number of nested AGENT properties
-    mReaderPrivate->mDocumentNestingLevel = 20;
-    QByteArray agentProperty("AGENT:BEGIN\\:VCARD\\nFN\\:Jenny\\nEND\\:VCARD\\n\r\n");
-    buffer.close();
-    buffer.setData(agentProperty);
-    buffer.open(QIODevice::ReadOnly);
-    LineReader agentLineReader(&buffer, mAsciiCodec);
+    {
+        QVersitDocument subDocument;
+        subDocument.setType(QVersitDocument::VCard30Type);
+        QVersitProperty subProperty;
+        subProperty.setName(QLatin1String("FN"));
+        subProperty.setValue(QLatin1String("Jenny"));
+        subDocument.addProperty(subProperty);
 
-    property = mReaderPrivate->parseNextVersitProperty(type, agentLineReader);
-    QVERIFY(property.isEmpty());
+        QVersitProperty expectedProperty;
+        expectedProperty.setName(QLatin1String("AGENT"));
+        expectedProperty.setValue(QVariant::fromValue(subDocument));
+        expectedProperty.setValueType(QVersitProperty::VersitDocumentType);
+        QTest::newRow("agent")
+            << QVersitDocument::VCard21Type
+            << QByteArray("AGENT:\r\nBEGIN:VCARD\r\nFN:Jenny\r\nEND:VCARD\r\n\r\n")
+            << expectedProperty;
+    }
+#endif
 }
 
 void tst_QVersitReader::testParseVersitDocument()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QFETCH(QByteArray, vCard);
     QFETCH(bool, expectedSuccess);
     QFETCH(int, expectedProperties);
@@ -654,10 +647,12 @@
     QCOMPARE(mReaderPrivate->parseVersitDocument(lineReader, document), expectedSuccess);
     QCOMPARE(document.properties().count(), expectedProperties);
     QCOMPARE(mReaderPrivate->mDocumentNestingLevel, 0);
+#endif
 }
 
 void tst_QVersitReader::testParseVersitDocument_data()
 {
+#ifdef QT_BUILD_INTERNAL
     QTest::addColumn<QByteArray>("vCard");
     QTest::addColumn<bool>("expectedSuccess");
     QTest::addColumn<int>("expectedProperties");
@@ -754,19 +749,25 @@
                     "END:VCARD")
             << false
             << 0;
+#endif
 }
 
 void tst_QVersitReader::testDecodeQuotedPrintable()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QFETCH(QString, encoded);
 
     QFETCH(QString, decoded);
     mReaderPrivate->decodeQuotedPrintable(encoded);
     QCOMPARE(encoded, decoded);
+#endif
 }
 
 void tst_QVersitReader::testDecodeQuotedPrintable_data()
 {
+#ifdef QT_BUILD_INTERNAL
     QTest::addColumn<QString>("encoded");
     QTest::addColumn<QString>("decoded");
 
@@ -810,11 +811,13 @@
     QTest::newRow("White spaces")
             << QString::fromLatin1("=09=20")
             << QString::fromLatin1("\t ");
-
-
+#endif
 }
 void tst_QVersitReader::testParamName()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     // Empty value
     QByteArray param;
     QCOMPARE(mReaderPrivate->paramName(param, mAsciiCodec),QString());
@@ -841,11 +844,14 @@
     param = codec->fromUnicode(QString::fromAscii("TIPE=WORK"));
     QCOMPARE(mReaderPrivate->paramName(param, codec),
              QString::fromAscii("TIPE"));
-
+#endif
 }
 
 void tst_QVersitReader::testParamValue()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     // Empty value
     QByteArray param;
     QCOMPARE(mReaderPrivate->paramValue(param, mAsciiCodec),QString());
@@ -878,10 +884,14 @@
     param = codec->fromUnicode(QString::fromAscii("TYPE=WORK"));
     QCOMPARE(mReaderPrivate->paramValue(param, codec),
              QString::fromAscii("WORK"));
+#endif
 }
 
 void tst_QVersitReader::testExtractPart()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QByteArray originalStr;
 
     // Negative starting position
@@ -910,10 +920,14 @@
     // Non-empty substring, from the middle to the end
     QCOMPARE(mReaderPrivate->extractPart(originalStr,29),
              QByteArray("ENCODING=8BIT"));
+#endif
 }
 
 void tst_QVersitReader::testExtractParts()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QList<QByteArray> parts;
 
     // Empty value
@@ -971,10 +985,14 @@
     QCOMPARE(parts.count(),2);
     QCOMPARE(codec->toUnicode(parts[0]),QString::fromAscii("part1"));
     QCOMPARE(codec->toUnicode(parts[1]),QString::fromAscii("part2"));
+#endif
 }
 
 void tst_QVersitReader::testExtractPropertyGroupsAndName()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QPair<QStringList,QString> groupsAndName;
 
     // Empty string
@@ -1070,11 +1088,14 @@
     QCOMPARE(groupsAndName.first.takeFirst(),QString::fromAscii("group2"));
     QCOMPARE(groupsAndName.second,QString::fromAscii("TEL"));
     QCOMPARE(cursor.position, 36); // 2 bytes * 17 characters + 2 byte BOM.
-
+#endif
 }
 
 void tst_QVersitReader::testExtractVCard21PropertyParams()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     // No parameters
     VersitCursor cursor(QByteArray(":123"));
     cursor.setSelection(cursor.data.size());
@@ -1153,10 +1174,14 @@
     encodingParams = params.values(QString::fromAscii("CHARSET"));
     QCOMPARE(1, encodingParams.count());
     QCOMPARE(encodingParams[0],QString::fromAscii("UTF-16"));
+#endif
 }
 
 void tst_QVersitReader::testExtractVCard30PropertyParams()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     // No parameters
     VersitCursor cursor(QByteArray(":123"));
     cursor.setSelection(cursor.data.size());
@@ -1242,10 +1267,14 @@
     encodingParams = params.values(QString::fromAscii("CHARSET"));
     QCOMPARE(1, encodingParams.count());
     QCOMPARE(encodingParams[0],QString::fromAscii("UTF-16"));
+#endif
 }
 
 void tst_QVersitReader::testExtractParams()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     VersitCursor cursor;
     QByteArray data = ":123";
     cursor.setData(data);
@@ -1281,13 +1310,16 @@
     params = mReaderPrivate->extractParams(cursor, codec);
     QCOMPARE(params.size(), 2);
     QCOMPARE(cursor.position, 8);
-
+#endif
 }
 
 Q_DECLARE_METATYPE(QList<QString>)
 
 void tst_QVersitReader::testReadLine()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     QFETCH(QByteArray, codecName);
     QFETCH(QString, data);
     QFETCH(QList<QString>, expectedLines);
@@ -1318,10 +1350,12 @@
     QVERIFY(lineReader.atEnd());
 
     delete encoder;
+#endif
 }
 
 void tst_QVersitReader::testReadLine_data()
 {
+#ifdef QT_BUILD_INTERNAL
     // Note: for this test, we set mLineReader to read 10 bytes at a time.  Lines of multiples of
     // 10 bytes are hence border cases.
     QTest::addColumn<QByteArray>("codecName");
@@ -1407,6 +1441,7 @@
                 << "one\rtwo\rthree\r"
                 << (QList<QString>() << QLatin1String("one") << QLatin1String("two") << QLatin1String("three"));
     }
+#endif
 }
 
 void tst_QVersitReader::testByteArrayInput()
@@ -1433,6 +1468,9 @@
 
 void tst_QVersitReader::testRemoveBackSlashEscaping()
 {
+#ifndef QT_BUILD_INTERNAL
+    QSKIP("Testing private API", SkipSingle);
+#else
     // Empty string
     QString input;
     QVersitReaderPrivate::removeBackSlashEscaping(input);
@@ -1452,6 +1490,7 @@
     input = QString::fromAscii("\"Quoted \\n \\N \\; \\,\"");
     QVersitReaderPrivate::removeBackSlashEscaping(input);
     QCOMPARE(input, QString::fromAscii("\"Quoted \\n \\N \\; \\,\""));
+#endif
 }
 
 QTEST_MAIN(tst_QVersitReader)
--- a/qtmobility/tests/auto/qversitreader/tst_qversitreader.h	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/qversitreader/tst_qversitreader.h	Thu May 27 13:42:11 2010 +0300
@@ -79,7 +79,6 @@
      Q_OBJECT
 
 private slots: // Tests
-
     void init();
     void cleanup();
 
@@ -88,8 +87,8 @@
     void testReading();
     void testResult();
     void testSetVersionFromProperty();
-    void testParseNextVersitPropertyVCard21();
-    void testParseNextVersitPropertyVCard30();
+    void testParseNextVersitProperty();
+    void testParseNextVersitProperty_data();
     void testParseVersitDocument();
     void testParseVersitDocument_data();
     void testDecodeQuotedPrintable();
@@ -109,7 +108,9 @@
 
 private: // Data
     QVersitReader* mReader;
+#ifdef QT_BUILD_INTERNAL
     QVersitReaderPrivate* mReaderPrivate;
+#endif
     QBuffer* mInputDevice;
     QTextCodec* mAsciiCodec;
     SignalCatcher* mSignalCatcher;
--- a/qtmobility/tests/auto/support/support.pri	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/support/support.pri	Thu May 27 13:42:11 2010 +0300
@@ -1,9 +1,13 @@
 
 HEADERS += \
-    $$PWD/support.h
+    $$PWD/support.h \
+    $$PWD/../../../src/messaging/messagingutil_p.h
+
+SOURCES += $$PWD/../../../src/messaging/messagingutil.cpp
 
 symbian|wince*|maemo*|win32|mac {
     symbian {
+
         SOURCES += $$PWD/support_symbian.cpp
         INCLUDEPATH += $$(EPOCROOT)epoc32/include/app
         INCLUDEPATH += $$(EPOCROOT)epoc32/include/platform/app
--- a/qtmobility/tests/auto/support/support_symbian.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/support/support_symbian.cpp	Thu May 27 13:42:11 2010 +0300
@@ -45,6 +45,7 @@
 #include <qmessageid.h>
 #include <qmessagemanager.h>
 #include <qmessage_symbian_p.h>
+#include <messagingutil_p.h>
 
 #include <QDebug>
 
@@ -94,6 +95,9 @@
 }
 
 QTM_BEGIN_NAMESPACE
+
+using namespace MessagingUtil;
+
 class MapiSession
 {
 public:
@@ -338,7 +342,7 @@
     CleanupStack::PopAndDestroy(pImIAPPreferences);
     CleanupStack::PopAndDestroy(pEmailAccounts);
 
-    return QMessageAccountId(QString::number(popAccount.iPopService));
+    return QMessageAccountId(addIdPrefix(QString::number(popAccount.iPopService)));
 }
 
 QMessageAccountId createPopAndSmtpAccount(const TDesC& accountName, const TDesC& fromAddress)
@@ -461,7 +465,7 @@
     CleanupStack::PopAndDestroy(pImIAPPreferences);
     CleanupStack::PopAndDestroy(pEmailAccounts);
 
-    return QMessageAccountId(QString::number(imapAccount.iImapService));
+    return QMessageAccountId(addIdPrefix(QString::number(imapAccount.iImapService)));
 }
 
 QMessageAccountId createImapAndSmtpAccount(const TDesC& accountName, const TDesC& fromAddress)
@@ -516,7 +520,7 @@
     serviceEntryIdString = nullString.left(8-serviceEntryIdString.length()) + serviceEntryIdString;
     QString folderIdString = QString::number(folderId);
     folderIdString = nullString.left(8-folderIdString.length()) + folderIdString;
-    return serviceEntryIdString+folderIdString;
+    return addIdPrefix(serviceEntryIdString+folderIdString);
 }
 
 QMessageFolderId addFolder(const Parameters &params)
--- a/qtmobility/tests/auto/support/support_win.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/support/support_win.cpp	Thu May 27 13:42:11 2010 +0300
@@ -58,6 +58,8 @@
 #include <cemapi.h>
 #endif
 
+#include <messagingutil_p.h>
+
 // Missing definitions
 #ifndef PR_PST_CONFIG_FLAGS
 #define PR_PST_CONFIG_FLAGS PROP_TAG( PT_LONG, 0x6770 )
@@ -386,7 +388,7 @@
         encodedIdStream << recordKey;
     }
 
-	return QMessageAccountId(QString("WIN_")+encodedId.toBase64());
+    return QMessageAccountId(MessagingUtil::addIdPrefix(encodedId.toBase64()));
 }
 
 QMessageFolderId folderIdFromProperties(const QByteArray &recordKey, const QByteArray &entryId, const QByteArray &storeKey)
@@ -407,7 +409,7 @@
 #endif
     }
 
-	return QMessageFolderId(QString("WIN_") + encodedId.toBase64());
+    return QMessageFolderId(MessagingUtil::addIdPrefix(encodedId.toBase64()));
 }
 
 QByteArray objectProperty(IMAPIProp *object, ULONG tag)
--- a/qtmobility/tests/auto/symbian/qmediaplayer_s60/tst_qmediaplayer_s60.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/symbian/qmediaplayer_s60/tst_qmediaplayer_s60.cpp	Thu May 27 13:42:11 2010 +0300
@@ -42,14 +42,14 @@
 #include <QtTest/QtTest>
 #include <QtCore>
 #include <QtGui>
- #include <QFile>
+#include <QFile>
 
-#include <QMediaPlayer>
-#include <QMediaPlayerControl>
-#include <QMediaPlaylist>
-#include <QMediaService>
-#include <QMediaStreamsControl>
-#include <QVideoWidget>
+#include <qmediaplayer.h>
+#include <qmediaplayercontrol.h>
+#include <qmediaplaylist.h>
+#include <qmediaservice.h>
+#include <qmediastreamscontrol.h>
+#include <qvideowidget.h>
 
 QT_USE_NAMESPACE
 
--- a/qtmobility/tests/auto/symbian/symbian.pro	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/auto/symbian/symbian.pro	Thu May 27 13:42:11 2010 +0300
@@ -12,7 +12,7 @@
     SUBDIRS += \             
             qmediaobject_s60 \
             qmediaplayer_s60 \
-            qmediaplaylist_s60 \
+#            qmediaplaylist_s60 \
             qradiotuner_s60 \
             qmediarecorder_s60
 }
--- a/qtmobility/tests/messagingex/messagingex.cpp	Fri May 14 16:41:33 2010 +0300
+++ b/qtmobility/tests/messagingex/messagingex.cpp	Thu May 27 13:42:11 2010 +0300
@@ -289,7 +289,7 @@
     
     if (!QString(phoneNumberEdit->text()).isEmpty())
     {
-        if (!m_service.send(message))
+        if (m_service.send(message))
         {
             QMessageBox msgBox;
             msgBox.setStandardButtons(QMessageBox::Close);
@@ -321,7 +321,7 @@
     
     if (!QString(mmsPhoneNumberEdit->text()).isEmpty())
     {
-        if (!m_service.send(message))
+        if (m_service.send(message))
         {
             QMessageBox msgBox;
             msgBox.setStandardButtons(QMessageBox::Close);
@@ -693,7 +693,7 @@
         QMessageFolder folder;
         folder = m_manager.folder(ids[i]);
         QString name = folder.name();
-        folderComboBox->addItem(name, folder.id().toString());    
+        folderComboBox->addItem(name, folder.id().toString());
     }
 }