diff options
author | Bibiko <bibiko@eva.mpg.de> | 2011-01-13 08:50:41 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2011-01-13 08:50:41 +0000 |
commit | 82fefc621680e1a3a7721b159239595364bd5e55 (patch) | |
tree | 03e03cdafc09f79f97051e84cd10c7e64ae3003c /Source | |
parent | 15ad4cdf44427d5a9595a0d7a15257ed79eae8ae (diff) | |
download | sequelpro-82fefc621680e1a3a7721b159239595364bd5e55.tar.gz sequelpro-82fefc621680e1a3a7721b159239595364bd5e55.tar.bz2 sequelpro-82fefc621680e1a3a7721b159239595364bd5e55.zip |
• fixed issue while updating a Bundle by identifying it via UUID but different spBundle file name
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPAppController.m | 5 | ||||
-rw-r--r-- | Source/SPBundleEditorController.m | 4 |
2 files changed, 5 insertions, 4 deletions
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]; |