X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Finclude%2Fqtrapids%2Fdbus.hpp;h=103c950c78c9ba83f40dcc25c3830ec94e19b1db;hb=fdb78d7880be7bc82544e66efd5acb3da74a617a;hp=433aa16369298947fb5bcdba3c29a52d386c6870;hpb=5fff20c40f52af8641f4139e48de74db40d43ca8;p=qtrapids diff --git a/src/include/qtrapids/dbus.hpp b/src/include/qtrapids/dbus.hpp index 433aa16..103c950 100644 --- a/src/include/qtrapids/dbus.hpp +++ b/src/include/qtrapids/dbus.hpp @@ -13,6 +13,14 @@ namespace qtrapids struct TorrentState { + + enum torrent_action + { + action_add, + action_remove, + action_update + }; + TorrentState() : hash("") , name("") @@ -24,11 +32,11 @@ namespace qtrapids , leeches(0) , ratio(0) , total_size(0) - { } + { } QString hash; QString name; - bool is_new; + torrent_action action; uint state; uint progress; uint down_rate; @@ -49,7 +57,7 @@ namespace qtrapids { std::cout << "serialize" << std::endl; argument.beginStructure(); - argument << state.hash << state.name << state.is_new << state.state << state.progress + argument << state.hash << state.name << (uint)(state.action) << state.state << state.progress << state.down_rate << state.up_rate << state.seeds << state.leeches << state.ratio << state.total_size; argument.endStructure(); @@ -61,9 +69,11 @@ namespace qtrapids { std::cout << "deserialize" << std::endl; argument.beginStructure(); - argument >> state.hash >> state.name >> state.is_new >> state.state >> state.progress + uint action; + argument >> state.hash >> state.name >> action >> state.state >> state.progress >> state.down_rate >> state.up_rate >> state.seeds >> state.leeches >> state.ratio >> state.total_size; + state.action = (TorrentState::torrent_action)action; argument.endStructure(); return argument; }