http://bugzilla.moblin.org/show_bug.cgi?id=8049
--- Comment #7 from yongsheng zhu <[email protected]> 2009-11-24 01:47:16 PST --- (In reply to comment #6) > (In reply to comment #5) > > Current implementation means "the hash will contain a value 0 if there is no > > data in the sync report". > > Ooops! I hadn't noticed that you implemented your own formatter for a > SyncReport. We really need a better tool for code reviews, and/or more time > :-/ > We already have an implementation for such a formatter in: > > /** write report into a ConfigNode */ > ConfigNode &operator << (ConfigNode &node, const SyncReport &report); > > /** read report from a ConfigNode */ > ConfigNode &operator >> (ConfigNode &node, SyncReport &report); > > This code should have been adapted to work with key/value pairs and thus be > reused in the D-Bus API. > > > The table I used in the dbus server I think is to cover all possible > > combinations according to previous implementation. A entry is set no matter > > whether there is no data in the sync report. > > Regarding 0 values: by storing empty values as 0 explicitly, isn't the result > quite a bit larger than necessary? > > Are you sure that your code stores 0 explicitly? The code seems to skip them: > if(statTable[i][j][k] == 0) { > continue; > } I think not all combinations of these three variables are meaningful.Only 13 combinations are sent to dbus client in the previous implementation so I followed it. ok, I'll implement it according to the code in the syncML.cpp. I should follow this. My question is: There are other key-value pairs in write report function, do we also need send them to dbus client? These are: node.setProperty("start", static_cast<long>(report.getStart())); node.setProperty("end", static_cast<long>(report.getEnd())); node.setProperty("status", static_cast<int>(report.getStatus())); const std::string &name = entry.first; const SyncSourceReport &source = entry.second; string prefix = name; boost::replace_all(prefix, "_", "__"); boost::replace_all(prefix, "-", "_+"); prefix = "source-" + prefix; string key; key = prefix + "-mode"; node.setProperty(key, PrettyPrintSyncMode(source.getFinalSyncMode())); key = prefix + "-first"; node.setProperty(key, source.isFirstSync()); key = prefix + "-resume"; node.setProperty(key, source.isResumeSync()); key = prefix + "-status"; node.setProperty(key, static_cast<long>(source.getStatus())); key = prefix + "-backup-before"; node.setProperty(key, source.m_backupBefore.getNumItems()); key = prefix + "-backup-after"; node.setProperty(key, source.m_backupAfter.getNumItems()); -- Configure bugmail: http://bugzilla.moblin.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug. You are watching someone on the CC list of the bug. _______________________________________________ Syncevolution-issues mailing list [email protected] http://lists.syncevolution.org/listinfo/syncevolution-issues
