[Konversation-devel] [Bug 148068] DCC transferring time is shown only after the transfer is finished

Peter Simonsson peter.simonsson at gmail.com
Sat Jul 21 09:27:53 CEST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=148068         
peter.simonsson gmail com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From peter.simonsson gmail com  2007-07-21 09:27 -------
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


More information about the Konversation-devel mailing list