--- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicongrid.cpp Tue Apr 27 16:24:22 2010 +0300
+++ b/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicongrid.cpp Tue May 11 16:01:07 2010 +0300
@@ -550,8 +550,10 @@
TInt oldSelection = iCursorPos;
TPoint hitPos = aPointerEvent.iPosition;
- // Convert XY position to linear cursor position
- hitPos -= iFirstCell.iTl;
+ // Convert XY position to linear cursor position
+ TPoint cellLeftTop( KTopLeft_x,KTopLeft_y );
+ hitPos -= cellLeftTop;
+
TInt xPos = hitPos.iX / iCellWidth;
TInt yPos = hitPos.iY / iCellHeight;
TInt newSelection = yPos * iMaxColumns + xPos;
--- a/servicewidget/inc/servicewidgetcpglobals.h Tue Apr 27 16:24:22 2010 +0300
+++ b/servicewidget/inc/servicewidgetcpglobals.h Tue May 11 16:01:07 2010 +0300
@@ -67,6 +67,8 @@
//Supported Commands
_LIT8( KAdd, "Add" );
+_LIT8(KGetList,"GetList");
+_LIT8(KResults,"results");
// Input arguments
_LIT8( KType, "type" );
_LIT8( KItem, "item" );
@@ -114,7 +116,7 @@
_LIT(KServiceWidget, "servicewidget");
//UID 20021383 is of Publisher used here as constant to avoid conflict with any other
//Homescreen widget.This will be suffix to publisher name to make unique id for theme.
-_LIT( KThemeUid, "_20021383");
+_LIT( KThemeUid, ":0x20021383");
_LIT8( KTemplateType, "template_type");
_LIT8( KWidgetName, "widget_name");
_LIT8( KWidgetInfo, "widget_info");
--- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetcontentpublisher.h Tue Apr 27 16:24:22 2010 +0300
+++ b/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetcontentpublisher.h Tue May 11 16:01:07 2010 +0300
@@ -95,6 +95,11 @@
* @param aPublisherId, publisher id
*/
void UnregisterWidgetL(const TDesC& aPublisherId );
+
+ /**
+ * Unregister all widgets from CPS
+ */
+ void UnregisterAllWidgetsL();
/**
* Register widget from CPS
--- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetcontentpublisher.cpp Tue Apr 27 16:24:22 2010 +0300
+++ b/servicewidget/servicewidgetdatapublisher/src/cservicewidgetcontentpublisher.cpp Tue May 11 16:01:07 2010 +0300
@@ -30,6 +30,8 @@
#include <servicewidgetpluginres.rsg>
#include <StringLoader.h>
+#define KSW_LIST_GRANULARITY 8
+
// ---------------------------------------------------------------------------
// CServiceWidgetContentPublisher::CServiceWidgetContentPublisher
// ---------------------------------------------------------------------------
@@ -230,8 +232,8 @@
cpdatamap->InsertL( KContentType, TLiwVariant( KTemplateWidget ));
cpdatamap->InsertL( KContentId, TLiwVariant( KAll ));
//Take widget name as "service name"
- //Give widget name here which will be displayed in HomeScreen Add Content menu
- datamap->InsertL( KWidgetName, TLiwVariant( aPublisherId ));
+ //Give widget name here which will be displayed in HomeScreen Add Content menu
+ datamap->InsertL( KWidgetName, TLiwVariant( aPublisherId.Left( aPublisherId.Length()-KThemeUid().Length() ) ) );
datamap->InsertL( KTemplateType, TLiwVariant( KServiceWidget ));
//To publish logo and widget description
@@ -302,8 +304,8 @@
//
void CServiceWidgetContentPublisher::UnregisterWidgetL(const TDesC& aPublisherId )
{
- TRACE_SWP(TXT("CServiceWidgetContentPublisher::RegisterForObserverL() start") );
-
+ TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterWidgetL() start") );
+ TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterWidgetL() ServiceName %S"), &aPublisherId);
CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
CLiwDefaultMap* cpdatamap= CLiwDefaultMap::NewLC();
@@ -324,6 +326,85 @@
}//end UnregisterWidget
// ---------------------------------------------------------------------------
+// CServiceWidgetContentPublisher::UnregisterAllWidgetsL
+// ---------------------------------------------------------------------------
+//
+void CServiceWidgetContentPublisher::UnregisterAllWidgetsL()
+ {
+ TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterAllWidgetsL() start") );
+
+ CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
+ CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
+ CLiwDefaultMap* cpdatamap= CLiwDefaultMap::NewLC();
+
+ cpdatamap->InsertL( KPublisherId, TLiwVariant( KAll ));
+ cpdatamap->InsertL( KContentType, TLiwVariant( KTemplateWidget ));
+ cpdatamap->InsertL( KContentId, TLiwVariant( KAll ));
+
+ // fill in input list for GetList command
+ inparam->AppendL(TLiwGenericParam(KType, TLiwVariant(KPublisher)));
+ inparam->AppendL(TLiwGenericParam(KData, TLiwVariant(cpdatamap)));
+
+ iMsgInterface->ExecuteCmdL(KGetList, *inparam, *outparam, 0, this );
+ CDesC16ArrayFlat* serviceNames = new (ELeave) CDesC16ArrayFlat( KSW_LIST_GRANULARITY );
+ CleanupStack::PushL( serviceNames );
+
+ if(outparam)
+ {
+ TInt pos(0);
+ const TLiwGenericParam* param = NULL;
+ param = outparam->FindFirst(pos,KResults);
+ if(pos != KErrNotFound)
+ {
+ HBufC* uidStr = KThemeUid().AllocLC();
+ TLiwVariant variant = (*outparam)[pos].Value();
+ variant.PushL();
+
+ CLiwIterable* iterable = variant.AsIterable();
+ iterable->Reset();
+
+ while ( iterable->NextL( variant ) )
+ {
+ CLiwDefaultMap *map = CLiwDefaultMap::NewLC();
+ variant.Get( *map );
+ if ( map->FindL( KPublisherId, variant) )
+ {
+ if(variant.AsDes().Length() >= KThemeUid().Length())
+ {
+ TPtrC tempUidStr;
+ tempUidStr.Set(variant.AsDes().Right(KThemeUid().Length()));
+ if( 0 == tempUidStr.Compare(uidStr->Des()))
+ {
+ //If publisher id has KThemeUid, then this services is
+ //registered by this component
+ serviceNames->AppendL(variant.AsDes());
+ }
+ }
+ }
+ CleanupStack::PopAndDestroy( map );
+ } //End of while
+
+ CleanupStack::PopAndDestroy( &variant );
+ CleanupStack::PopAndDestroy( uidStr );
+ } //End of if(pos != KErrNotFound)
+ }
+
+ TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterAllWidgetsL():ServiceCountForDeletion %d"), serviceNames->Count());
+ for(TInt i=0; i<serviceNames->Count();i++)
+ {
+ UnregisterWidgetL((*serviceNames)[i]);
+ }
+
+ CleanupStack::PopAndDestroy(serviceNames);
+ CleanupStack::PopAndDestroy(cpdatamap);
+ outparam->Reset();
+ inparam->Reset();
+
+ TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterAllWidgetsL() end") );
+ }
+
+
+// ---------------------------------------------------------------------------
// CServiceWidgetContentPublisher::RemoveWidgetDataL
// ---------------------------------------------------------------------------
//
--- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetplugin.cpp Tue Apr 27 16:24:22 2010 +0300
+++ b/servicewidget/servicewidgetdatapublisher/src/cservicewidgetplugin.cpp Tue May 11 16:01:07 2010 +0300
@@ -203,6 +203,11 @@
void CServiceWidgetPlugin::UpdateL()
{
TRACE_SWP(TXT("CServiceWidgetPlugin::UpdateL() Start") );
+ //Unregisrer all previously registered services.
+ if(iContentPublisher)
+ {
+ iContentPublisher->UnregisterAllWidgetsL();
+ }
//register for service table notifications
RArray<TUint> serviceIds;
CleanupClosePushL( serviceIds );
--- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetservicemanager.cpp Tue Apr 27 16:24:22 2010 +0300
+++ b/servicewidget/servicewidgetdatapublisher/src/cservicewidgetservicemanager.cpp Tue May 11 16:01:07 2010 +0300
@@ -88,6 +88,11 @@
settings->FindEntryL( iServiceId, *entry ) ;
// set the service name to presence cache updater
iServiceName = entry->GetServiceName().AllocL() ;
+
+ //KThemeUid appended to iServiceName for making service name unique from serivces
+ //published by other applications
+ iServiceName = iServiceName->ReAllocL(iServiceName->Des().Length() + KThemeUid().Length());
+ iServiceName->Des().Append(KThemeUid);
CleanupStack::PopAndDestroy(2); // entry,settings
iBrandHandler = CServiceWidgetBrandHandler::NewL(iServiceId);
@@ -218,7 +223,12 @@
TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() service is complete") );
// service configured correctly
- TPtrC serviceName = iServiceName->Left( KIMWCP_FIRSTTEXT_SIZE );
+ TPtrC serviceNameWithUID = iServiceName->Left( KIMWCP_FIRSTTEXT_SIZE );
+
+ //serviceName is retrieved by removing KThemeUID. This text is displayed in first line of
+ //home screen widget when iServiceState state is ESWSNotRegistered state.
+ TPtrC serviceName = serviceNameWithUID.Left( serviceNameWithUID.Length() - KThemeUid().Length() );
+
TPtrC ownUser = ServiceWidgetUtils::DisplayId( iCchHandler->OwnUserIdL().Left( KIMWCP_FIRSTTEXT_SIZE ) );
switch( iServiceState )
{
@@ -727,8 +737,9 @@
// please note this is boot blugin so keep lesser memory use
if( !iPresenceHandler && iCchHandler->IsSubServiceSupported( ECCHPresenceSub ) )
{
- TPtrC ownId = iCchHandler->OwnUserIdL();
- iPresenceHandler = CServiceWidgetPresenceHandler::NewL(*this,*iServiceName,ownId );
+ TPtrC ownId = iCchHandler->OwnUserIdL();
+ TPtrC str = iServiceName->Des().Left(iServiceName->Des().Length()-KThemeUid().Length());
+ iPresenceHandler = CServiceWidgetPresenceHandler::NewL(*this,str,ownId );
iPresenceHandler->GetConnectedSessionL( iCchHandler->XimpAdaptationUidL(), iServiceId );
TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iPresenceHandler cretaed ") );
}
--- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.xml Tue Apr 27 16:24:22 2010 +0300
+++ b/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.xml Tue May 11 16:01:07 2010 +0300
@@ -7,8 +7,7 @@
<contentsource id="servicewidget" name="" value="0x20019594"/>
<configuration name="service" value="Service.ContentPublishing"/>
<configuration name="interface" value="IContentPublishing"/>
- <configuration name="command" value="GetList"/>
- <configuration name="publisher" value="servicewidget"/>
+ <configuration name="command" value="GetList"/>
<configuration id="pub_id" name="publisher" value=""/>
<!-- Template designer choice -->
--- a/uiservicetab/inc/uiservicetabtracer.h Tue Apr 27 16:24:22 2010 +0300
+++ b/uiservicetab/inc/uiservicetabtracer.h Tue May 11 16:01:07 2010 +0300
@@ -31,10 +31,15 @@
// 2 = Log to file (RFileLogger)
// --------------------------------------------------------------------------
//
+
#ifdef __WINS__
- #define TRACER_LOG_METHOD 1 // for WINS
+ #ifdef _DEBUG
+ #define TRACER_LOG_METHOD 1 // for WINS UDEB
+ #else
+ #define TRACER_LOG_METHOD 0 // for WINS UREL
+ #endif
#else
- #define TRACER_LOG_METHOD 2 // for device
+ #define TRACER_LOG_METHOD 2 // for device
#endif
#endif