aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjruesga <jorge@ruesga.com>2012-10-19 01:02:29 +0200
committerjruesga <jorge@ruesga.com>2012-10-19 01:02:29 +0200
commitce6bc8b3c8dd9019fcac3dc6b69b7093e69a0b68 (patch)
tree700807387e4eef594f0aad4deb6fdf6ac16b3387 /src
parent4896199c672cc4df569226cd5e7b33d987ff00e1 (diff)
Check getFileInfo is null
Diffstat (limited to 'src')
-rw-r--r--src/com/cyanogenmod/explorer/activities/BookmarksActivity.java13
-rw-r--r--src/com/cyanogenmod/explorer/activities/NavigationActivity.java7
-rw-r--r--src/com/cyanogenmod/explorer/activities/SearchActivity.java27
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) {