Bug 148068 - DCC transferring time is shown only after the transfer is finished
Summary: DCC transferring time is shown only after the transfer is finished
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-20 22:00 UTC by Raphael Kubo da Costa
Modified: 2007-07-21 09:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fix both problems. (1.63 KB, patch)
2007-07-20 22:03 UTC, Raphael Kubo da Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa 2007-07-20 22:00:16 UTC
Version:           SVN revision 690315 (using KDE KDE 3.5.6)
Installed from:    Compiled From Sources
Compiler:          gcc 4.1.2 
OS:                Linux

In SVN, the "transferring time" part of the detailed info panel is updated with the time the transfer took only after it's finished.
Besides, when another transfer is started and another transfer is selected, none of them have their information updated in the panel every 0.5 seconds anymore.
Comment 1 Raphael Kubo da Costa 2007-07-20 22:03:44 UTC
Created attachment 21211 [details]
Fix both problems.

This patch fixes both problems.
Maybe the code for getting the transferring time should be moved to a
getTransferringTime method in dcctransfer.cpp
Comment 2 Peter Simonsson 2007-07-21 09:27:51 UTC
SVN commit 690460 by psn:

* Fix for the info update in the details panel when more then one transfer
* Continually update the transfer time
Patch by Raphael Kubo da Costa
BUG:148068


 M  +15 -2     dcctransferdetailedinfopanel.cpp  


--- branches/extragear/kde3/network/konversation/src/dcctransferdetailedinfopanel.cpp #690459:690460
@@ -47,10 +47,15 @@
     // we can't do disconnect( m_item->transfer(), 0, this, 0 ) here
     // because m_item can have been deleted already.
 
-    // set up the auto view-udpate timer
+    // set up the auto view-update timer
     connect( m_autoViewUpdateTimer, SIGNAL( timeout() ), this, SLOT( updateView() ) );
 
     m_item = item;
+
+    // If the file is already being transferred, the timer must be started here,
+    // otherwise the information will not be updated every 0.5sec
+    if (m_item->transfer()->getStatus() == DccTransfer::Transferring)
+        m_autoViewUpdateTimer->start(500, false);
     connect( m_item->transfer(), SIGNAL( statusChanged( DccTransfer*, int, int ) ), this, SLOT( slotTransferStatusChanged( DccTransfer*, int, int ) ) );
 
     updateView();
@@ -129,7 +134,15 @@
         m_labelTransferringTime->setText( "" );
     else
     {
-        int transferringTime = transfer->getTimeTransferStarted().secsTo( transfer->getTimeTransferFinished() );
+        int transferringTime;
+
+        // The transfer is still in progress
+        if ( transfer->getTimeTransferFinished().isNull() )
+            transferringTime = transfer->getTimeTransferStarted().secsTo( QDateTime::currentDateTime() );
+        // The transfer has finished
+        else
+            transferringTime = transfer->getTimeTransferStarted().secsTo( transfer->getTimeTransferFinished() );
+
         if ( transferringTime >= 1 )
             m_labelTransferringTime->setText( DccTransferPanelItem::secToHMS( transferringTime ) );
         else