| Summary: | DCC transferring time is shown only after the transfer is finished | ||
|---|---|---|---|
| Product: | [Applications] konversation | Reporter: | Raphael Kubo da Costa <rakuco> |
| Component: | general | Assignee: | Konversation Bugs <konversation-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Fix both problems. | ||
|
Description
Raphael Kubo da Costa
2007-07-20 22:00:16 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
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
|