MCPcopy Create free account
hub / github.com/amule-project/amule / UpdateResult

Method UpdateResult

src/SearchListCtrl.cpp:270–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269
270void CSearchListCtrl::UpdateResult(CSearchFile* toupdate)
271{
272 long index = FindItem(-1, reinterpret_cast<wxUIntPtr>(toupdate));
273 if (index != -1) {
274 // Update the filename, which may be changed in case of multiple variants.
275 SetItem(index, ID_SEARCH_COL_NAME, toupdate->GetFileName().GetPrintable());
276
277 wxString temp = CFormat("%d") % toupdate->GetSourceCount();
278 if (toupdate->GetCompleteSourceCount()) {
279 temp += CFormat(" (%d)") % toupdate->GetCompleteSourceCount();
280 }
281 if (toupdate->GetClientsCount()) {
282 temp += CFormat(" [%d]") % toupdate->GetClientsCount();
283 }
284#if defined(__DEBUG__) && !defined(CLIENT_GUI)
285 if (toupdate->GetKadPublishInfo() == 0) {
286 temp += " | -";
287 } else {
288 temp += CFormat(" | N:%u, P:%u, T:%0.2f")
289 % ((toupdate->GetKadPublishInfo() & 0xFF000000) >> 24)
290 % ((toupdate->GetKadPublishInfo() & 0x00FF0000) >> 16)
291 % ((toupdate->GetKadPublishInfo() & 0x0000FFFF) / 100.0);
292 }
293#endif
294 SetItem(index, ID_SEARCH_COL_SOURCES, temp);
295
296 SetItem(index, ID_SEARCH_COL_STATUS, DetermineStatusPrintable(toupdate));
297
298 UpdateItemColor(index);
299
300 // Deletions of items causes rather large amount of flicker, so to
301 // avoid this, we resort the list to ensure correct ordering.
302 if (!IsItemSorted(index)) {
303 SortList();
304 }
305 }
306}
307
308
309void CSearchListCtrl::UpdateItemColor(long index)

Callers

nothing calls this directly

Calls 6

CFormatClass · 0.85
GetPrintableMethod · 0.80
GetClientsCountMethod · 0.80
GetKadPublishInfoMethod · 0.80
GetSourceCountMethod · 0.45

Tested by

no test coverage detected