[freenet-cvs] r14736 - trunk/freenet/src/freenet/clients/http/bookmark

nextgens at freenetproject.org nextgens at freenetproject.org
Fri Aug 17 00:07:19 UTC 2007


Author: nextgens
Date: 2007-08-17 00:07:18 +0000 (Fri, 17 Aug 2007)
New Revision: 14736

Modified:
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
Log:
Fix the issue with renaming/editing bookmarks; please test it.

That class ought to be synchronized properly, really!

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java	2007-08-16 23:13:29 UTC (rev 14735)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java	2007-08-17 00:07:18 UTC (rev 14736)
@@ -175,15 +175,16 @@
 			node.storeConfig();
 	}
 
-	// TODO
 	public void renameBookmark(String path, String newName) {
 		Bookmark bookmark = getBookmarkByPath(path);
+		
+		String oldName = bookmark.getName();
 		bookmark.setName(newName);
-		if (bookmark instanceof BookmarkCategory) {
-			try {
-				configCB.set(configCB.get());
-			} catch (InvalidConfigValueException icve) {}
-		}
+		
+		bookmarks.remove(path);
+		bookmarks.put(path.replace(oldName, newName), bookmark);
+		
+		node.storeConfig();
 	}
 
 	public void moveBookmark(String bookmarkPath, String newParentPath, boolean store) {




More information about the cvs mailing list