From d29b09fa8de874faf286004f839c3e9c84ebf29c Mon Sep 17 00:00:00 2001 From: upstream svn Date: Sat, 18 Jul 2009 10:58:46 +0200 Subject: [PATCH] Upstream tarball 9706 --- .svn-revision | 2 +- src/ECSpecialCoreTags.cpp | 13 +++++++++---- src/PartFile.cpp | 18 +++--------------- src/amule-remote-gui.cpp | 7 ++++++- src/libs/ec/abstracts/ECCodes.abstract | 4 ++++ src/libs/ec/c#/ECCodes.cs | 4 ++++ src/libs/ec/cpp/ECCodes.h | 4 ++++ src/libs/ec/cpp/ECSpecialTags.h | 4 ++++ src/libs/ec/java/ECCodes.java | 4 ++++ src/remote-gui.net/ECCodes.cs | 4 ++++ 10 files changed, 43 insertions(+), 21 deletions(-) diff --git a/.svn-revision b/.svn-revision index 18c99f9c..f95b2f7d 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -9705 +9706 diff --git a/src/ECSpecialCoreTags.cpp b/src/ECSpecialCoreTags.cpp index 089407f0..fdc433f2 100644 --- a/src/ECSpecialCoreTags.cpp +++ b/src/ECSpecialCoreTags.cpp @@ -170,15 +170,20 @@ CECTag(EC_TAG_PARTFILE, file->GetFileHash()) AddTag(EC_TAG_PARTFILE_SIZE_XFER, file->GetTransferred(), valuemap); AddTag(EC_TAG_PARTFILE_SIZE_DONE, file->GetCompletedSize(), valuemap); - AddTag(EC_TAG_PARTFILE_SPEED, (uint64)(file->GetKBpsDown()*1024), valuemap); + AddTag(EC_TAG_PARTFILE_SPEED, file->GetKBpsDown()*1024, valuemap); } - AddTag(EC_TAG_PARTFILE_PRIO, (uint64)(file->IsAutoDownPriority() ? + AddTag(EC_TAG_PARTFILE_PRIO, (file->IsAutoDownPriority() ? file->GetDownPriority() + 10 : file->GetDownPriority()), valuemap); AddTag(EC_TAG_PARTFILE_CAT, file->GetCategory(), valuemap); - AddTag(EC_TAG_PARTFILE_LAST_SEEN_COMP, (uint64)file->lastseencomplete, valuemap); - AddTag(EC_TAG_PARTFILE_LAST_RECV, (uint64)file->GetLastChangeDatetime(), valuemap); + AddTag(EC_TAG_PARTFILE_LAST_SEEN_COMP, file->lastseencomplete, valuemap); + AddTag(EC_TAG_PARTFILE_LAST_RECV, file->GetLastChangeDatetime(), valuemap); + AddTag(EC_TAG_PARTFILE_DOWNLOAD_ACTIVE, file->GetDlActiveTime(), valuemap); + + AddTag(EC_TAG_PARTFILE_LOST_CORRUPTION, file->GetLostDueToCorruption(), valuemap); + AddTag(EC_TAG_PARTFILE_GAINED_COMPRESSION, file->GetGainDueToCompression(), valuemap); + AddTag(EC_TAG_PARTFILE_SAVED_ICH, file->TotalPacketsSavedDueToICH(), valuemap); if (detail) { Detail_Tag(file, valuemap); diff --git a/src/PartFile.cpp b/src/PartFile.cpp index 5a96c083..b07275c6 100644 --- a/src/PartFile.cpp +++ b/src/PartFile.cpp @@ -3571,23 +3571,11 @@ CPartFile::CPartFile(CEC_PartFile_Tag *tag) SetFileSize(tag->SizeFull()); m_gaplist.Init(GetFileSize(), true); // Init empty m_partmetfilename = CPath(tag->PartMetName()); - transferred = tag->SizeXfer(); - percentcompleted = (100.0*completedsize) / GetFileSize(); - completedsize = tag->SizeDone(); - - m_category = tag->FileCat(); + m_fullname = m_partmetfilename; // We have only the met number, so show it without path in the detail dialog. m_SrcpartFrequency.insert(m_SrcpartFrequency.end(), GetPartCount(), 0); - m_iDownPriority = tag->Prio(); - if ( m_iDownPriority >= 10 ) { - m_iDownPriority-= 10; - m_bAutoDownPriority = true; - } else { - m_bAutoDownPriority = false; - } - // FIXME: ! - m_category = 0; - + + // these are only in CLIENT_GUI and not covered by Init() m_source_count = 0; m_kbpsDown = 0; m_iDownPriorityEC = 0; diff --git a/src/amule-remote-gui.cpp b/src/amule-remote-gui.cpp index 0cf4e0d2..93be322b 100644 --- a/src/amule-remote-gui.cpp +++ b/src/amule-remote-gui.cpp @@ -1414,7 +1414,12 @@ void CDownQueueRem::ProcessItemUpdate(CEC_PartFile_Tag *tag, CPartFile *file) tag->LastSeenComplete(&file->lastseencomplete); tag->LastDateChanged(&file->m_lastDateChanged); - + tag->DownloadActiveTime(&file->m_nDlActiveTime); + + tag->GetLostDueToCorruption(&file->m_iLostDueToCorruption); + tag->GetGainDueToCompression(&file->m_iGainDueToCompression); + tag->TotalPacketsSavedDueToICH(&file->m_iTotalPacketsSavedDueToICH); + tag->FileCat(&file->m_category); tag->Prio(&file->m_iDownPriorityEC); diff --git a/src/libs/ec/abstracts/ECCodes.abstract b/src/libs/ec/abstracts/ECCodes.abstract index 69d781e6..f9dcf249 100644 --- a/src/libs/ec/abstracts/ECCodes.abstract +++ b/src/libs/ec/abstracts/ECCodes.abstract @@ -213,6 +213,10 @@ EC_TAG_PARTFILE 0x0300 EC_TAG_PARTFILE_SOURCE_NAMES 0x0315 EC_TAG_PARTFILE_COMMENTS 0x0316 EC_TAG_PARTFILE_STOPPED 0x0317 + EC_TAG_PARTFILE_DOWNLOAD_ACTIVE 0x0318 + EC_TAG_PARTFILE_LOST_CORRUPTION 0x0319 + EC_TAG_PARTFILE_GAINED_COMPRESSION 0x031A + EC_TAG_PARTFILE_SAVED_ICH 0x031B EC_TAG_KNOWNFILE 0x0400 EC_TAG_KNOWNFILE_XFERRED 0x0401 diff --git a/src/libs/ec/c#/ECCodes.cs b/src/libs/ec/c#/ECCodes.cs index 92e17e7b..591f563c 100644 --- a/src/libs/ec/c#/ECCodes.cs +++ b/src/libs/ec/c#/ECCodes.cs @@ -182,6 +182,10 @@ public enum ECTagNames { EC_TAG_PARTFILE_SOURCE_NAMES = 0x0315, EC_TAG_PARTFILE_COMMENTS = 0x0316, EC_TAG_PARTFILE_STOPPED = 0x0317, + EC_TAG_PARTFILE_DOWNLOAD_ACTIVE = 0x0318, + EC_TAG_PARTFILE_LOST_CORRUPTION = 0x0319, + EC_TAG_PARTFILE_GAINED_COMPRESSION = 0x031A, + EC_TAG_PARTFILE_SAVED_ICH = 0x031B, EC_TAG_KNOWNFILE = 0x0400, EC_TAG_KNOWNFILE_XFERRED = 0x0401, EC_TAG_KNOWNFILE_XFERRED_ALL = 0x0402, diff --git a/src/libs/ec/cpp/ECCodes.h b/src/libs/ec/cpp/ECCodes.h index 8b1455c9..9fe036fb 100644 --- a/src/libs/ec/cpp/ECCodes.h +++ b/src/libs/ec/cpp/ECCodes.h @@ -191,6 +191,10 @@ enum ECTagNames { EC_TAG_PARTFILE_SOURCE_NAMES = 0x0315, EC_TAG_PARTFILE_COMMENTS = 0x0316, EC_TAG_PARTFILE_STOPPED = 0x0317, + EC_TAG_PARTFILE_DOWNLOAD_ACTIVE = 0x0318, + EC_TAG_PARTFILE_LOST_CORRUPTION = 0x0319, + EC_TAG_PARTFILE_GAINED_COMPRESSION = 0x031A, + EC_TAG_PARTFILE_SAVED_ICH = 0x031B, EC_TAG_KNOWNFILE = 0x0400, EC_TAG_KNOWNFILE_XFERRED = 0x0401, EC_TAG_KNOWNFILE_XFERRED_ALL = 0x0402, diff --git a/src/libs/ec/cpp/ECSpecialTags.h b/src/libs/ec/cpp/ECSpecialTags.h index f14dff7d..938e49de 100644 --- a/src/libs/ec/cpp/ECSpecialTags.h +++ b/src/libs/ec/cpp/ECSpecialTags.h @@ -223,6 +223,10 @@ class CEC_PartFile_Tag : public CECTag { uint8 FileCat(uint8 *target = 0) const { return AssignIfExist(EC_TAG_PARTFILE_CAT, target); } time_t LastSeenComplete(time_t *target = 0)const { return AssignIfExist(EC_TAG_PARTFILE_LAST_SEEN_COMP, target); } time_t LastDateChanged(time_t *target = 0) const { return AssignIfExist(EC_TAG_PARTFILE_LAST_RECV, target); } + uint32 DownloadActiveTime(uint32 *target = 0) const { return AssignIfExist(EC_TAG_PARTFILE_DOWNLOAD_ACTIVE, target); } + uint64 GetLostDueToCorruption(uint64 *target = 0) const { return AssignIfExist(EC_TAG_PARTFILE_LOST_CORRUPTION, target); } + uint64 GetGainDueToCompression(uint64 *target = 0) const { return AssignIfExist(EC_TAG_PARTFILE_GAINED_COMPRESSION, target); } + uint32 TotalPacketsSavedDueToICH(uint32 *target = 0) const { return AssignIfExist(EC_TAG_PARTFILE_SAVED_ICH, target); } wxString PartMetName() const { diff --git a/src/libs/ec/java/ECCodes.java b/src/libs/ec/java/ECCodes.java index 151fa8fd..b042c23b 100644 --- a/src/libs/ec/java/ECCodes.java +++ b/src/libs/ec/java/ECCodes.java @@ -179,6 +179,10 @@ public final static short EC_TAG_PARTFILE_REQ_STATUS = 0x0314; public final static short EC_TAG_PARTFILE_SOURCE_NAMES = 0x0315; public final static short EC_TAG_PARTFILE_COMMENTS = 0x0316; public final static short EC_TAG_PARTFILE_STOPPED = 0x0317; +public final static short EC_TAG_PARTFILE_DOWNLOAD_ACTIVE = 0x0318; +public final static short EC_TAG_PARTFILE_LOST_CORRUPTION = 0x0319; +public final static short EC_TAG_PARTFILE_GAINED_COMPRESSION = 0x031A; +public final static short EC_TAG_PARTFILE_SAVED_ICH = 0x031B; public final static short EC_TAG_KNOWNFILE = 0x0400; public final static short EC_TAG_KNOWNFILE_XFERRED = 0x0401; public final static short EC_TAG_KNOWNFILE_XFERRED_ALL = 0x0402; diff --git a/src/remote-gui.net/ECCodes.cs b/src/remote-gui.net/ECCodes.cs index 92e17e7b..591f563c 100644 --- a/src/remote-gui.net/ECCodes.cs +++ b/src/remote-gui.net/ECCodes.cs @@ -182,6 +182,10 @@ public enum ECTagNames { EC_TAG_PARTFILE_SOURCE_NAMES = 0x0315, EC_TAG_PARTFILE_COMMENTS = 0x0316, EC_TAG_PARTFILE_STOPPED = 0x0317, + EC_TAG_PARTFILE_DOWNLOAD_ACTIVE = 0x0318, + EC_TAG_PARTFILE_LOST_CORRUPTION = 0x0319, + EC_TAG_PARTFILE_GAINED_COMPRESSION = 0x031A, + EC_TAG_PARTFILE_SAVED_ICH = 0x031B, EC_TAG_KNOWNFILE = 0x0400, EC_TAG_KNOWNFILE_XFERRED = 0x0401, EC_TAG_KNOWNFILE_XFERRED_ALL = 0x0402, -- 2.11.4.GIT