-Fixed a resource bug
-Fixed special characters in url bug (final)
This commit is contained in:
@@ -61,4 +61,6 @@
|
|||||||
\cf0 \
|
\cf0 \
|
||||||
-Changed the maximum width of the search field\
|
-Changed the maximum width of the search field\
|
||||||
-Fixed a bug: "Network error" when having special characters in query\
|
-Fixed a bug: "Network error" when having special characters in query\
|
||||||
-Fixed a bug: Returned false results when having a "&" in the query}
|
-Fixed a bug: Returned false results when having a "&" in the query\
|
||||||
|
-Fixed a resource bug\
|
||||||
|
-Fixed special characters in url bug (final)}
|
||||||
@@ -34,6 +34,13 @@
|
|||||||
[mainController loadFromDefaults:defaults];
|
[mainController loadFromDefaults:defaults];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {
|
||||||
|
if (!flag) {
|
||||||
|
[window makeKeyAndOrderFront:self];
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
-(NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
[defaults setBool:[quitWhenAllWindowClosedCheckBox state] == NSOnState forKey:@"Quit when all windows are closed"];
|
[defaults setBool:[quitWhenAllWindowClosedCheckBox state] == NSOnState forKey:@"Quit when all windows are closed"];
|
||||||
|
|||||||
@@ -69,10 +69,9 @@ typedef enum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-(NSString *) stringByFormattingQuery: (NSString *) q {
|
-(NSString *) stringByFormattingQuery: (NSString *) q {
|
||||||
NSRange stringRange = NSMakeRange(0, [q length]);
|
|
||||||
//Can replace äöü with aou, no difference in results
|
//Can replace äöü with aou, no difference in results
|
||||||
NSCharacterSet *characters = [[NSCharacterSet alphanumericCharacterSet] invertedSet];
|
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 {
|
-(PageType) typeOfPage: (NSString *) page {
|
||||||
|
|||||||
@@ -46,15 +46,27 @@
|
|||||||
#pragma mark Outline view Data Source and Delegate
|
#pragma mark Outline view Data Source and Delegate
|
||||||
|
|
||||||
-(NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item {
|
-(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 {
|
-(id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item {
|
||||||
|
if (item == nil) {
|
||||||
return [loadedResults objectAtIndex:index];
|
return [loadedResults objectAtIndex:index];
|
||||||
|
}
|
||||||
|
if ([item isKindOfClass:[SearchResult class]]) {
|
||||||
|
return [item objectAtIndex:index];
|
||||||
|
}
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
|
-(BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
|
||||||
return NO;
|
return [loadedResults containsObject:item];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
|
-(id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item {
|
||||||
@@ -260,13 +272,13 @@
|
|||||||
int maxWidth = width-[rightView frame].size.width;
|
int maxWidth = width-[rightView frame].size.width;
|
||||||
return maxWidth;
|
return maxWidth;
|
||||||
}*/
|
}*/
|
||||||
|
/*
|
||||||
-(CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex {
|
-(CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex {
|
||||||
int outlineMinWith = [[resultsOutline tableColumnWithIdentifier:@"song"] minWidth] + [[resultsOutline tableColumnWithIdentifier:@"artist"] minWidth];
|
int outlineMinWith = [[resultsOutline tableColumnWithIdentifier:@"song"] minWidth] + [[resultsOutline tableColumnWithIdentifier:@"artist"] minWidth];
|
||||||
int minWidth = outlineMinWith;
|
int minWidth = outlineMinWith;
|
||||||
return minWidth;
|
return minWidth;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#pragma mark window delegate
|
#pragma mark window delegate
|
||||||
|
|
||||||
-(BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
-(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