Bug 133147 - completed/aborted files in the DCC status list show a speed of "?"
Summary: completed/aborted files in the DCC status list show a speed of "?"
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-28 20:50 UTC by Niek Beernink
Modified: 2006-08-28 21:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niek Beernink 2006-08-28 20:50:13 UTC
Version:           0.19+ #3146 (using KDE 3.5.4, Kubuntu Package 4:3.5.4-0ubuntu6 )
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-25-k7

Items in the DCC status list that are completed, failed or aborted, show a speed of "?", in my opinion this column should be empty when there is no transfer activity. This would follow the consistency with the "Remaining" column, which clears when a transfer is in a non-transfering state.
Comment 1 Shintaro Matsuoka 2006-08-28 21:00:09 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 ) );
 }
Comment 2 Shintaro Matsuoka 2006-08-28 21:15:21 UTC
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 ) );