Skip to content

Commit 7fdd530

Browse files
committed
Fix main thread issue + better message when tryig to copy to (protected) /Applications folder
1 parent 2812fe5 commit 7fdd530

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSActionProvider_EmbeddedProviders.m

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,19 @@ - (QSObject *)moveFiles:(QSObject *)dObject toFolder:(QSObject *)iObject shouldC
800800
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:[thisFile stringByDeletingLastPathComponent]];
801801
[newPaths addObject:destinationFile];
802802
} else {
803-
NSString *message = [NSString stringWithFormat:NSLocalizedString(@"The following error occured while trying to move \"%1$@\" to \"%2$@\"\n\n%3$@", nil), thisFile, destination, [err localizedDescription]];
804-
[NSAlert runAlertWithTitle:NSLocalizedString(@"Move error", nil)
805-
message:message
806-
buttons:@[NSLocalizedString(@"OK", nil)]
807-
style:NSWarningAlertStyle];
803+
// check if destination is the /Applications folder, if so - make sure we have the right permsissions
804+
NSString *message = nil;
805+
if ([destination isEqualToString:@"/Applications"]) {
806+
message = [NSString stringWithFormat:NSLocalizedString(@"Could not copy to Applications folder. Make sure the \"App Managemnent\" permission is enabled for Quicksilver in System Preferences\n\n%@\n\n%@", nil), [err localizedDescription]];
807+
} else {
808+
message = [NSString stringWithFormat:NSLocalizedString(@"The following error occured while trying to move \"%1$@\" to \"%2$@\"\n\n%3$@", nil), thisFile, destination, [err localizedDescription]];
809+
}
810+
QSGCDMainSync(^{
811+
[NSAlert runAlertWithTitle:NSLocalizedString(@"Move error", nil)
812+
message:message
813+
buttons:@[NSLocalizedString(@"OK", nil)]
814+
style:NSWarningAlertStyle];
815+
});
808816
}
809817
}
810818
[[NSWorkspace sharedWorkspace] noteFileSystemChanged:destination];

0 commit comments

Comments
 (0)