Browse Source

Cleanup unused methods

master
Anthony Restaino 8 years ago
parent
commit
c19dbe09bb
  1. 6
      app/src/main/java/acr/browser/lightning/activity/TabsManager.java
  2. 40
      app/src/main/java/acr/browser/lightning/database/BookmarkManager.java

6
app/src/main/java/acr/browser/lightning/activity/TabsManager.java

@ -35,11 +35,12 @@ import acr.browser.lightning.view.LightningView; @@ -35,11 +35,12 @@ import acr.browser.lightning.view.LightningView;
public class TabsManager {
private static final String TAG = TabsManager.class.getSimpleName();
private final List<LightningView> mTabList = new ArrayList<>(1);
private LightningView mCurrentTab;
private static final String BUNDLE_KEY = "WEBVIEW_";
private static final String BUNDLE_STORAGE = "SAVED_TABS.parcel";
private final List<LightningView> mTabList = new ArrayList<>(1);
private LightningView mCurrentTab;
@Inject PreferenceManager mPreferenceManager;
@Inject Bus mEventBus;
@Inject Application mApp;
@ -124,6 +125,7 @@ public class TabsManager { @@ -124,6 +125,7 @@ public class TabsManager {
*/
public synchronized void freeMemory() {
for (LightningView tab : mTabList) {
//noinspection deprecation
tab.freeMemory();
}
}

40
app/src/main/java/acr/browser/lightning/database/BookmarkManager.java

@ -55,7 +55,6 @@ public class BookmarkManager { @@ -55,7 +55,6 @@ public class BookmarkManager {
private Map<String, HistoryItem> mBookmarksMap;
private String mCurrentFolder = "";
private final ExecutorService mExecutor;
private boolean mReady = false;
private final File mFilesDir;
@Inject
@ -66,13 +65,6 @@ public class BookmarkManager { @@ -66,13 +65,6 @@ public class BookmarkManager {
mExecutor.execute(new BookmarkInitializer(context));
}
/**
* @return true if the BookmarkManager was initialized, false otherwise
*/
public boolean isReady() {
return mReady;
}
/**
* Look for bookmark using the url
*
@ -135,7 +127,6 @@ public class BookmarkManager { @@ -135,7 +127,6 @@ public class BookmarkManager {
Utils.close(inputStream);
}
mBookmarksMap = bookmarks;
mReady = true;
}
}
@ -180,6 +171,7 @@ public class BookmarkManager { @@ -180,6 +171,7 @@ public class BookmarkManager {
if (success) {
// Overwrite the bookmarks file by renaming the temp file
//noinspection ResultOfMethodCallIgnored
tempFile.renameTo(bookmarksFile);
}
}
@ -417,20 +409,6 @@ public class BookmarkManager { @@ -417,20 +409,6 @@ public class BookmarkManager {
return mCurrentFolder;
}
/**
* Method is used internally for searching the bookmarks
*
* @return a sorted map of all bookmarks, useful for seeing if a bookmark exists
*/
private Set<String> getBookmarkUrls(List<HistoryItem> list) {
Set<String> set = new HashSet<>();
for (HistoryItem item : mBookmarksMap.values()) {
if (!item.isFolder())
set.add(item.getUrl());
}
return set;
}
/**
* This method returns a list of all folders.
* Folders cannot be empty as they are generated from
@ -513,22 +491,6 @@ public class BookmarkManager { @@ -513,22 +491,6 @@ public class BookmarkManager {
}
}
/**
* find the index of a bookmark in a list using only its URL
*
* @param list the list to search
* @param url the url to compare
* @return returns the index of the bookmark or -1 if none was found
*/
public static int getIndexOfBookmark(final List<HistoryItem> list, final String url) {
for (int n = 0; n < list.size(); n++) {
if (list.get(n).getUrl().equals(url)) {
return n;
}
}
return -1;
}
/**
* This class sorts bookmarks alphabetically, with folders coming after bookmarks
*/

Loading…
Cancel
Save