From 7c7f561f90f63ac0f086cb6c2c23eebd2cd9dc8a Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Latour Date: Wed, 2 Apr 2014 09:02:43 -0700 Subject: [PATCH] Fixed default footer for CLTs --- GCDWebUploader/GCDWebUploader.m | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/GCDWebUploader/GCDWebUploader.m b/GCDWebUploader/GCDWebUploader.m index 6bf96aa..ca2a048 100644 --- a/GCDWebUploader/GCDWebUploader.m +++ b/GCDWebUploader/GCDWebUploader.m @@ -112,6 +112,11 @@ NSString* title = uploader.title; if (title == nil) { title = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; +#if !TARGET_OS_IPHONE + if (title == nil) { + title = [[NSProcessInfo processInfo] processName]; + } +#endif } NSString* header = uploader.header; if (header == nil) { @@ -127,9 +132,15 @@ } NSString* footer = uploader.footer; if (footer == nil) { - footer = [NSString stringWithFormat:[siteBundle localizedStringForKey:@"FOOTER_FORMAT" value:@"" table:nil], - [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"], - [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]]; + NSString* name = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; + NSString* version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; +#if !TARGET_OS_IPHONE + if (!name && !version) { + name = @"OS X"; + version = [[NSProcessInfo processInfo] operatingSystemVersionString]; + } +#endif + footer = [NSString stringWithFormat:[siteBundle localizedStringForKey:@"FOOTER_FORMAT" value:@"" table:nil], name, version]; } return [GCDWebServerDataResponse responseWithHTMLTemplate:[siteBundle pathForResource:@"index" ofType:@"html"] variables:@{