Skip to content

Commit

Permalink
Merge pull request #7 from kavuri/syncml_ds_tool_support
Browse files Browse the repository at this point in the history
Syncml ds tool support
  • Loading branch information
bwachter committed Aug 23, 2013
2 parents 92e49c8 + 888e781 commit a028b08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/ChangeLog.cpp
Expand Up @@ -280,6 +280,7 @@ bool ChangeLog::loadAnchors( QSqlDatabase& aDbHandle )
const QString queryString( "SELECT local_sync_anchor, remote_sync_anchor, last_sync_time FROM change_logs WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );

QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
Expand Down Expand Up @@ -322,6 +323,7 @@ bool ChangeLog::saveAnchors( QSqlDatabase& aDbHandle )
const QString queryString( "INSERT INTO change_logs(remote_device, source_db_uri, sync_direction, local_sync_anchor, remote_sync_anchor, last_sync_time) VALUES (:remote_device, :source_db_uri, :sync_direction, :local_sync_anchor, :remote_sync_anchor, :last_sync_time)" );

QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
Expand Down Expand Up @@ -366,6 +368,7 @@ bool ChangeLog::removeAnchors( QSqlDatabase& aDbHandle )
const QString queryString( "DELETE FROM change_logs WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );

QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
Expand All @@ -390,6 +393,7 @@ bool ChangeLog::loadMaps( QSqlDatabase& aDbHandle )
const QString queryString("SELECT local_id, remote_id FROM id_maps WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );

QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
Expand Down Expand Up @@ -428,6 +432,7 @@ bool ChangeLog::saveMaps( QSqlDatabase& aDbHandle )
const QString queryString( "INSERT INTO id_maps(remote_device, source_db_uri, sync_direction, local_id, remote_id) values(:remote_device, :source_db_uri, :sync_direction, :local_id, :remote_id)" );

QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );

QVariantList device;
QVariantList sourceDbURI;
Expand Down Expand Up @@ -481,6 +486,7 @@ bool ChangeLog::removeMaps( QSqlDatabase& aDbHandle )
const QString queryString( "DELETE FROM id_maps WHERE remote_device = :remote_device AND source_db_uri = :source_db_uri AND sync_direction = :sync_direction" );

QSqlQuery query( queryString, aDbHandle );
query.prepare( queryString );
query.bindValue( ":remote_device", iRemoteDevice );
query.bindValue( ":source_db_uri", iSourceDbURI );
query.bindValue( ":sync_direction", iSyncDirection );
Expand Down
5 changes: 4 additions & 1 deletion src/LocalChangesPackage.cpp
Expand Up @@ -393,7 +393,10 @@ bool LocalChangesPackage::processItem( const SyncItemKey& aItemKey,
LOG_DEBUG( "Writing chunk of" << aSizeThreshold << "bytes" );
// Need to send more chunks after this one
item->read( iLargeObjectState.iOffset, aSizeThreshold, data );
aParent.addSizeMetadata( size );
// syncml-ds-tool from libsyncml complains that
// consecutive package of a single message should
// not have size in header
//aParent.addSizeMetadata( size );
itemObject->insertData( data );
itemObject->insertMoreData();
iLargeObjectState.iOffset += aSizeThreshold;
Expand Down
3 changes: 2 additions & 1 deletion src/src.pro
Expand Up @@ -122,7 +122,8 @@ OTHER_FILES += config/meego-syncml-conf.xsd \

LIBS += -lsqlite3 -lwbxml2 -lopenobex

QTDIR = /usr/lib/qt4
equals(QT_MAJOR_VERSION, 4): QTDIR = /usr/lib/qt4
equals(QT_MAJOR_VERSION, 5): QTDIR = /usr/lib/qt5

QT += network \
xml \
Expand Down

0 comments on commit a028b08

Please sign in to comment.