Switching from string comparisons to string isequal messages.

This commit is contained in:
Samuel Clay 2013-02-06 15:15:43 -08:00
parent dc9e21e352
commit e8fae006a4
7 changed files with 25 additions and 24 deletions

View file

@ -333,7 +333,7 @@
NEWSBLUR_URL,
self.feedPage];
}
} else if (appDelegate.activeFolder == @"saved_stories") {
} else if ([appDelegate.activeFolder isEqual:@"saved_stories"]) {
theFeedDetailURL = [NSString stringWithFormat:
@"http://%@/reader/starred_stories/?page=%d",
NEWSBLUR_URL,

View file

@ -56,7 +56,7 @@
[unreadCount calculateOffsets:counts.ps nt:counts.nt];
countWidth = [unreadCount offsetWidth];
[self addSubview:unreadCount];
} else if (folderName == @"saved_stories") {
} else if ([folderName isEqual:@"saved_stories"]) {
unreadCount = [[UnreadCountView alloc] initWithFrame:rect];
unreadCount.appDelegate = appDelegate;
unreadCount.opaque = NO;
@ -104,7 +104,7 @@
folderTitle = [@"All Shared Stories" uppercaseString];
} else if (section == 2) {
folderTitle = [@"All Stories" uppercaseString];
} else if (folderName == @"saved_stories") {
} else if ([folderName isEqual:@"saved_stories"]) {
folderTitle = [@"Saved Stories" uppercaseString];
} else {
folderTitle = [[appDelegate.dictFoldersArray objectAtIndex:section] uppercaseString];
@ -135,7 +135,7 @@
disclosureButton.frame = CGRectMake(customView.frame.size.width - 32, 1, 29, 29);
// Add collapse button to all folders except Everything
if (section != 0 && section != 2 && folderName != @"saved_stories") {
if (section != 0 && section != 2 && ![folderName isEqual:@"saved_stories"]) {
if (!isFolderCollapsed) {
disclosureButton.transform = CGAffineTransformMakeRotation(M_PI_2);
}
@ -169,7 +169,7 @@
} else {
folderImageViewX = 7;
}
} else if (folderName == @"saved_stories") {
} else if ([folderName isEqual:@"saved_stories"]) {
folderImage = [UIImage imageNamed:@"clock.png"];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
folderImageViewX = 10;

View file

@ -85,7 +85,8 @@
- (void)reload {
BOOL isTopLevel = [[appDelegate.activeFolder trim] isEqualToString:@""] || appDelegate.activeFolder == @"everything";
BOOL isTopLevel = [[appDelegate.activeFolder trim] isEqualToString:@""] ||
[appDelegate.activeFolder isEqual:@"everything"];
int row = 0;
[toFolderInput setText:@""];

View file

@ -969,16 +969,16 @@
int total = 0;
NSArray *folder;
if (folderName == @"river_blurblogs" ||
(!folderName && self.activeFolder == @"river_blurblogs")) {
if ([folderName isEqual:@"river_blurblogs"] ||
(!folderName && [self.activeFolder isEqual:@"river_blurblogs"])) {
for (id feedId in self.dictSocialFeeds) {
total += [self unreadCountForFeed:feedId];
}
} else if (folderName == @"river_global" ||
(!folderName && self.activeFolder == @"river_global")) {
} else if ([folderName isEqual:@"river_global"] ||
(!folderName && [self.activeFolder isEqual:@"river_global"])) {
total = 0;
} else if (folderName == @"everything" ||
(!folderName && self.activeFolder == @"everything")) {
} else if ([folderName isEqual:@"everything"] ||
(!folderName && [self.activeFolder isEqual:@"everything"])) {
for (id feedId in self.dictFeeds) {
total += [self unreadCountForFeed:feedId];
}
@ -1036,16 +1036,16 @@
return counts;
}
if (folderName == @"river_blurblogs" ||
(!folderName && self.activeFolder == @"river_blurblogs")) {
if ([folderName isEqual:@"river_blurblogs"] ||
(!folderName && [self.activeFolder isEqual:@"river_blurblogs"])) {
for (id feedId in self.dictSocialFeeds) {
[counts addCounts:[self splitUnreadCountForFeed:feedId]];
}
} else if (folderName == @"river_global" ||
(!folderName && self.activeFolder == @"river_global")) {
} else if ([folderName isEqual:@"river_global"] ||
(!folderName && [self.activeFolder isEqual:@"river_global"])) {
// Nothing for global
} else if (folderName == @"everything" ||
(!folderName && self.activeFolder == @"everything")) {
} else if ([folderName isEqual:@"everything"] ||
(!folderName && [self.activeFolder isEqual:@"everything"])) {
for (id feedId in self.dictFeeds) {
[counts addCounts:[self splitUnreadCountForFeed:feedId]];
}
@ -1416,7 +1416,7 @@
}
- (void)markActiveFolderAllRead {
if (self.activeFolder == @"everything") {
if ([self.activeFolder isEqual:@"everything"]) {
for (NSString *folderName in self.dictFoldersArray) {
for (id feedId in [self.dictFolders objectForKey:folderName]) {
[self markFeedAllRead:feedId];
@ -1483,7 +1483,7 @@
- (NSString *)extractParentFolderName:(NSString *)folderName {
if ([folderName containsString:@"Top Level"] ||
folderName == @"everything") {
[folderName isEqual:@"everything"]) {
folderName = @"";
}
@ -1499,7 +1499,7 @@
- (NSString *)extractFolderName:(NSString *)folderName {
if ([folderName containsString:@"Top Level"] ||
folderName == @"everything") {
[folderName isEqual:@"everything"]) {
folderName = @"";
}
if ([folderName containsString:@" - "]) {

View file

@ -798,7 +798,7 @@ heightForHeaderInSection:(NSInteger)section {
NSString *folderName = [appDelegate.dictFoldersArray objectAtIndex:section];
BOOL visibleFeeds = [[self.visibleFolders objectForKey:folderName] boolValue];
if (!visibleFeeds && section != 2 && section != 0 && folderName != @"saved_stories") {
if (!visibleFeeds && section != 2 && section != 0 && ![folderName isEqual:@"saved_stories"]) {
return 0;
}

View file

@ -771,7 +771,7 @@
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (keyPath == @"contentOffset") {
if ([keyPath isEqual:@"contentOffset"]) {
if (self.webView.scrollView.contentOffset.y < (-1 * self.feedTitleGradient.frame.size.height + 1)) {
// Pulling
if (!pullingScrollview) {

View file

@ -423,7 +423,7 @@
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &&
keyPath == @"contentOffset" &&
[keyPath isEqual:@"contentOffset"] &&
self.isDraggingScrollview) {
CGFloat pageWidth = self.scrollView.frame.size.width;
float fractionalPage = self.scrollView.contentOffset.x / pageWidth;