Workaround for “format string is not a string literal” warning

This commit is contained in:
Allan Odgaard
2014-03-13 20:35:00 +07:00
parent cf8f796053
commit 9a9614e264
3 changed files with 4 additions and 4 deletions

View File

@@ -243,7 +243,7 @@ BOOL HasDocumentWindow (NSArray* windows)
if(promptUser)
{
NSInteger choice = NSRunAlertPanel(@"Disable Session Restore?", promptUser, @"Disable", @"Restore Documents", nil);
NSInteger choice = NSRunAlertPanel(@"Disable Session Restore?", @"%@", @"Disable", @"Restore Documents", nil, promptUser);
if(choice == NSAlertDefaultReturn) // "Disable"
restoreSession = NO;
}

View File

@@ -36,7 +36,7 @@ OAK_DEBUG_VAR(HTMLOutput_WebViewDelegate);
- (BOOL)webView:(WebView*)sender runJavaScriptConfirmPanelWithMessage:(NSString*)message initiatedByFrame:(WebFrame*)frame
{
return NSAlertDefaultReturn == NSRunAlertPanel(NSLocalizedString(@"Script Message", @"JavaScript alert title"), message, NSLocalizedString(@"OK", @"JavaScript alert confirmation"), NSLocalizedString(@"Cancel", @"JavaScript alert cancel"), nil);
return NSAlertDefaultReturn == NSRunAlertPanel(NSLocalizedString(@"Script Message", @"JavaScript alert title"), @"%@", NSLocalizedString(@"OK", @"JavaScript alert confirmation"), NSLocalizedString(@"Cancel", @"JavaScript alert cancel"), nil, message);
}
- (void)webView:(WebView*)sender runOpenPanelForFileButtonWithResultListener:(id <WebOpenPanelResultListener>)resultListener

View File

@@ -66,7 +66,7 @@ NSString* const OakFileManagerPathKey = @"directory";
NSArray* contents = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:dirURL includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsHiddenFiles error:&error];
if([contents count] != 0)
{
NSInteger choice = NSRunCriticalAlertPanel(@"Folder Not Empty!", [self expandFormat:@"Do you wish to delete “%@” and all the contained items?" withURL:dirURL], @"Delete Folder", @"Cancel", nil);
NSInteger choice = NSRunCriticalAlertPanel(@"Folder Not Empty!", @"%@", @"Delete Folder", @"Cancel", nil, [self expandFormat:@"Do you wish to delete “%@” and all the contained items?" withURL:dirURL]);
if(choice == NSAlertAlternateReturn) // "Cancel"
return;
}
@@ -103,7 +103,7 @@ NSString* const OakFileManagerPathKey = @"directory";
{
if([fileSize unsignedLongLongValue])
{
NSInteger choice = NSRunCriticalAlertPanel(@"Document Not Empty!", [self expandFormat:@"Do you wish to delete “%@”?" withURL:fileURL], @"Delete Document", @"Cancel", nil);
NSInteger choice = NSRunCriticalAlertPanel(@"Document Not Empty!", @"%@", @"Delete Document", @"Cancel", nil, [self expandFormat:@"Do you wish to delete “%@”?" withURL:fileURL]);
if(choice == NSAlertAlternateReturn) // "Cancel"
return;
}