mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 747181 - Profile migration migrates tag folders. r=rnewman a=blocking-fennec-beta
This commit is contained in:
parent
da067e8c2c
commit
e7185b6a86
@ -124,6 +124,9 @@ public class ProfileMigrator {
|
|||||||
private static final String ROOT_NAME = "root_name";
|
private static final String ROOT_NAME = "root_name";
|
||||||
private static final String ROOT_FOLDER_ID = "folder_id";
|
private static final String ROOT_FOLDER_ID = "folder_id";
|
||||||
|
|
||||||
|
// We use this to ignore the tags folder during migration.
|
||||||
|
private static final String ROOT_TAGS_FOLDER_NAME = "tags";
|
||||||
|
|
||||||
private static final String BOOKMARK_QUERY_SELECT =
|
private static final String BOOKMARK_QUERY_SELECT =
|
||||||
"SELECT places.url AS p_url," +
|
"SELECT places.url AS p_url," +
|
||||||
" bookmark.guid AS b_guid," +
|
" bookmark.guid AS b_guid," +
|
||||||
@ -557,6 +560,7 @@ public class ProfileMigrator {
|
|||||||
|
|
||||||
private class PlacesRunnable implements Runnable {
|
private class PlacesRunnable implements Runnable {
|
||||||
private Map<Long, Long> mRerootMap;
|
private Map<Long, Long> mRerootMap;
|
||||||
|
private Long mTagsPlacesFolderId;
|
||||||
private ArrayList<ContentProviderOperation> mOperations;
|
private ArrayList<ContentProviderOperation> mOperations;
|
||||||
private int mMaxEntries;
|
private int mMaxEntries;
|
||||||
// We support 2 classes of schemas: Firefox Places 12-13
|
// We support 2 classes of schemas: Firefox Places 12-13
|
||||||
@ -644,6 +648,12 @@ public class ProfileMigrator {
|
|||||||
mRerootMap.put(placesFolderId, getFolderId(name));
|
mRerootMap.put(placesFolderId, getFolderId(name));
|
||||||
Log.v(LOGTAG, "Name: " + name + ", pid=" + placesFolderId
|
Log.v(LOGTAG, "Name: " + name + ", pid=" + placesFolderId
|
||||||
+ ", nid=" + mRerootMap.get(placesFolderId));
|
+ ", nid=" + mRerootMap.get(placesFolderId));
|
||||||
|
|
||||||
|
// Keep track of the tags folder id so we can avoid
|
||||||
|
// migrating tags later.
|
||||||
|
if (ROOT_TAGS_FOLDER_NAME.equals(name))
|
||||||
|
mTagsPlacesFolderId = placesFolderId;
|
||||||
|
|
||||||
cursor.moveToNext();
|
cursor.moveToNext();
|
||||||
}
|
}
|
||||||
cursor.close();
|
cursor.close();
|
||||||
@ -1051,9 +1061,10 @@ public class ProfileMigrator {
|
|||||||
int type = cursor.getInt(typeCol);
|
int type = cursor.getInt(typeCol);
|
||||||
long parent = cursor.getLong(parentCol);
|
long parent = cursor.getLong(parentCol);
|
||||||
|
|
||||||
// Places has an explicit root folder, id=1 parent=0.
|
// Places has an explicit root folder, id=1 parent=0. Skip that.
|
||||||
// Skip that.
|
// Also, skip tags, since we don't use those in native fennec.
|
||||||
if (id == 1 && parent == 0 && type == PLACES_TYPE_FOLDER) {
|
if ((id == 1 && parent == 0 && type == PLACES_TYPE_FOLDER) ||
|
||||||
|
parent == mTagsPlacesFolderId) {
|
||||||
cursor.moveToNext();
|
cursor.moveToNext();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user