summaryrefslogtreecommitdiffstats
path: root/Classes/Source.m
diff options
context:
space:
mode:
authormatt handler <matt.handler@gmail.com>2011-04-27 01:25:19 -0400
committermatt handler <matt.handler@gmail.com>2011-04-27 01:25:19 -0400
commite6eb634beac831e64becc03928a467701f9625cf (patch)
treebf6df33a2a77c6ee462438f9e0e38c1717414a4f /Classes/Source.m
parent39478a90674f2b4238ba1cfaa49908deb0200e24 (diff)
downloadpiccast-app-e6eb634beac831e64becc03928a467701f9625cf.tar.gz
piccast-app-e6eb634beac831e64becc03928a467701f9625cf.zip
made fetcher take a payload, added favicon, turned off statement caching, may turn it back on who knows, added sourceid to topics, added category to topictableviewcell, did a little cleaning
Diffstat (limited to 'Classes/Source.m')
-rw-r--r--Classes/Source.m11
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];
}