Commit 68d6d24d authored by sullivan's avatar sullivan

WebKit:

	- WebKit part of fix for 3124949 -- Alexander recreates the
	default set of bookmarks every time a separate app copy is launched

        Reviewed by Darin

        * Bookmarks.subproj/WebBookmarkGroup.h:
	new _tag ivar and -tag method.

        * Bookmarks.subproj/WebBookmarkGroup.m:
        (-[WebBookmarkGroup dealloc]):
	release _tag
        (-[WebBookmarkGroup tag]):
	return _tag
        (-[WebBookmarkGroup _loadBookmarkGroupGuts]):
	read _tag from the dictionary in the file (or leave it at
	nil if there's no value in the file).

        * English.lproj/StringsNotToBeLocalized.txt:
	kept this file up to date

WebBrowser:

	- WebBrowser part of fix for 3124949 -- Alexander recreates the
	default set of bookmarks every time a separate app copy is launched

        Reviewed by Darin

        * BookmarksController.m:
        (-[BookmarksController mergeBuiltInBookmarksIfNecessary]):
	if the mod date has changed since the last time this was
	checked, check the tag in the bookmarks	group (loaded from the
	file) to see if it has changed. If the tag hasn't changed, then
	don't merge the built-in bookmarks.

        * PreferenceKeys.h:
	new #define BuiltInBookmarksTagPreferenceKey

        * English.lproj/BuiltInBookmarks.plist:
	Added tag (happens to be string that looks like a date) to
	this file. We'll update this whenever we update the contents.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7f3f4ea2
......@@ -25,6 +25,7 @@ extern NSString *WebBookmarkChildrenKey;
@interface WebBookmarkGroup : NSObject
{
NSString *_tag;
NSString *_file;
WebBookmark *_topBookmark;
BOOL _loading;
......@@ -55,6 +56,11 @@ extern NSString *WebBookmarkChildrenKey;
// Load bookmark group from file. This happens automatically at init time, and need not normally be called.
- (BOOL)loadBookmarkGroup;
// Marker for bookmark group, read from file. This cannot be changed in the current implementation.
// It can be used to see whether one file represents the same WebBookmarkGroup as another. If no
// tag is stored in the file, returns nil.
- (NSString *)tag;
// Save bookmark group to file. It is the client's responsibility to call this at appropriate times.
- (BOOL)saveBookmarkGroup;
......
......@@ -20,6 +20,7 @@
NSString *WebBookmarkWillChangeNotification = @"WebBookmarkWillChangeNotification";
NSString *WebModifiedBookmarkKey = @"WebModifiedBookmarkKey";
NSString *WebBookmarkChildrenKey = @"WebBookmarkChildrenKey";
NSString *TagKey = @"WebBookmarkGroupTag";
@interface WebBookmarkGroup (WebForwardDeclarations)
- (void)_setTopBookmark:(WebBookmark *)newTopBookmark;
......@@ -50,10 +51,16 @@ - (id)initWithFile: (NSString *)file
- (void)dealloc
{
[_file release];
[_tag release];
[_topBookmark release];
[super dealloc];
}
- (NSString *)tag
{
return _tag;
}
- (WebBookmark *)topBookmark
{
return _topBookmark;
......@@ -186,6 +193,13 @@ - (BOOL)_loadBookmarkGroupGuts
return NO;
}
// If the bookmark group has a tag, it's in the root-level dictionary.
NSString *tagFromFile = [dictionary objectForKey:TagKey];
// we don't trust data read from disk, so double-check
if ([tagFromFile isKindOfClass:[NSString class]]) {
_tag = [tagFromFile retain];
}
_loading = YES;
newTopBookmark = [[WebBookmarkList alloc] initFromDictionaryRepresentation:dictionary withGroup:self];
[self _setTopBookmark:newTopBookmark];
......
2002-12-19 John Sullivan <sullivan@apple.com>
- WebKit part of fix for 3124949 -- Alexander recreates the
default set of bookmarks every time a separate app copy is launched
Reviewed by Darin
* Bookmarks.subproj/WebBookmarkGroup.h:
new _tag ivar and -tag method.
* Bookmarks.subproj/WebBookmarkGroup.m:
(-[WebBookmarkGroup dealloc]):
release _tag
(-[WebBookmarkGroup tag]):
return _tag
(-[WebBookmarkGroup _loadBookmarkGroupGuts]):
read _tag from the dictionary in the file (or leave it at
nil if there's no value in the file).
* English.lproj/StringsNotToBeLocalized.txt:
kept this file up to date
2002-12-19 Darin Adler <darin@apple.com>
Reviewed by John.
......
......@@ -94,6 +94,7 @@
"WebBackForwardList:\n"
"WebBookmarkChildrenKey"
"WebBookmarkDidChangeNotification"
"WebBookmarkGroupTag"
"WebBookmarkIdentifier"
"WebBookmarkType"
"WebBookmarkTypeLeaf"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment