From 018811d6fb170946796eb7934fcdb16327dbae36 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 30 Sep 2023 02:19:15 +0200 Subject: MainMenu: Keep getting application name at runtime Originally, I hoped to include the application name from the Makefile at compile time, but that ended up being thorny due to application names with spaces and escaping concerns. Then I tried putting the application name in a constant, but didn't like that this required duplicating it in yet another place. Ultimately I've decided to stick with what I had originally, getting the application name at runtime from the bundle's Info.plist dictionary. --- src/MainMenu.m | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/MainMenu.m b/src/MainMenu.m index 229ac10..dc9b8a6 100644 --- a/src/MainMenu.m +++ b/src/MainMenu.m @@ -1,7 +1,5 @@ #import "MainMenu.h" -static const NSString *kAppName = @"Base Windowed Application"; - NSMenuItem *MainMenuCreateApplicationMenuItem(); NSMenuItem *MainMenuCreateFileMenuItem(); NSMenuItem *MainMenuCreateEditMenuItem(); @@ -48,9 +46,6 @@ NSMenu *MainMenuCreate() NSString *MainMenuGetApplicationName() { - NSLog(@"App name: %@", kAppName); - - // TODO: #define this from the Makefile NSString *application_name = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; if (!application_name) { -- cgit v1.2.3