From 82fefc621680e1a3a7721b159239595364bd5e55 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 13 Jan 2011 08:50:41 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20issue=20while=20updating=20a=20Bund?= =?UTF-8?q?le=20by=20identifying=20it=20via=20UUID=20but=20different=20spB?= =?UTF-8?q?undle=20file=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPAppController.m | 5 +++-- Source/SPBundleEditorController.m | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/SPAppController.m b/Source/SPAppController.m index ee400a06..7f405dba 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -568,10 +568,11 @@ YY_BUFFER_STATE yy_scan_string (const char *); NSInteger answer = [alert runModal]; if(answer == NSAlertDefaultReturn) { NSError *error = nil; - NSString *moveToTrashCommand = [NSString stringWithFormat:@"osascript -e 'tell application \"Finder\" to move (POSIX file \"%@\") to the trash'", newPath]; + NSString *removePath = [[[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"] substringToIndex:([[[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"] length]-[SPBundleFileName length]-1)]; + NSString *moveToTrashCommand = [NSString stringWithFormat:@"osascript -e 'tell application \"Finder\" to move (POSIX file \"%@\") to the trash'", removePath]; [moveToTrashCommand runBashCommandWithEnvironment:nil atCurrentDirectoryPath:nil error:&error]; if(error != nil) { - NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while moving “%@” to Trash.", @"Open Files : Bundle : Already-Installed : Delete-Old-Error : Could not delete old bundle before installing new version."), [[installedBundleUUIDs objectForKey:[cmdData objectForKey:SPBundleFileUUIDKey]] objectForKey:@"path"]] + NSAlert *alert = [NSAlert alertWithMessageText:[NSString stringWithFormat:NSLocalizedString(@"Error while moving “%@” to Trash.", @"Open Files : Bundle : Already-Installed : Delete-Old-Error : Could not delete old bundle before installing new version."), removePath] defaultButton:NSLocalizedString(@"OK", @"Open Files : Bundle : Already-Installed : Delete-Old-Error : OK button") alternateButton:nil otherButton:nil diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index ce80acde..173a8dbf 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -1031,10 +1031,10 @@ if(deletionSuccessfully) { [commandBundleTreeController removeObjectsAtArrangedObjectIndexPaths:selIndexPaths]; [commandBundleTreeController rearrangeObjects]; - } else { - [self reloadBundles:self]; } + [self reloadBundles:self]; + // Set focus to table view to avoid an unstable state [[self window] makeFirstResponder:commandsOutlineView]; -- cgit v1.2.3