From: Mailing l. f. S. c. m. <jtc...@li...> - 2008-02-29 14:09:19
|
Revision: 3024 http://jtcfrost.svn.sourceforge.net/jtcfrost/?rev=3024&view=rev Author: bback Date: 2008-02-29 06:09:17 -0800 (Fri, 29 Feb 2008) Log Message: ----------- - preps Modified Paths: -------------- trunk/frost-wot/source/frost/fileTransfer/PersistenceManager.java trunk/frost-wot/source/frost/fileTransfer/download/FrostDownloadItem.java trunk/frost-wot/source/frost/fileTransfer/upload/FrostUploadItem.java Modified: trunk/frost-wot/source/frost/fileTransfer/PersistenceManager.java =================================================================== --- trunk/frost-wot/source/frost/fileTransfer/PersistenceManager.java 2008-02-28 19:36:52 UTC (rev 3023) +++ trunk/frost-wot/source/frost/fileTransfer/PersistenceManager.java 2008-02-29 14:09:17 UTC (rev 3024) @@ -39,8 +39,7 @@ */ public class PersistenceManager implements IFcpPersistentRequestsHandler { -// Maintain a flag if request is currently running. when we restart and it should be running, but isn't, set FAILED -// Maintain always (manual remove, ...) +//FIXME Problem: positiv abgleich klappt, aber woher weiss ich wann LIST durch ist um zu checken ob welche fehlen? private static final Logger logger = Logger.getLogger(PersistenceManager.class.getName()); @@ -886,7 +885,7 @@ } } } -// todo: abstractes item (upload+download) mit shared states, functions usw. diese beiden methods sind fast diesselben! +// TODO: abstractes item (upload+download) mit shared states, functions usw. diese beiden methods sind fast diesselben! public void persistentRequestRemoved(final FcpPersistentGet downloadRequest) { if( downloadModelItems.containsKey(downloadRequest.getIdentifier()) ) { final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier()); Modified: trunk/frost-wot/source/frost/fileTransfer/download/FrostDownloadItem.java =================================================================== --- trunk/frost-wot/source/frost/fileTransfer/download/FrostDownloadItem.java 2008-02-28 19:36:52 UTC (rev 3023) +++ trunk/frost-wot/source/frost/fileTransfer/download/FrostDownloadItem.java 2008-02-29 14:09:17 UTC (rev 3024) @@ -70,6 +70,7 @@ private transient boolean isExternal = false; private transient boolean internalRemoveExpected = false; + private transient boolean stateShouldBeProgress = false; /** * Add a file from download text box. @@ -163,7 +164,11 @@ runtimeSecondsWithoutProgress = newRuntimeSecondsWithoutProgress; oldDoneBlocks = newOldDoneBlocks; - // set correct state, keep DONE and FAILED + if( this.state == FrostDownloadItem.STATE_PROGRESS ) { + // download was running at end of last shutdown + stateShouldBeProgress = true; + } + if (this.state != FrostDownloadItem.STATE_DONE && this.state != FrostDownloadItem.STATE_FAILED) { this.state = FrostDownloadItem.STATE_WAITING; } @@ -488,4 +493,8 @@ public int getOldDoneBlocks() { return oldDoneBlocks; } + + public boolean isStateShouldBeProgress() { + return stateShouldBeProgress; + } } Modified: trunk/frost-wot/source/frost/fileTransfer/upload/FrostUploadItem.java =================================================================== --- trunk/frost-wot/source/frost/fileTransfer/upload/FrostUploadItem.java 2008-02-28 19:36:52 UTC (rev 3023) +++ trunk/frost-wot/source/frost/fileTransfer/upload/FrostUploadItem.java 2008-02-29 14:09:17 UTC (rev 3024) @@ -67,6 +67,7 @@ private boolean isExternal = false; private transient boolean internalRemoveExpected = false; + private transient boolean stateShouldBeProgress = false; /** * Dummy to use for uploads of attachments. Is never saved. @@ -121,10 +122,14 @@ retries = newRetries; lastUploadStopTimeMillis = newLastUploadStopTimeMillis; gqIdentifier = newGqIdentifier; - isLoggedToFile= newIsLoggedToFile; + isLoggedToFile = newIsLoggedToFile; // set correct state - if ((state == FrostUploadItem.STATE_PROGRESS) /*|| (state == FrostUploadItem.STATE_UPLOADING)*/ ) { + if( state == FrostUploadItem.STATE_PROGRESS ) { + // upload was running at end of last shutdown + if( !isSharedFile() ) { + stateShouldBeProgress = true; + } state = FrostUploadItem.STATE_WAITING; } else if ((state == FrostUploadItem.STATE_ENCODING) || (state == FrostUploadItem.STATE_ENCODING_REQUESTED)) { state = FrostUploadItem.STATE_WAITING; @@ -335,4 +340,8 @@ public void setLoggedToFile(final boolean isLoggedToFile) { this.isLoggedToFile = isLoggedToFile; } + + public boolean isStateShouldBeProgress() { + return stateShouldBeProgress; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |