mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 710330 - Handle updates of bookmark folders and seperators correctly. r=lucasr
This commit is contained in:
parent
bca2b238f3
commit
5f186bf300
@ -787,14 +787,36 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
|
||||
// Update or insert
|
||||
ContentProviderOperation.Builder builder =
|
||||
ContentProviderOperation.newUpdate(bookmarkUri);
|
||||
// Bookmarks are defined by their URL and Folder.
|
||||
builder.withSelection(Bookmarks.URL + " = ? AND "
|
||||
+ Bookmarks.PARENT + " = ? AND "
|
||||
+ Bookmarks.PARENT + " != ?",
|
||||
new String[] { url,
|
||||
Long.toString(parent),
|
||||
String.valueOf(Bookmarks.FIXED_READING_LIST_ID)
|
||||
});
|
||||
if (url != null) {
|
||||
// Bookmarks are defined by their URL and Folder.
|
||||
builder.withSelection(Bookmarks.URL + " = ? AND "
|
||||
+ Bookmarks.PARENT + " = ? AND "
|
||||
+ Bookmarks.PARENT + " != ?",
|
||||
new String[] { url,
|
||||
Long.toString(parent),
|
||||
String.valueOf(Bookmarks.FIXED_READING_LIST_ID)
|
||||
});
|
||||
} else if (title != null) {
|
||||
// Or their title and parent folder. (Folders!)
|
||||
builder.withSelection(Bookmarks.TITLE + " = ? AND "
|
||||
+ Bookmarks.PARENT + " = ? AND "
|
||||
+ Bookmarks.PARENT + " != ?",
|
||||
new String[] { title,
|
||||
Long.toString(parent),
|
||||
String.valueOf(Bookmarks.FIXED_READING_LIST_ID)
|
||||
});
|
||||
} else if (type == Bookmarks.TYPE_SEPARATOR) {
|
||||
// Or their their position (seperators)
|
||||
builder.withSelection(Bookmarks.POSITION + " = ? AND "
|
||||
+ Bookmarks.PARENT + " = ? AND "
|
||||
+ Bookmarks.PARENT + " != ?",
|
||||
new String[] { Long.toString(position),
|
||||
Long.toString(parent),
|
||||
String.valueOf(Bookmarks.FIXED_READING_LIST_ID)
|
||||
});
|
||||
} else {
|
||||
Log.e(LOGTAG, "Bookmark entry without url or title and not a seperator, not added.");
|
||||
}
|
||||
builder.withValues(values);
|
||||
|
||||
// Queue the operation
|
||||
|
Loading…
Reference in New Issue
Block a user