mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-25 07:51:26 +01:00
check write permissions before starting the deletion
This commit is contained in:
parent
6c9c072dc9
commit
0ade1ec579
@ -196,6 +196,12 @@ public class MainActivity extends SimpleActivity
|
||||
}
|
||||
}
|
||||
|
||||
for (String path : mToBeDeleted) {
|
||||
if (Utils.Companion.isShowingWritePermissions(this, new File(path))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
notifyDeletion(deletedCnt);
|
||||
}
|
||||
|
||||
|
@ -293,6 +293,9 @@ public class MediaActivity extends SimpleActivity
|
||||
}
|
||||
|
||||
private void prepareForDeleting() {
|
||||
if (Utils.Companion.isShowingWritePermissions(this, new File(mPath)))
|
||||
return;
|
||||
|
||||
Utils.Companion.showToast(this, R.string.deleting);
|
||||
final SparseBooleanArray items = mGridView.getCheckedItemPositions();
|
||||
final int cnt = items.size();
|
||||
|
@ -242,8 +242,10 @@ public class ViewPagerActivity extends SimpleActivity
|
||||
}
|
||||
|
||||
private void notifyDeletion() {
|
||||
mToBeDeleted = getCurrentFile().getAbsolutePath();
|
||||
if (Utils.Companion.isShowingWritePermissions(this, new File(mPath)))
|
||||
return;
|
||||
|
||||
mToBeDeleted = getCurrentFile().getAbsolutePath();
|
||||
if (mMedia.size() <= 1) {
|
||||
deleteFile();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user