summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/bookmark_tree_model.cc
diff options
context:
space:
mode:
authormunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 21:17:39 +0000
committermunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 21:17:39 +0000
commitdffeb89734143d57a09c96ae473552463fd579bb (patch)
tree8986f934595990980cc000dd72a337459c2cd19f /chrome/browser/gtk/bookmark_tree_model.cc
parent5e96b65b0470d18a169f4d9eacc8784d1fcfeb6d (diff)
downloadchromium_src-dffeb89734143d57a09c96ae473552463fd579bb.zip
chromium_src-dffeb89734143d57a09c96ae473552463fd579bb.tar.gz
chromium_src-dffeb89734143d57a09c96ae473552463fd579bb.tar.bz2
Always persist bookmark IDs.
Remove the preference to persist IDs. NOTE that we need to save the file the first time with IDs since existing bookmark files won't have IDs and the file won't be saved until something changes in the bookmark model. So we need to explicitly save once when we assign ids for the first time. TEST=NONE BUG=16068 Review URL: http://codereview.chromium.org/149310 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_tree_model.cc')
-rw-r--r--chrome/browser/gtk/bookmark_tree_model.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/gtk/bookmark_tree_model.cc b/chrome/browser/gtk/bookmark_tree_model.cc
index ab3b24e..34eedb0 100644
--- a/chrome/browser/gtk/bookmark_tree_model.cc
+++ b/chrome/browser/gtk/bookmark_tree_model.cc
@@ -41,7 +41,7 @@ void RecursiveResolve(BookmarkModel* bb_model, const BookmarkNode* bb_node,
GtkTreeIter child_iter;
if (gtk_tree_model_iter_children(tree_model, &child_iter, parent_iter)) {
do {
- int id = bookmark_utils::GetIdFromTreeIter(tree_model, &child_iter);
+ int64 id = bookmark_utils::GetIdFromTreeIter(tree_model, &child_iter);
std::wstring title =
bookmark_utils::GetTitleFromTreeIter(tree_model, &child_iter);
const BookmarkNode* child_bb_node = NULL;
@@ -74,10 +74,10 @@ namespace bookmark_utils {
GtkTreeStore* MakeFolderTreeStore() {
return gtk_tree_store_new(FOLDER_STORE_NUM_COLUMNS, GDK_TYPE_PIXBUF,
- G_TYPE_STRING, G_TYPE_INT);
+ G_TYPE_STRING, G_TYPE_INT64);
}
-void AddToTreeStore(BookmarkModel* model, int selected_id,
+void AddToTreeStore(BookmarkModel* model, int64 selected_id,
GtkTreeStore* store, GtkTreeIter* selected_iter) {
const BookmarkNode* root_node = model->root_node();
for (int i = 0; i < root_node->GetChildCount(); ++i) {
@@ -86,7 +86,7 @@ void AddToTreeStore(BookmarkModel* model, int selected_id,
}
}
-void AddToTreeStoreAt(const BookmarkNode* node, int selected_id,
+void AddToTreeStoreAt(const BookmarkNode* node, int64 selected_id,
GtkTreeStore* store, GtkTreeIter* selected_iter,
GtkTreeIter* parent) {
if (!node->is_folder())
@@ -128,7 +128,7 @@ const BookmarkNode* CommitTreeStoreDifferencesBetween(
DCHECK(GetIdFromTreeIter(tree_model, &tree_root) != 0)
<< "It should be impossible to add another toplevel node";
- int id = GetIdFromTreeIter(tree_model, &tree_root);
+ int64 id = GetIdFromTreeIter(tree_model, &tree_root);
const BookmarkNode* child_node = NULL;
for (int j = 0; j < root_node->GetChildCount(); ++j) {
const BookmarkNode* node = root_node->GetChild(j);
@@ -148,12 +148,12 @@ const BookmarkNode* CommitTreeStoreDifferencesBetween(
return node_to_return;
}
-int GetIdFromTreeIter(GtkTreeModel* model, GtkTreeIter* iter) {
+int64 GetIdFromTreeIter(GtkTreeModel* model, GtkTreeIter* iter) {
GValue value = { 0, };
- int ret_val = -1;
+ int64 ret_val = -1;
gtk_tree_model_get_value(model, iter, ITEM_ID, &value);
- if (G_VALUE_HOLDS_INT(&value))
- ret_val = g_value_get_int(&value);
+ if (G_VALUE_HOLDS_INT64(&value))
+ ret_val = g_value_get_int64(&value);
else
NOTREACHED() << "Impossible type mismatch";