From 9a9614e264cd1e88818ebab0664085b4fbcb408e Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Thu, 13 Mar 2014 20:35:00 +0700 Subject: [PATCH] =?UTF-8?q?Workaround=20for=20=E2=80=9Cformat=20string=20i?= =?UTF-8?q?s=20not=20a=20string=20literal=E2=80=9D=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/TextMate/src/AppController.mm | 2 +- Frameworks/HTMLOutput/src/browser/HOWebViewDelegateHelper.mm | 2 +- Frameworks/OakAppKit/src/OakFileManager.mm | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Applications/TextMate/src/AppController.mm b/Applications/TextMate/src/AppController.mm index 0d71fe73..7946ae4e 100644 --- a/Applications/TextMate/src/AppController.mm +++ b/Applications/TextMate/src/AppController.mm @@ -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; } diff --git a/Frameworks/HTMLOutput/src/browser/HOWebViewDelegateHelper.mm b/Frameworks/HTMLOutput/src/browser/HOWebViewDelegateHelper.mm index e82c130e..17d2cc6b 100644 --- a/Frameworks/HTMLOutput/src/browser/HOWebViewDelegateHelper.mm +++ b/Frameworks/HTMLOutput/src/browser/HOWebViewDelegateHelper.mm @@ -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 )resultListener diff --git a/Frameworks/OakAppKit/src/OakFileManager.mm b/Frameworks/OakAppKit/src/OakFileManager.mm index e6223701..7d722e8d 100644 --- a/Frameworks/OakAppKit/src/OakFileManager.mm +++ b/Frameworks/OakAppKit/src/OakFileManager.mm @@ -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; }