Even more deprecations fixes.

CQTexperiment
Dzmitry Neviadomski 2021-01-27 05:45:02 +03:00
parent a0afe85130
commit 832fa6dbd0
4 changed files with 14 additions and 11 deletions

View File

@ -48,7 +48,7 @@
if (!type) if (!type)
{ {
ALog(@"GME: No type!"); ALog(@"GME: No type!");
return NO; return nil;
} }
Music_Emu* emu; Music_Emu* emu;
@ -56,7 +56,7 @@
if (!emu) if (!emu)
{ {
ALog(@"GME: No new emu!"); ALog(@"GME: No new emu!");
return NO; return nil;
} }
[source seek:0 whence:SEEK_END]; [source seek:0 whence:SEEK_END];
@ -68,7 +68,7 @@
if (error) if (error)
{ {
ALog(@"GME: ERROR Loding file!"); ALog(@"GME: ERROR Loding file!");
return NO; return nil;
} }
NSURL *m3uurl = [url URLByDeletingPathExtension]; NSURL *m3uurl = [url URLByDeletingPathExtension];

View File

@ -112,7 +112,7 @@ void * source_fopen(const char * path)
if ( ![[psf_file_container instance] try_hint:[NSString stringWithUTF8String:path] source:&source] ) if ( ![[psf_file_container instance] try_hint:[NSString stringWithUTF8String:path] source:&source] )
{ {
NSString * urlString = [NSString stringWithUTF8String:path]; NSString * urlString = [NSString stringWithUTF8String:path];
NSURL * url = [NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSURL * url = [NSURL URLWithString:[urlString stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]];
id audioSourceClass = NSClassFromString(@"AudioSource"); id audioSourceClass = NSClassFromString(@"AudioSource");
source = [audioSourceClass audioSourceForURL:url]; source = [audioSourceClass audioSourceForURL:url];
@ -1271,7 +1271,7 @@ static int usf_info(void * context, const char * name, const char * value)
info.trackPeak = 0; info.trackPeak = 0;
info.volume = 1; info.volume = 1;
currentUrl = [[[source url] absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; currentUrl = [[[source url] absoluteString] stringByRemovingPercentEncoding];
[[psf_file_container instance] add_hint:currentUrl source:currentSource]; [[psf_file_container instance] add_hint:currentUrl source:currentSource];
hintAdded = YES; hintAdded = YES;
@ -1706,7 +1706,7 @@ static int usf_info(void * context, const char * name, const char * value)
info.tag_length_ms = 0; info.tag_length_ms = 0;
info.tag_fade_ms = 0; info.tag_fade_ms = 0;
NSString * decodedUrl = [[url absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString * decodedUrl = [[url absoluteString] stringByRemovingPercentEncoding];
psf_load( [decodedUrl UTF8String], &source_callbacks, 0, 0, 0, psf_info_meta, &info, 0 ); psf_load( [decodedUrl UTF8String], &source_callbacks, 0, 0, 0, psf_info_meta, &info, 0 );

View File

@ -95,7 +95,7 @@ static SpotlightWindowController * searchController;
if (value == nil) return nil; if (value == nil) return nil;
// If there's an NS/CFNumber hiding in here... // If there's an NS/CFNumber hiding in here...
if([value respondsToSelector:@selector(stringValue:)]) if([value respondsToSelector:@selector(stringValue)])
{ {
return [value stringValue]; return [value stringValue];
} }

View File

@ -203,10 +203,13 @@ typedef id (*myIMP)(id, SEL, ...);
} }
else else
{ {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = NSLocalizedString(@"InvalidURLShort", @"");
alert.informativeText = NSLocalizedString(@"InvalidURLLong", @"");
if (mIsSheet) if (mIsSheet)
NSRunAlertPanel(NSLocalizedString(@"InvalidURLShort", @""), NSLocalizedString(@"InvalidURLLong", @""), nil, nil, nil); [alert runModal];
else else
NSBeginAlertSheet(NSLocalizedString(@"InvalidURLShort", @""), nil, nil, nil, mPanel, nil, nil, nil, nil, NSLocalizedString(@"InvalidURLLong", @"")); [alert beginSheetModalForWindow:mPanel completionHandler:nil];
informDelegate = NO; informDelegate = NO;
} }
@ -240,7 +243,7 @@ typedef id (*myIMP)(id, SEL, ...);
[[NSBundle mainBundle] loadNibNamed:@"OpenURLPanel" owner:self topLevelObjects:&objects]; [[NSBundle mainBundle] loadNibNamed:@"OpenURLPanel" owner:self topLevelObjects:&objects];
// start the sheet (or window) // start the sheet (or window)
[NSApp beginSheet:mPanel modalForWindow:window modalDelegate:nil didEndSelector:nil contextInfo:nil]; [window beginSheet:mPanel completionHandler:nil];
} }
- (void)close - (void)close