diff options
Diffstat (limited to 'src')
3 files changed, 33 insertions, 14 deletions
diff --git a/src/com/cyanogenmod/explorer/activities/BookmarksActivity.java b/src/com/cyanogenmod/explorer/activities/BookmarksActivity.java index 71cd07f..b05149d 100644 --- a/src/com/cyanogenmod/explorer/activities/BookmarksActivity.java +++ b/src/com/cyanogenmod/explorer/activities/BookmarksActivity.java @@ -232,8 +232,17 @@ public class BookmarksActivity extends Activity implements OnItemClickListener, // Check that the bookmark exists try { FileSystemObject fso = CommandHelper.getFileInfo(this, path, null); - intent.putExtra(NavigationActivity.EXTRA_BOOKMARK_SELECTION, fso); - setResult(RESULT_OK, intent); + if (fso != null) { + intent.putExtra(NavigationActivity.EXTRA_BOOKMARK_SELECTION, fso); + setResult(RESULT_OK, intent); + } else { + // The bookmark not exists, delete the user-defined bookmark + try { + Bookmark b = Bookmarks.getBookmark(getContentResolver(), path); + Bookmarks.removeBookmark(this, b); + refresh(); + } catch (Exception ex) {/**NON BLOCK**/} + } } catch (Exception e) { // Capture the exception ExceptionUtil.translateException(this, e); diff --git a/src/com/cyanogenmod/explorer/activities/NavigationActivity.java b/src/com/cyanogenmod/explorer/activities/NavigationActivity.java index ad95f68..25c8f9e 100644 --- a/src/com/cyanogenmod/explorer/activities/NavigationActivity.java +++ b/src/com/cyanogenmod/explorer/activities/NavigationActivity.java @@ -1122,8 +1122,11 @@ public class NavigationActivity extends Activity String path = ((NavigationViewInfoParcelable)h.getItem()).getCurrentDir(); try { - CommandHelper.getFileInfo(this, path, null); - break; + FileSystemObject info = CommandHelper.getFileInfo(this, path, null); + if (info != null) { + break; + } + this.mHistory.remove(this.mHistory.size() - 1); } catch (Exception e) { ExceptionUtil.translateException(this, e, true, false); this.mHistory.remove(this.mHistory.size() - 1); diff --git a/src/com/cyanogenmod/explorer/activities/SearchActivity.java b/src/com/cyanogenmod/explorer/activities/SearchActivity.java index c775545..de653a4 100644 --- a/src/com/cyanogenmod/explorer/activities/SearchActivity.java +++ b/src/com/cyanogenmod/explorer/activities/SearchActivity.java @@ -956,17 +956,24 @@ public class SearchActivity extends Activity // Check that the bookmark exists try { FileSystemObject fso = CommandHelper.getFileInfo(this, item.getFullPath(), null); - if (FileHelper.isDirectory(fso)) { - intent.putExtra(NavigationActivity.EXTRA_SEARCH_ENTRY_SELECTION, fso); - intent.putExtra( - NavigationActivity.EXTRA_SEARCH_LAST_SEARCH_DATA, - (Parcelable)createSearchInfo()); - setResult(RESULT_OK, intent); + if (fso != null) { + if (FileHelper.isDirectory(fso)) { + intent.putExtra(NavigationActivity.EXTRA_SEARCH_ENTRY_SELECTION, fso); + intent.putExtra( + NavigationActivity.EXTRA_SEARCH_LAST_SEARCH_DATA, + (Parcelable)createSearchInfo()); + setResult(RESULT_OK, intent); + } else { + // Open the file here, so when focus back to the app, the search activity + // its in top of the stack + ActionsPolicy.openFileSystemObject(this, fso, false); + return; + } } else { - // Open the file here, so when focus back to the app, the search activity - // its in top of the stack - ActionsPolicy.openFileSystemObject(this, fso, false); - return; + // The fso not exists, delete the fso from the search + try { + removeItem(item); + } catch (Exception ex) {/**NON BLOCK**/} } } catch (Exception e) { |
