diff options
Diffstat (limited to 'Classes/Source.m')
-rw-r--r-- | Classes/Source.m | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Classes/Source.m b/Classes/Source.m index f36e41e..bde21b0 100644 --- a/Classes/Source.m +++ b/Classes/Source.m @@ -12,7 +12,7 @@ @implementation Source -@synthesize title, foreignId, subscribed, category; +@synthesize title, foreignId, subscribed, category, favicon; //+ (Topic *) initFromDatabaseRow:(FMResultSet *)result { // NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; @@ -41,6 +41,7 @@ source.foreignId = [NSNumber numberWithInt:[result intForColumn:@"foreignId"]]; source.subscribed = [result intForColumn:@"subscribed"] == 0 ? false : true; source.category = [result stringForColumn:@"category"]; + source.favicon = [result stringForColumn:@"favicon"]; return source; } @@ -50,7 +51,7 @@ Source *source = [[[Source alloc] init] autorelease]; //NSDictionary *info = [obj objectForKey:@"fields"]; - + source.favicon = [NSString stringWithFormat:@"http://www.%@.com/favicon.ico", [obj objectForKey:@"shortname"]]; //[obj objectForKey:@"favicon"]; source.title = [obj objectForKey:@"title"]; source.foreignId = [obj objectForKey:@"id"]; source.subscribed = false; @@ -63,10 +64,10 @@ [db retain]; [db executeUpdate:@"INSERT INTO subscribedSources \ - (foreignId, title, subscribed, category) \ + (foreignId, title, subscribed, category, favicon) \ VALUES \ - (?, ?, ?, ?);", - foreignId, title, [NSNumber numberWithInt:(subscribed ? 1 : 0)], category]; + (?, ?, ?, ?, ?);", + foreignId, title, [NSNumber numberWithInt:(subscribed ? 1 : 0)], category, favicon]; [db release]; } |