Index: trunk/ICeCoffEE/ICeCoffEE/APEMain.m
===================================================================
--- trunk/ICeCoffEE/ICeCoffEE/APEMain.m	(revision 183)
+++ trunk/ICeCoffEE/ICeCoffEE/APEMain.m	(revision 216)
@@ -16,4 +16,5 @@
 #import <ApplicationEnhancer/APETools.h>
 #import <objc/objc-runtime.h>
+#import "SmartCrashReportsAPI.h"
 #import "ICeCoffEE.h"
 #import "ICeCoffEETextEdit.h"
@@ -67,9 +68,17 @@
 CFBundleRef ICCF_bundle;
 
-// With APE 1.3, if we're in the exclude list, APEBundleMainEarlyLoad doesn't get invoked; don't need to use APETools.  But we need to do our own management to avoid loading in non-GUI appllications.
+// With APE 1.3, if we're in the exclude list, APEBundleMainEarlyLoad doesn't get invoked; don't need to use APETools.  But we need to do our own management to avoid loading in non-GUI applications.
 Boolean ICCF_shouldLoad;
 
 void APEBundleMainEarlyLoad(CFBundleRef inBundle, CFStringRef inAPEToolsApplicationID)
 {
+    OSStatus err;
+
+    err = UnsanitySCR_RegisterMatchSpecifier(kICBundleIdentifier, CFSTR("Nicholas Riley"),
+                                             NULL, CFSTR("SCR-5E5C696784"), NULL);
+    if (err != noErr) {
+        apeprintf("ICeCoffEE APE: Can't register with Smart Crash Reports (error %ld)\n", err);
+    }
+    
     ICCF_MigratePrefs();
 
@@ -83,5 +92,5 @@
 
     CPSProcessSerNum psn;
-    OSStatus err = CPSGetCurrentProcess(&psn);
+    err = CPSGetCurrentProcess(&psn);
     if (err != noErr) {
 #if ICCF_DEBUG
@@ -92,5 +101,5 @@
 #endif
     }
-    
+
     CPSProcessInfoRec info;
     err = CPSGetProcessInfo(&psn, &info, NULL, 0, NULL, NULL, 0);
@@ -128,5 +137,5 @@
         if (ICCF_CFBundleIDMatches(bundleID, CFSTR("com.apple.xcode"))) {
             ICCF_PatchMethod("PBXTextView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:");
-            ICapeprintf("ICeCoffEE APE: loaded in PBXTextView for PB!\n");
+            ICapeprintf("ICeCoffEE APE: loaded in PBXTextView for Xcode\n");
             shouldLoadInNSTextView = NO;
         } else if (ICCF_CFBundleIDMatches(bundleID, CFSTR("com.apple.terminal"))) {
@@ -137,7 +146,7 @@
             ICCF_PatchMethod("TermSubview", "ICeCoffEETerminal", "ICECoffEETermSubviewSuper", "mouseUp:") &&
             ICCF_PatchMethod("TermSubview", "ICeCoffEETerminal", "ICECoffEETermSubviewSuper", "draggingEntered:") &&
-            ICCF_PatchMethod("TermSubview", "ICeCoffEETerminal", "ICECoffEETermSubviewSuper", "_optionClickEvent:::") ,
-            ICapeprintf("ICeCoffEE APE: loaded in TermSubview for Terminal!\n");
-        } else if (ICCF_CFBundleIDMatches(bundleID, CFSTR("org.mozilla.navigator"))) {
+            ICCF_PatchMethod("TermSubview", "ICeCoffEETerminal", "ICECoffEETermSubviewSuper", "_optionClickEvent:::");
+            ICapeprintf("ICeCoffEE APE: loaded in TermSubview for Terminal\n");
+        } else if (ICCF_CFBundleIDMatches(bundleID, CFSTR("org.mozilla.camino"))) {
             ICCF_PatchMethod("ChildView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:");
             ICapeprintf("ICeCoffEE APE: loaded in ChildView for Camino\n");
@@ -147,10 +156,10 @@
     ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "mouseUp:") &&
         ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "mouseDown:") &&
-        ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "menuForEvent:"),
+        ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "menuForEvent:");
         ICapeprintf("ICeCoffEE APE: loaded in WebHTMLView for WebKit/Safari\n");
     
     if (shouldLoadInNSTextView) {
         ICCF_PatchMethod("NSTextView", "ICeCoffEE", "ICeCoffEESuper", "mouseDown:") &&
-        ICCF_PatchMethod("NSTextView", "ICeCoffEE", "ICeCoffEESuper", "menuForEvent:") ,
+        ICCF_PatchMethod("NSTextView", "ICeCoffEE", "ICeCoffEESuper", "menuForEvent:");
         ICapeprintf("ICeCoffEE APE: loaded generic NSTextView support\n");
     }
