aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPAppController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r--Source/SPAppController.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m
index d9fe64bb..3cd718db 100644
--- a/Source/SPAppController.m
+++ b/Source/SPAppController.m
@@ -54,6 +54,7 @@
bundleItems = [[NSMutableDictionary alloc] initWithCapacity:1];
bundleCategories = [[NSMutableDictionary alloc] initWithCapacity:1];
+ bundleTriggers = [[NSMutableDictionary alloc] initWithCapacity:1];
bundleUsedScopes = [[NSMutableArray alloc] initWithCapacity:1];
bundleKeyEquivalents = [[NSMutableDictionary alloc] initWithCapacity:1];
installedBundleUUIDs = [[NSMutableDictionary alloc] initWithCapacity:1];
@@ -1179,6 +1180,7 @@
[bundleItems removeAllObjects];
[bundleUsedScopes removeAllObjects];
[bundleCategories removeAllObjects];
+ [bundleTriggers removeAllObjects];
[bundleKeyEquivalents removeAllObjects];
[installedBundleUUIDs removeAllObjects];
@@ -1234,6 +1236,13 @@
[aDict setObject:[cmdData objectForKey:SPBundleFileNameKey] forKey:SPBundleInternLabelKey];
[aDict setObject:infoPath forKey:SPBundleInternPathToFileKey];
+ // Register trigger
+ if([cmdData objectForKey:SPBundleFileTriggerKey]) {
+ if(![bundleTriggers objectForKey:[cmdData objectForKey:SPBundleFileTriggerKey]])
+ [bundleTriggers setObject:[NSMutableArray array] forKey:[cmdData objectForKey:SPBundleFileTriggerKey]];
+ [[bundleTriggers objectForKey:[cmdData objectForKey:SPBundleFileTriggerKey]] addObject:[NSString stringWithFormat:@"%@|%@", infoPath, [cmdData objectForKey:SPBundleFileScopeKey]]];
+ }
+
if([cmdData objectForKey:SPBundleFileKeyEquivalentKey] && [[cmdData objectForKey:SPBundleFileKeyEquivalentKey] length]) {
NSString *theKey = [cmdData objectForKey:SPBundleFileKeyEquivalentKey];
NSString *theChar = [theKey substringFromIndex:[theKey length]-1];
@@ -1518,6 +1527,11 @@
return [bundleCategories objectForKey:scope];
}
+- (NSArray *)bundleCommandsForTrigger:(NSString*)trigger
+{
+ return [bundleTriggers objectForKey:trigger];
+}
+
- (NSArray *)bundleItemsForScope:(NSString*)scope
{
return [bundleItems objectForKey:scope];
@@ -1595,6 +1609,7 @@
if(bundleItems) [bundleItems release];
if(bundleUsedScopes) [bundleUsedScopes release];
if(bundleCategories) [bundleCategories release];
+ if(bundleTriggers) [bundleTriggers release];
if(bundleKeyEquivalents) [bundleKeyEquivalents release];
if(installedBundleUUIDs) [installedBundleUUIDs release];
if (runningActivitiesArray) [runningActivitiesArray release];