Summary: | completed/aborted files in the DCC status list show a speed of "?" | ||
---|---|---|---|
Product: | [Applications] konversation | Reporter: | Niek Beernink <n.beernink> |
Component: | general | Assignee: | Konversation Developers <konversation-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Niek Beernink
2006-08-28 20:50:13 UTC
SVN commit 578242 by shin: don't show "?" in CPS column in DCC panel for the consitency with "remaining" column. BUG: 133147 M +1 -1 dcctransfer.cpp --- trunk/extragear/network/konversation/src/dcctransfer.cpp #578241:578242 @@ -477,7 +477,7 @@ QString DccTransfer::getCPSPrettyText() const { if ( m_cps == CPS_UNKNOWN ) - return QString( "?" ); + return QString(); else return i18n("%1/sec").arg( KIO::convertSize( (KIO::fileoffset_t)m_cps ) ); } SVN commit 578246 by shin: show "?" when calculating CPS. CCBUG: 133147 M +7 -4 dcctransfer.cpp --- trunk/extragear/network/konversation/src/dcctransfer.cpp #578245:578246 @@ -37,7 +37,8 @@ #define TIME_REMAINING_NOT_AVAILABLE -1 #define TIME_REMAINING_INFINITE -2 -#define CPS_UNKNOWN -1 +#define CPS_CALCULATING -1 +#define CPS_NOT_IN_TRANSFER -2 DccTransfer::DccTransfer( DccPanel* panel, DccType dccType, const QString& partnerNick ) : KListViewItem( panel->getListView() ) @@ -369,7 +370,7 @@ if ( m_transferLogTime.count() >= 2 ) m_cps = (double)( m_transferLogPosition.last() - m_transferLogPosition.front() ) / (double)( m_transferLogTime.last() - m_transferLogTime.front() ) * 1000; else // avoid zero devision - m_cps = CPS_UNKNOWN; + m_cps = CPS_CALCULATING; // update the remaining time if ( m_cps <= 0 ) @@ -381,7 +382,7 @@ { // avoid zero devision if ( m_timeTransferStarted.secsTo( m_timeTransferFinished ) <= 0 ) - m_cps = CPS_UNKNOWN; + m_cps = CPS_NOT_IN_TRANSFER; else m_cps = (double)( m_transferringPosition - m_transferStartPosition ) / (double)m_timeTransferStarted.secsTo( m_timeTransferFinished ); m_timeRemaining = TIME_REMAINING_NOT_AVAILABLE; @@ -476,7 +477,9 @@ QString DccTransfer::getCPSPrettyText() const { - if ( m_cps == CPS_UNKNOWN ) + if ( m_cps == CPS_CALCULATING ) + return QString( "?" ); + else if ( m_cps == CPS_NOT_IN_TRANSFER ) return QString(); else return i18n("%1/sec").arg( KIO::convertSize( (KIO::fileoffset_t)m_cps ) ); |