Skip to content

Commit

Permalink
Modified contact with avatar in S60 (N95) is duplicated from device …
Browse files Browse the repository at this point in the history
…sync due to largeObject setKey name.
  • Loading branch information
Amit committed Oct 18, 2010
1 parent c905c3b commit 7b8c432
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
libmeegosyncml (0.4.9-42) unstable; urgency=low

* Fixes: NB#198456 - Modified contact with avatar in S60 (N95) is duplicated in device after resync from device.

-- Amit <amit.5.aggarwal@nokia.com> Thu, 18 Oct 2010 15:16:32 +0530

libmeegosyncml (0.4.9-41) unstable; urgency=low

* Fixed a couple of issues seen with google sync - not handling percent encoded
Expand Down
2 changes: 1 addition & 1 deletion src/CommandHandler.cpp
Expand Up @@ -406,7 +406,7 @@ void CommandHandler::composeBatches( const SyncParams& aSyncParams, SyncTarget&

}
// Normal object
else if( !aStorageHandler.addItem( id, *aTarget.getPlugin(), QString(), parentKey,
else if( !aStorageHandler.addItem( id, *aTarget.getPlugin(), parentKey,
type, format, item.data ) ) {
aResponses.insert( id, COMMAND_FAILED );
}
Expand Down
17 changes: 9 additions & 8 deletions src/StorageHandler.cpp
Expand Up @@ -63,7 +63,6 @@ StorageHandler::~StorageHandler()

bool StorageHandler::addItem( const ItemId& aItemId,
StoragePlugin& aPlugin,
const SyncItemKey& aLocalKey,
const SyncItemKey& aParentKey,
const QString& aType,
const QString& aFormat,
Expand All @@ -85,7 +84,8 @@ bool StorageHandler::addItem( const ItemId& aItemId,
return false;
}

newItem->setKey( aLocalKey );
//Setting empty string as we dont have any local key for it.
newItem->setKey(QString());
newItem->setParentKey( aParentKey );
newItem->setType( aType );
newItem->setFormat( aFormat );
Expand Down Expand Up @@ -129,7 +129,7 @@ bool StorageHandler::replaceItem( const ItemId& aItemId,

if( !item ) {
LOG_DEBUG( "Could not find item, processing as Add" );
return addItem( aItemId, aPlugin, aLocalKey, aParentKey, aType, aFormat, aData );
return addItem( aItemId, aPlugin, aParentKey, aType, aFormat, aData );
}

item->setParentKey( aParentKey );
Expand Down Expand Up @@ -187,7 +187,8 @@ bool StorageHandler::startLargeObjectAdd( StoragePlugin& aPlugin,
return false;
}

newItem->setKey( aRemoteKey);
//Setting empty string as we dont have any local key for it.
newItem->setKey(QString());
newItem->setParentKey( aParentKey );
newItem->setType( aType );
newItem->setFormat( aFormat );
Expand Down Expand Up @@ -306,7 +307,7 @@ bool StorageHandler::finishLargeObject( const ItemId& aItemId )
return false;
}

if( iLargeObject->getKey()->isEmpty() ) {
if(iLargeObject->getKey()->isEmpty()) {
LOG_DEBUG( "Queuing large object for addition" );
iAddList.insert( aItemId, iLargeObject );
}
Expand Down Expand Up @@ -423,10 +424,10 @@ QMap<ItemId, CommitResult> StorageHandler::commitReplacedItems( StoragePlugin& a
CommitResult result;

result.iItemKey = *i.value()->getKey();
result.iStatus = COMMIT_INIT_REPLACE;
result.iStatus = COMMIT_INIT_REPLACE;

iId.iCmdId = i.key().iCmdId;
iId.iItemIndex = i.key().iItemIndex;
iId.iItemIndex = i.key().iItemIndex;

LOG_DEBUG( "Checking item" << iId.iCmdId <<"/" << iId.iItemIndex << "for conflict" );

Expand All @@ -443,7 +444,7 @@ QMap<ItemId, CommitResult> StorageHandler::commitReplacedItems( StoragePlugin& a
else {
LOG_DEBUG( "Conflict resolved, remote side wins" );
result.iConflict = CONFLICT_REMOTE_WIN;
aConflictResolver->revertLocalChange ( result.iItemKey, CR_REMOVE_LOCAL );
aConflictResolver->revertLocalChange ( result.iItemKey, CR_REMOVE_LOCAL );
}
}
else {
Expand Down
2 changes: 0 additions & 2 deletions src/StorageHandler.h
Expand Up @@ -143,7 +143,6 @@ class StorageHandler : public QObject
*
* @param aItemId Item identification
* @param aPlugin Local storage plugin
* @param aLocalKey Local key of the item or empty
* @param aParentKey Key of the parent of this item (local id)
* @param aType MIME type of the item
* @param aFormat Format of the item
Expand All @@ -152,7 +151,6 @@ class StorageHandler : public QObject
*/
bool addItem( const ItemId& aItemId,
StoragePlugin& aPlugin,
const SyncItemKey& aLocalKey,
const SyncItemKey& aParentKey,
const QString& aType,
const QString& aFormat,
Expand Down
2 changes: 1 addition & 1 deletion tests_meego/StorageHandlerTest.cpp
Expand Up @@ -55,7 +55,7 @@ void StorageHandlerTest::testAddItem()
LocalChanges changes;
ConflictResolver resolver( changes, PREFER_LOCAL_CHANGES );

QVERIFY( iStorageHandler.addItem( id, storage, QString(), parent, type, format, data ) );
QVERIFY( iStorageHandler.addItem( id, storage, parent, type, format, data ) );

QMap<ItemId, CommitResult> commits = iStorageHandler.commitAddedItems( storage, &resolver );
QList<CommitResult> results = commits.values();
Expand Down

0 comments on commit 7b8c432

Please sign in to comment.