projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
datamodel
/
FileDataStorageManager.java
diff --git
a/src/com/owncloud/android/datamodel/FileDataStorageManager.java
b/src/com/owncloud/android/datamodel/FileDataStorageManager.java
index
dbe6938
..
7bc1b71
100644
(file)
--- a/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
+++ b/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
@@
-346,7
+346,13
@@
public class FileDataStorageManager {
).withSelection(where, whereArgs).build());
if (file.isDown()) {
).withSelection(where, whereArgs).build());
if (file.isDown()) {
+ String path = file.getStoragePath();
new File(file.getStoragePath()).delete();
new File(file.getStoragePath()).delete();
+
+ // Notify MediaScanner about removed file
+ Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+ intent.setData(Uri.fromFile(new File(path)));
+ MainApp.getAppContext().sendBroadcast(intent);
}
}
}
}
}
}
@@
-542,11
+548,17
@@
public class FileDataStorageManager {
success &= removeLocalFolder(file);
} else {
if (file.isDown()) {
success &= removeLocalFolder(file);
} else {
if (file.isDown()) {
+ String path = file.getStoragePath();
File localFile = new File(file.getStoragePath());
success &= localFile.delete();
if (success) {
file.setStoragePath(null);
saveFile(file);
File localFile = new File(file.getStoragePath());
success &= localFile.delete();
if (success) {
file.setStoragePath(null);
saveFile(file);
+
+ // Notify MediaScanner about removed file
+ Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+ intent.setData(Uri.fromFile(new File(path)));
+ MainApp.getAppContext().sendBroadcast(intent);
}
}
}
}
}
}
@@
-568,7
+580,13
@@
public class FileDataStorageManager {
if (localFile.isDirectory()) {
success &= removeLocalFolder(localFile);
} else {
if (localFile.isDirectory()) {
success &= removeLocalFolder(localFile);
} else {
+ String path = localFile.getAbsolutePath();
success &= localFile.delete();
success &= localFile.delete();
+
+ // Notify MediaScanner about removed file
+ Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+ intent.setData(Uri.fromFile(new File(path)));
+ MainApp.getAppContext().sendBroadcast(intent);
}
}
}
}
}
}