Revision: 27788
http://sourceforge.net/p/bibdesk/svn/27788
Author: hofman
Date: 2022-08-10 16:22:58 +0000 (Wed, 10 Aug 2022)
Log Message:
-----------
#define static strings
Modified Paths:
--------------
trunk/bibdesk/BDSKWebIconDatabase.m
Modified: trunk/bibdesk/BDSKWebIconDatabase.m
===================================================================
--- trunk/bibdesk/BDSKWebIconDatabase.m 2022-08-10 15:50:34 UTC (rev 27787)
+++ trunk/bibdesk/BDSKWebIconDatabase.m 2022-08-10 16:22:58 UTC (rev 27788)
@@ -43,6 +43,8 @@
#define ICONS_KEY @"icons"
#define ICONURLS_KEY @"iconURLs"
#define VERSION_KEY @"version"
+#define VERSION @"1"
+#define WEBICONS_FILENAME @"WebIcons.plist"
@interface BDSKWebIconDatabase ()
- (NSURL *)webIconDatabaseURL;
@@ -68,7 +70,7 @@
NSDictionary *dict = nil;
if (dbData) {
dict = [NSPropertyListSerialization propertyListWithData:dbData
options:NSPropertyListMutableContainers format:NULL error:NULL];
- if ([[dict objectForKey:VERSION_KEY] numericCompare:@"1"] ==
NSOrderedDescending)
+ if ([[dict objectForKey:VERSION_KEY] numericCompare:VERSION] ==
NSOrderedDescending)
dict == nil;
}
icons = [[NSMutableDictionary alloc] initWithDictionary:[dict
objectForKey:ICONS_KEY]];
@@ -130,7 +132,7 @@
}
- (NSURL *)webIconDatabaseURL {
- return [[[NSFileManager defaultManager] applicationSupportDirectoryURL]
URLByAppendingPathComponent:@"WebIcons.plist"];
+ return [[[NSFileManager defaultManager] applicationSupportDirectoryURL]
URLByAppendingPathComponent:WEBICONS_FILENAME];
}
- (void)handleApplicationWillTerminate:(NSNotification *)notification {
@@ -137,7 +139,7 @@
if (icons == nil || iconURLs == nil || [recentIcons count] == 0)
return;
NSURL *dbURL = [self webIconDatabaseURL];
- NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:iconURLs,
ICONURLS_KEY, icons, ICONS_KEY, @"1", VERSION_KEY, nil];
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:iconURLs,
ICONURLS_KEY, icons, ICONS_KEY, VERSION, VERSION_KEY, nil];
NSData *data = [NSPropertyListSerialization dataWithPropertyList:dict
format:NSPropertyListBinaryFormat_v1_0 options:0 error:NULL];
[data writeToURL:dbURL atomically:YES];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit