Browse Source

Fixed bug where you could add generated html pages as bookmarks

master
Anthony Restaino 9 years ago
parent
commit
23dc83fb6a
  1. 3
      app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java

3
app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java

@ -49,6 +49,7 @@ import acr.browser.lightning.dialog.LightningDialogBuilder; @@ -49,6 +49,7 @@ import acr.browser.lightning.dialog.LightningDialogBuilder;
import acr.browser.lightning.preference.PreferenceManager;
import acr.browser.lightning.async.ImageDownloadTask;
import acr.browser.lightning.utils.ThemeUtils;
import acr.browser.lightning.utils.UrlUtils;
import acr.browser.lightning.view.LightningView;
/**
@ -193,6 +194,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, @@ -193,6 +194,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
@Subscribe
public void addBookmark(final BrowserEvents.AddBookmark event) {
final HistoryItem item = new HistoryItem(event.url, event.title);
if (!UrlUtils.isSpecialUrl(item.getUrl())) {
if (mBookmarkManager.addBookmark(item)) {
mBookmarks.add(item);
Collections.sort(mBookmarks, new BookmarkManager.SortIgnoreCase());
@ -201,6 +203,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener, @@ -201,6 +203,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
updateBookmarkIndicator(event.url);
}
}
}
@Subscribe
public void currentPageInfo(final BrowserEvents.CurrentPageUrl event) {

Loading…
Cancel
Save