X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/eaa3b1ef566ec3301dc648e6e57b39af7915392f..a07937cb6f1d2a19d526e7fcb666c8e66515620d:/src/com/owncloud/android/datamodel/OCFile.java diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index 70a51547..e6fd4141 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -26,11 +26,7 @@ import com.owncloud.android.lib.common.utils.Log_OC; import java.io.File; -import com.owncloud.android.MainApp; - import third_parties.daveKoeller.AlphanumComparator; -import android.content.Intent; -import android.net.Uri; public class OCFile implements Parcelable, Comparable { public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { @@ -74,6 +70,8 @@ public class OCFile implements Parcelable, Comparable { private boolean mNeedsUpdateThumbnail; + private boolean mIsDownloading; + /** * Create new {@link OCFile} with given path. @@ -116,6 +114,7 @@ public class OCFile implements Parcelable, Comparable { mPermissions = source.readString(); mRemoteId = source.readString(); mNeedsUpdateThumbnail = source.readInt() == 0; + mIsDownloading = source.readInt() == 0; } @@ -140,6 +139,7 @@ public class OCFile implements Parcelable, Comparable { dest.writeString(mPermissions); dest.writeString(mRemoteId); dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0); + dest.writeInt(mIsDownloading ? 1 : 0); } /** @@ -299,17 +299,6 @@ public class OCFile implements Parcelable, Comparable { mRemotePath += PATH_SEPARATOR; } Log_OC.d(TAG, "OCFile name changed to " + mRemotePath); - - // Notify MediaScanner about removed file - Intent intent1 = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); - intent1.setData(Uri.fromFile(new File(this.getStoragePath()))); - MainApp.getAppContext().sendBroadcast(intent1); - - // Notify MediaScanner about new file - Intent intent2 = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); - String folder = new File(this.getStoragePath()).getParent(); - intent2.setData(Uri.fromFile(new File(folder+ PATH_SEPARATOR+name))); - MainApp.getAppContext().sendBroadcast(intent2); } } @@ -363,6 +352,7 @@ public class OCFile implements Parcelable, Comparable { mPermissions = null; mRemoteId = null; mNeedsUpdateThumbnail = false; + mIsDownloading = false; } /** @@ -577,4 +567,16 @@ public class OCFile implements Parcelable, Comparable { this.mRemoteId = remoteId; } + public boolean isDownloading() { + return mIsDownloading; + } + + public void setDownloading(boolean isDownloading) { + this.mIsDownloading = isDownloading; + } + + public boolean isSynchronizing() { + // TODO real implementation + return false; + } }