REVIEW: fix possible -Wdeprecated-declarations warnings
This commit is contained in:
parent
2ccf5904e0
commit
d7fea1b484
4 changed files with 22 additions and 20 deletions
|
@ -232,9 +232,10 @@ LSSharedFileListItemRef GetLoginItemForApp() {
|
|||
for (NSUInteger i = 0; i < [login_items_array count]; ++i) {
|
||||
LSSharedFileListItemRef item =
|
||||
reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
|
||||
CFURLRef item_url_ref = NULL;
|
||||
if (LSSharedFileListItemResolve(item, 0, &item_url_ref, NULL) == noErr &&
|
||||
item_url_ref) {
|
||||
base::ScopedCFTypeRef<CFErrorRef> error;
|
||||
CFURLRef item_url_ref =
|
||||
LSSharedFileListItemCopyResolvedURL(item, 0, error.InitializeInto());
|
||||
if (!error && item_url_ref) {
|
||||
base::ScopedCFTypeRef<CFURLRef> item_url(item_url_ref);
|
||||
if (CFEqual(item_url, url)) {
|
||||
CFRetain(item);
|
||||
|
@ -265,9 +266,10 @@ void RemoveFromLoginItems() {
|
|||
for (NSUInteger i = 0; i < [login_items_array count]; ++i) {
|
||||
LSSharedFileListItemRef item =
|
||||
reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
|
||||
CFURLRef url_ref = NULL;
|
||||
if (LSSharedFileListItemResolve(item, 0, &url_ref, NULL) == noErr &&
|
||||
item) {
|
||||
base::ScopedCFTypeRef<CFErrorRef> error;
|
||||
CFURLRef url_ref =
|
||||
LSSharedFileListItemCopyResolvedURL(item, 0, error.InitializeInto());
|
||||
if (!error && url_ref) {
|
||||
base::ScopedCFTypeRef<CFURLRef> url(url_ref);
|
||||
if ([[base::mac::CFToNSCast(url.get()) path]
|
||||
hasPrefix:[[NSBundle mainBundle] bundlePath]])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue