Browse Source

comments and less debug output

Luke Owncloud 10 years ago
parent
commit
82c7771fc7

+ 5 - 5
src/com/owncloud/android/db/UploadDbHandler.java

@@ -228,12 +228,12 @@ public class UploadDbHandler extends Observable {
             UploadDbObject uploadObject = UploadDbObject.fromString(uploadObjectString);
             
             String path = c.getString(c.getColumnIndex("path"));
-            Log_OC.d(
+            Log_OC.v(
                     TAG,
-                    "Updating " + path + ": " + uploadObject.getLocalPath() + " with uploadStatus=" + status + "(old:"
-                            + uploadObject.getUploadStatus() + ") and result=" + result + "(old:"
-                            + uploadObject.getLastResult());
-            
+                    "Updating " + path + " with status:" + status + " and result:"
+                            + (result == null ? "null" : result.getCode()) + " (old:"
+                            + uploadObject.toFormattedString() + ")");
+
             uploadObject.setUploadStatus(status);
             uploadObject.setLastResult(result);
             uploadObjectString = uploadObject.toString();

+ 1 - 1
src/com/owncloud/android/db/UploadDbObject.java

@@ -307,6 +307,6 @@ public class UploadDbObject implements Serializable {
      * For debugging purposes only.
      */
     public String toFormattedString() {
-        return getLocalPath() + " status:"+getUploadStatus() + " result:" + getLastResult();
+        return getLocalPath() + " status:"+getUploadStatus() + " result:" + (getLastResult()==null?"null":getLastResult().getCode());
     }
 }

+ 3 - 1
src/com/owncloud/android/files/services/FileUploadService.java

@@ -289,7 +289,9 @@ public class FileUploadService extends IntentService implements OnDatatransferPr
      * 
      * Note: We use an IntentService here. It does not provide simultaneous
      * requests, but instead internally queues them and gets them to this
-     * onHandleIntent method one after another.
+     * onHandleIntent method one after another. This makes implementation less
+     * error-prone but prevents files to be added to list while another upload
+     * is active. If everything else works fine, fixing this should be a TODO.
      * 
      * Entry point to add one or several files to the queue of uploads.
      *