From 1a05118fca75f4f45579b3eecebe17fffb6a76ef Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 30 Sep 2023 02:10:41 +0200 Subject: MainMenu: Move application name to a constant Switch to a constant-stored application name from the Makefile-defined one. This makes it easier to render the application name without worrying about escaping differences between the Makefile and Objective-C. But I still don't like it compared to what I had before. --- Makefile | 1 - src/MainMenu.m | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index df1cb72..cfa25a1 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ LOCALIZABLE_STRINGS := $(shell find Internationalization -name Localizable.strin CFLAGS += -x objective-c CFLAGS += -Wall -Werror -CFLAGS += -DMK_APP_NAME="@\"$(APP_NAME)\"" LDFLAGS += -framework Cocoa diff --git a/src/MainMenu.m b/src/MainMenu.m index 0dff780..229ac10 100644 --- a/src/MainMenu.m +++ b/src/MainMenu.m @@ -1,6 +1,6 @@ #import "MainMenu.h" -#define AppName MK_APP_NAME +static const NSString *kAppName = @"Base Windowed Application"; NSMenuItem *MainMenuCreateApplicationMenuItem(); NSMenuItem *MainMenuCreateFileMenuItem(); @@ -48,7 +48,7 @@ NSMenu *MainMenuCreate() NSString *MainMenuGetApplicationName() { - NSLog(@"App name: %@", AppName); + NSLog(@"App name: %@", kAppName); // TODO: #define this from the Makefile NSString *application_name = [[NSBundle mainBundle] -- cgit v1.2.3