qthighway/xqserviceutil/src/xqservicemanager.cpp
changeset 19 46686fb6258c
parent 15 1f895d8a5b2b
child 24 9d760f716ca8
--- a/qthighway/xqserviceutil/src/xqservicemanager.cpp	Tue Jul 06 15:12:50 2010 +0300
+++ b/qthighway/xqserviceutil/src/xqservicemanager.cpp	Wed Aug 18 10:38:12 2010 +0300
@@ -82,6 +82,7 @@
         TApaAppInfo  iAppInfo;
         int iLatestError;
         RApaLsSession iApaSession;
+        XQAiwInterfaceDescriptor iImplDescriptor; 
     };
 
 XQServiceManager::XQServiceManager()
@@ -155,7 +156,6 @@
     QList<XQAiwInterfaceDescriptor> interfaces;
     TUid appUid;
     interfaces.clear(); 
-    // Catenate to get full name
     TInt error=d->Discover(serviceName + "." + interfaceName, appUid, interfaces,
                            XQServiceManagerPrivate::MatchServiceAndInterfaceName);
     return interfaces;
@@ -163,7 +163,7 @@
 
 
 /*!
-    Finds implementations for the given interface
+    Finds the first implementation for the given interface name.
     \param interfaceName Interfacename to match
     \return List of implementations
 */
@@ -178,7 +178,7 @@
 }
 
 /*!
-    Finds implementations for the given interface implemented by given service
+    Finds the first implementation for the given service + interface names
     \param serviceName Service name
     \param interfaceName Interfacename to match
     \return List of implementations
@@ -196,7 +196,6 @@
 }
 
 
-
 /*!
     Returns the latest error occured
 */
@@ -244,6 +243,7 @@
     TPtrC serverName( reinterpret_cast<const TUint16*>(aService.utf16()) );
     if (util->mDescriptor.isValid()) 
     {
+        iImplDescriptor=util->mDescriptor;  // Descriptor given by caller
         appUid.iUid = util->mDescriptor.property(XQAiwInterfaceDescriptor::ImplementationId).toInt();
         XQSERVICE_DEBUG_PRINT("ApplicationUid from descriptor: %x", appUid.iUid);
     }
@@ -254,6 +254,10 @@
     {
         // Find the first implementation
         error = Discover(serverName,appUid,interfaces, XQServiceManagerPrivate::MatchServiceAndInterfaceName, true);
+        if (interfaces.count())
+        {
+            iImplDescriptor=interfaces[0];  // Descriptor search upon start
+        }
     }
     if (error)
         {
@@ -362,7 +366,8 @@
         QStringList l = util->mOperation.split("("); 
         QString oper = l.value(0); //  // Pick only the function name and ignore parameters
         
-        startupArgs += (" " + QString::fromLatin1(XQServiceUtils::StartupArgInterfaceName) + util->mDescriptor.interfaceName() );
+        startupArgs += (" " + QString::fromLatin1(XQServiceUtils::StartupArgInterfaceName) + iImplDescriptor.interfaceName() );
+        startupArgs += (" " + QString::fromLatin1(XQServiceUtils::StartupArgServiceName) + iImplDescriptor.serviceName() );
         startupArgs += (" " + QString::fromLatin1(XQServiceUtils::StartupArgOperationName) + oper);
         
         XQSERVICE_DEBUG_PRINT("\tStartupArgs:%s", qPrintable(startupArgs));