浏览代码

fix store upload debug msg

Luke Owncloud 10 年之前
父节点
当前提交
34b630bcf9
共有 1 个文件被更改,包括 5 次插入6 次删除
  1. 5 6
      src/com/owncloud/android/db/UploadDbHandler.java

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

@@ -17,8 +17,6 @@
  */
 package com.owncloud.android.db;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Observable;
 
 import android.content.ContentValues;
@@ -201,12 +199,13 @@ public class UploadDbHandler extends Observable {
         long result = getDB().insert(TABLE_UPLOAD, null, cv);
         
         Log_OC.d(TAG, "putFileForLater returns with: " + result + " for file: " + uploadObject.getLocalPath());
-        if (result == 1) {
-            notifyObserversNow();
+        if (result == -1) {
+            Log_OC.e(TAG, "Failed to insert item " + uploadObject.getLocalPath() + " into upload db.");
+            return false;
         } else {
-            Log_OC.e(TAG, "Failed to insert item "+uploadObject.getLocalPath()+" into upload db.");
+            notifyObserversNow();
+            return true;
         }
-        return result != -1;
     }
 
     /**