diff options
author | Yana Stamcheva <yana@jitsi.org> | 2009-07-22 17:28:41 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2009-07-22 17:28:41 +0000 |
commit | b456e84ab6e88c2b9eba76080debef4d2e3102b6 (patch) | |
tree | adca07798085a20e6b9f86f09e3d3395bf844960 /src/net/java/sip | |
parent | 2da2522098fa239d873183f279391b2238d8c40f (diff) | |
download | jitsi-b456e84ab6e88c2b9eba76080debef4d2e3102b6.zip jitsi-b456e84ab6e88c2b9eba76080debef4d2e3102b6.tar.gz jitsi-b456e84ab6e88c2b9eba76080debef4d2e3102b6.tar.bz2 |
Fixes file transfer progress wrong data type (from int to long). Problem and fix thereof João Antunes!
Diffstat (limited to 'src/net/java/sip')
5 files changed, 12 insertions, 10 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/FileTransferImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/FileTransferImpl.java index 28271e3..ebab144 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/FileTransferImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/FileTransferImpl.java @@ -221,7 +221,7 @@ public class FileTransferImpl setTransferedBytes(transfered); fireProgressChangeEvent( - System.currentTimeMillis(), (int)transfered); + System.currentTimeMillis(), transfered); try { Thread.sleep(100); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetFileTransferJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetFileTransferJabberImpl.java index d2b6fda..72e8ccf 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetFileTransferJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetFileTransferJabberImpl.java @@ -385,7 +385,7 @@ public class OperationSetFileTransferJabberImpl public void run() { int status; - double progress; + long progress; while (true) { @@ -406,7 +406,7 @@ public class OperationSetFileTransferJabberImpl fileTransfer.fireStatusChangeEvent(status); fileTransfer.fireProgressChangeEvent( - System.currentTimeMillis(), (int) progress); + System.currentTimeMillis(), progress); } catch (InterruptedException e) { @@ -423,7 +423,7 @@ public class OperationSetFileTransferJabberImpl fileTransfer.fireStatusChangeEvent(status); fileTransfer.fireProgressChangeEvent( - System.currentTimeMillis(), (int) progress); + System.currentTimeMillis(), progress); } } diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetFileTransferYahooImpl.java b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetFileTransferYahooImpl.java index 4ee1603..db92e77 100644 --- a/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetFileTransferYahooImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/yahoo/OperationSetFileTransferYahooImpl.java @@ -398,7 +398,7 @@ public class OperationSetFileTransferYahooImpl ft.setTransferedBytes(ev.getProgress()); ft.fireProgressChangeEvent( - System.currentTimeMillis(), (int)ev.getProgress()); + System.currentTimeMillis(), ev.getProgress()); } else ft.fireStatusChangeEvent(getStateMapping(newState)); diff --git a/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java b/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java index 6eeed43..b61a778 100644 --- a/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java +++ b/src/net/java/sip/communicator/service/protocol/AbstractFileTransfer.java @@ -158,8 +158,10 @@ public abstract class AbstractFileTransfer /** * Notifies all status listeners that a new * <tt>FileTransferProgressEvent</tt> occured. + * @param timestamp the date on which the event occured + * @param progress the bytes representing the progress of the transfer */ - public void fireProgressChangeEvent(long timestamp, int progress) + public void fireProgressChangeEvent(long timestamp, long progress) { Collection<FileTransferProgressListener> listeners = null; synchronized (progressListeners) diff --git a/src/net/java/sip/communicator/service/protocol/event/FileTransferProgressEvent.java b/src/net/java/sip/communicator/service/protocol/event/FileTransferProgressEvent.java index 8421923..b8c57ef 100644 --- a/src/net/java/sip/communicator/service/protocol/event/FileTransferProgressEvent.java +++ b/src/net/java/sip/communicator/service/protocol/event/FileTransferProgressEvent.java @@ -22,7 +22,7 @@ public class FileTransferProgressEvent /** * Indicates the progress of a file transfer in bytes. */ - private int progress; + private long progress; /** * Indicates when this event occured. @@ -41,7 +41,7 @@ public class FileTransferProgressEvent */ public FileTransferProgressEvent( FileTransfer fileTransfer, long timestamp, - int progress) + long progress) { super(fileTransfer); @@ -60,11 +60,11 @@ public class FileTransferProgressEvent } /** - * Returns the progress of the file transfer. + * Returns the progress of the file transfer in transferred bytes. * * @return the progress of the file transfer */ - public int getProgress() + public long getProgress() { return progress; } |