X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5d784d98b4b86e0d047ac2bdf5539495ccfb81f8..f98665bc2ded1fbf10727ad9a63df742140cf5d8:/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 70296d5f..bb328d79 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -20,9 +20,12 @@ package com.owncloud.android.datamodel; import java.io.File; +import com.owncloud.android.MainApp; import com.owncloud.android.lib.common.utils.Log_OC; -import third_parties.daveKoeller.AlphanumComparator; +import third_parties.daveKoeller.AlphanumComparator; +import android.content.Intent; +import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.webkit.MimeTypeMap; @@ -157,15 +160,6 @@ public class OCFile implements Parcelable, Comparable { } /** - * Can be used to set the path where the file will be stored - * - * @param remote_path to set - */ - public void setRemotePath(String remote_path) { - mRemotePath = remote_path; - } - - /** * Can be used to check, whether or not this file exists in the database * already * @@ -305,6 +299,18 @@ 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(); + Log_OC.d(TAG, "uri: " + folder+PATH_SEPARATOR+name); + intent2.setData(Uri.fromFile(new File(folder+ PATH_SEPARATOR+name))); + MainApp.getAppContext().sendBroadcast(intent2); } }