Author: nextgens
Date: 2007-11-20 22:03:10 +0000 (Tue, 20 Nov 2007)
New Revision: 15891
Modified:
trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
Log:
BookmarkToadlet: doh... Bookmarks on the root weren't re-editable
Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
2007-11-20 21:50:59 UTC (rev 15890)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
2007-11-20 22:03:10 UTC (rev 15891)
@@ -133,7 +133,6 @@
}
public synchronized void update(FreenetURI uri, boolean hasAnActivelink,
String description) {
- System.out.println("###################### "+description);
this.key = uri;
this.desc = description;
this.hasAnActivelink = hasAnActivelink;
Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
2007-11-20 21:50:59 UTC (rev 15890)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkManager.java
2007-11-20 22:03:10 UTC (rev 15891)
@@ -354,7 +354,8 @@
private void _innerReadBookmarks(String prefix, BookmarkCategory category,
SimpleFieldSet sfs) {
synchronized (bookmarks) {
- putPaths(prefix + category.name + '/', category);
+ if(!"".equals(prefix))
+ putPaths(prefix + category.name + '/', category);
String[] categories = sfs.namesOfDirectSubsets();
for (int i = 0; i < categories.length; i++) {
@@ -362,7 +363,7 @@
BookmarkCategory currentCategory = new
BookmarkCategory(categories[i]);
String name = prefix + category.name + '/';
category.addBookmark(currentCategory);
- _innerReadBookmarks((category.equals(MAIN_CATEGORY) ? "/" :
name), currentCategory, subset);
+ _innerReadBookmarks((MAIN_CATEGORY.equals(category) ? "/" :
name), currentCategory, subset);
}
Iterator it = sfs.toplevelKeyIterator();
@@ -371,7 +372,7 @@
String line = sfs.get(key);
try {
BookmarkItem item = new BookmarkItem(line, node.alerts);
- String name = prefix + category.name + '/' +item.name;
+ String name = ("".equals(prefix) ? "" : prefix +
category.name) + '/' +item.name;
putPaths(name, item);
category.addBookmark(item);
} catch (MalformedURLException e) {