--- a/locationmanager/locationtrail/src/clocationrecord.cpp Mon Aug 23 13:33:21 2010 +0300
+++ b/locationmanager/locationtrail/src/clocationrecord.cpp Fri Sep 03 10:57:50 2010 +0300
@@ -32,10 +32,7 @@
#include "locationtraildefs.h"
#include "locationtrailpskeys.h"
#include "mdeconstants.h"
-#ifdef LOC_REVERSEGEOCODE
-#include "reversegeocoderplugin.h"
-const TUid KReverseGeoCodeUid = {0x2002DD12};
-#endif
+
using namespace MdeConstants;
@@ -136,15 +133,13 @@
#ifdef LOC_REVERSEGEOCODE
iTagCreator = CTagCreator::NewL();
- iRevGeocoderPlugin = reinterpret_cast<CReverseGeoCoderPlugin*>(
- REComSession::CreateImplementationL(KReverseGeoCodeUid,iDtorKey));
- if( iRevGeocoderPlugin )
- {
- iRevGeocoderPlugin->AddObserverL(*this);
+ TInt pluginerr = KErrNone;
+ TRAP(pluginerr,iRevGeocoderPlugin = CReverseGeoCoderPlugin::NewL());
+
+ if(pluginerr == KErrNone)
+ {
+ iRevGeocoderPlugin->AddObserverL(*this);
}
-
-
-
#endif
@@ -257,7 +252,6 @@
// set the pointer to NULL, ECOM will destroy object.
delete iRevGeocoderPlugin;
iRevGeocoderPlugin = NULL;
- REComSession::DestroyedImplementation(iDtorKey);
#endif
LOG( "CLocationRecord::~CLocationRecord(), end" );
}
@@ -1116,6 +1110,7 @@
delete firstPtr;
firstPtr = NULL;
}
+ //check newItem for validity
else if (newItem)
{
// country tag not found.. go for reverse geocoding..
@@ -1820,6 +1815,7 @@
CMdEObject& locationObject = static_cast<CMdEObject&>(item);
locationId = locationObject.Id();
+ iMediaItems[0]->iLocationId = locationId;
TRAP( error, CreateRelationL( iMediaItems[0]->iObjectId, locationId ) );
#ifdef LOC_REVERSEGEOCODE
//check if found location object has lat, long