| | 161 | // get the bookmark helper's icon |
|---|
| | 162 | bundleURL = ICCF_GetBookmarkHelperURL(inst); |
|---|
| | 163 | if (bundleURL == NULL) return kICBookmarkNoHelperErr; |
|---|
| | 164 | |
|---|
| | 165 | CFBundleRef bundle = CFBundleCreate(NULL, bundleURL); |
|---|
| | 166 | SAFE_RELEASE(bundleURL); |
|---|
| | 167 | if (bundle == NULL) return kICBookmarkNoHelperErr; |
|---|
| | 168 | |
|---|
| | 169 | CFStringRef iconFile = CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("CFBundleIconFile")); |
|---|
| | 170 | if (iconFile != NULL) { |
|---|
| | 171 | CFURLRef iconURL = CFBundleCopyResourceURL(bundle, iconFile, NULL, NULL); |
|---|
| | 172 | if (iconURL != NULL) { |
|---|
| | 173 | CFDictionaryAddValue(dict, kCFUserNotificationIconURLKey, iconURL); |
|---|
| | 174 | CFRelease(iconURL); |
|---|
| | 175 | } |
|---|
| | 176 | } |
|---|
| | 177 | |
|---|
| 175 | | // XXX suppress log message from Apple's code: |
|---|
| 176 | | // 2003-02-02 17:48:26.896 TextEdit[2790] CFLog (20): Add Bookmark: Bookmark name and description are optional. |
|---|
| 177 | | int errfd = dup(STDERR_FILENO), nullfd = open("/dev/null", O_WRONLY, 0); |
|---|
| 178 | | // need to have something open in STDERR_FILENO because if it isn't, |
|---|
| 179 | | // CFLog will log to /dev/console |
|---|
| 180 | | dup2(nullfd, STDERR_FILENO); |
|---|
| 181 | | close(nullfd); |
|---|