From: Kevron Rees Date: Mon, 27 Oct 2014 16:42:31 +0000 (-0700) Subject: fixed database playback X-Git-Tag: 0.12.903~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e8c48f8dba006d7965765cca1dc40373da49e85;p=profile%2Fivi%2Fautomotive-message-broker.git fixed database playback --- diff --git a/examples/databasesource.in b/examples/databasesource.in index ccfa491..69ab8cb 100644 --- a/examples/databasesource.in +++ b/examples/databasesource.in @@ -4,7 +4,7 @@ "name" : "Database Source", "path" : "@PLUGIN_INSTALL_PATH@/databasesinkplugin.so", "playbackOnLoad" : "true", - "databaseFile" : "generated.db" + "databaseFile" : "/tmp/storage" } ], "sinks": [ diff --git a/plugins/database/databasesink.cpp b/plugins/database/databasesink.cpp index dbc141e..318cd67 100644 --- a/plugins/database/databasesink.cpp +++ b/plugins/database/databasesink.cpp @@ -329,16 +329,14 @@ void DatabaseSink::startPlayback() obj.key = results[i][0]; obj.value = results[i][1]; obj.source = results[i][2]; - obj.time = boost::lexical_cast(results[i][3]); - - /// TODO: figure out why sequence is broken: - -// obj->sequence = boost::lexical_cast(results[i][4]); + obj.zone = boost::lexical_cast(results[i][3]); + obj.time = boost::lexical_cast(results[i][4]); + obj.sequence = boost::lexical_cast(results[i][5]); playbackShared->playbackQueue.push_back(obj); } - g_timeout_add(0,getNextEvent,playbackShared); + g_timeout_add(0, getNextEvent, playbackShared); } void DatabaseSink::initDb() diff --git a/plugins/database/databasesink.h b/plugins/database/databasesink.h index 2ec319f..bb9697a 100644 --- a/plugins/database/databasesink.h +++ b/plugins/database/databasesink.h @@ -172,7 +172,8 @@ public: bool operator ==(const DBObject & other) const { - return (key == other.key && source == other.source && zone == other.zone); + return (key == other.key && source == other.source && zone == other.zone && + value == other.value && sequence == other.sequence && time == other.time); } bool operator != (const DBObject & other)