-Fixed a resource bug
-Fixed special characters in url bug (final)
This commit is contained in:
@@ -34,6 +34,13 @@
|
||||
[mainController loadFromDefaults:defaults];
|
||||
}
|
||||
|
||||
-(BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {
|
||||
if (!flag) {
|
||||
[window makeKeyAndOrderFront:self];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setBool:[quitWhenAllWindowClosedCheckBox state] == NSOnState forKey:@"Quit when all windows are closed"];
|
||||
|
||||
@@ -69,10 +69,9 @@ typedef enum {
|
||||
}
|
||||
|
||||
-(NSString *) stringByFormattingQuery: (NSString *) q {
|
||||
NSRange stringRange = NSMakeRange(0, [q length]);
|
||||
//Can replace äöü with aou, no difference in results
|
||||
NSCharacterSet *characters = [[NSCharacterSet alphanumericCharacterSet] invertedSet];
|
||||
return [[[[[[q stringByReplacingOccurrencesOfString:@" " withString:@"+"] stringByReplacingOccurrencesOfString:@"Ö" withString:@"o" options:NSCaseInsensitiveSearch range:stringRange] stringByReplacingOccurrencesOfString:@"Ä" withString:@"a" options:NSCaseInsensitiveSearch range:stringRange] stringByReplacingOccurrencesOfString:@"Ü" withString:@"ü" options:NSCaseInsensitiveSearch range:stringRange] stringByReplacingOccurrencesOfString:@"&" withString:@"%26"] stringByTrimmingCharactersInSet:characters];
|
||||
return [[[q stringByReplacingOccurrencesOfString:@" " withString:@"+"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByTrimmingCharactersInSet:characters];
|
||||
}
|
||||
|
||||
-(PageType) typeOfPage: (NSString *) page {
|
||||
|
||||
@@ -46,15 +46,27 @@
|
||||
#pragma mark Outline view Data Source and Delegate
|
||||
|
||||
-(NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
|
||||
return item == nil ? [loadedResults count] : 0;
|
||||
if (item == nil) {
|
||||
return [loadedResults count];
|
||||
}
|
||||
if ([item isKindOfClass:[NSArray class]]) {
|
||||
return [item count];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
-(id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
|
||||
return [loadedResults objectAtIndex:index];
|
||||
if (item == nil) {
|
||||
return [loadedResults objectAtIndex:index];
|
||||
}
|
||||
if ([item isKindOfClass:[SearchResult class]]) {
|
||||
return [item objectAtIndex:index];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
|
||||
return NO;
|
||||
return [loadedResults containsObject:item];
|
||||
}
|
||||
|
||||
-(id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
|
||||
@@ -260,13 +272,13 @@
|
||||
int maxWidth = width-[rightView frame].size.width;
|
||||
return maxWidth;
|
||||
}*/
|
||||
|
||||
/*
|
||||
-(CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex {
|
||||
int outlineMinWith = [[resultsOutline tableColumnWithIdentifier:@"song"] minWidth] + [[resultsOutline tableColumnWithIdentifier:@"artist"] minWidth];
|
||||
int minWidth = outlineMinWith;
|
||||
return minWidth;
|
||||
}
|
||||
|
||||
*/
|
||||
#pragma mark window delegate
|
||||
|
||||
-(BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user