This attribute is the boolean value, server to inform client it has not
notified client about this torrent yet to avoid information flow
synchronization issues
git-svn-id: file:///svnroot/qtrapids/trunk@27
42ac0dd5-4c8c-4c71-bb3e-
ecdfe252ffda
</method>
<signal name="alert">
- <arg type="(ssuuuuuuut)" name="info" direction="out"/>
+ <arg type="(ssbuuuuuuut)" name="info" direction="out"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.In0"
value="qtrapids::TorrentState"/>
<arg type="a{ss}" name="other_info" direction="out"/>
{
DownloadItems_t::iterator p = items_.find(info.hash);
if (p != items_.end()) {
+ if (info.is_new) {
+ qWarning() << "item with similar info hash marked as new";
+ }
updateItem_(p.value(), info, other_info);
} else {
+ if (!info.is_new) {
+ qDebug() << "torrent info arrived but there is no torrent for it";
+ return;
+ }
addItem_(info, other_info);
}
}
QString hash;
QString name;
+ bool is_new;
uint state;
uint progress;
uint down_rate;
{
std::cout << "serialize" << std::endl;
argument.beginStructure();
- argument << state.hash << state.name << state.state << state.progress
+ argument << state.hash << state.name << state.is_new << state.state << state.progress
<< state.down_rate << state.up_rate << state.seeds
<< state.leeches << state.ratio << state.total_size;
argument.endStructure();
{
std::cout << "deserialize" << std::endl;
argument.beginStructure();
- argument >> state.hash >> state.name >> state.state >> state.progress
+ argument >> state.hash >> state.name >> state.is_new >> state.state >> state.progress
>> state.down_rate >> state.up_rate >> state.seeds
>> state.leeches >> state.ratio >> state.total_size;
argument.endStructure();
TorrentState state;
state.hash = Hash2QStr(handle.hash());
+ state.is_new = false;
state.state = handle.state();
state.progress = handle.progress() * torrent_progress_max;
state.down_rate = handle.downloadRate();
state.hash = hash;
state.name = handle->name();
+ state.is_new = true;
state.state = handle->state();
state.progress = handle->progress() * torrent_progress_max;
state.down_rate = handle->downloadRate();
state.hash = hash;
state.name = handle->name();
+ state.is_new = true;
state.state = handle->state();
state.progress = handle->progress() * torrent_progress_max;
state.down_rate = handle->downloadRate();