mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 725540 - Crash on bookmark removal. r=mfinkle
This commit is contained in:
parent
18e6a2e079
commit
218224006d
@ -247,6 +247,18 @@ public class AwesomeBarTabs extends TabHost {
|
||||
}
|
||||
}
|
||||
|
||||
// The group cursor doesn't ever need to change because it just holds the
|
||||
// mobile/desktop folders, but we do need to update the children cursors.
|
||||
public void refreshBookmarks() {
|
||||
Cursor groupCursor = mBookmarksAdapter.getCursor();
|
||||
groupCursor.moveToPosition(-1);
|
||||
while (groupCursor.moveToNext()) {
|
||||
String guid = groupCursor.getString(groupCursor.getColumnIndexOrThrow(Bookmarks.GUID));
|
||||
// We need to do this in a AsyncTask because we're on the main thread
|
||||
new RefreshChildrenCursorTask(groupCursor.getPosition()).execute(guid);
|
||||
}
|
||||
}
|
||||
|
||||
private class BookmarksQueryTask extends AsyncTask<Void, Void, Cursor> {
|
||||
protected Cursor doInBackground(Void... arg0) {
|
||||
// Make our own cursor to group mobile bookmarks and desktop bookmarks.
|
||||
@ -837,17 +849,4 @@ public class AwesomeBarTabs extends TabHost {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void refreshBookmarks() {
|
||||
new AsyncTask<Void, Void, Cursor>() {
|
||||
protected Cursor doInBackground(Void... arg0) {
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
return BrowserDB.getAllBookmarks(resolver);
|
||||
}
|
||||
|
||||
protected void onPostExecute(Cursor cursor) {
|
||||
mBookmarksAdapter.changeCursor(cursor);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user