From 3e5f12ff3f11fc3e3669afd889c8f5852d1e3da5 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Sun, 29 Oct 2006 08:21:25 +0000 Subject: [PATCH] Lilypond path selection finally works --- Sources/VLAppController.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/VLAppController.mm b/Sources/VLAppController.mm index 9a787da..e935133 100644 --- a/Sources/VLAppController.mm +++ b/Sources/VLAppController.mm @@ -121,11 +121,15 @@ appVersion = [self lilypondVersion:appPath]; if (!appVersion) appPath = nil; + else + [appPath retain]; } if (toolPath) { toolVersion = [self lilypondVersion:toolPath]; if (!toolVersion) toolPath = nil; + else + [toolPath retain]; } NSMenuItem * toolItem = [lilypondPath itemAtIndex:0]; @@ -168,12 +172,12 @@ { NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - switch ([sender tag]) { + switch ([[sender selectedItem] tag]) { case 0: [defaults setObject:toolPath forKey:@"VLLilypondPath"]; break; case 1: - [defaults setObject:toolPath forKey:@"VLLilypondPath"]; + [defaults setObject:appPath forKey:@"VLLilypondPath"]; break; default: break;