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) {
|
for (NSUInteger i = 0; i < [login_items_array count]; ++i) {
|
||||||
LSSharedFileListItemRef item =
|
LSSharedFileListItemRef item =
|
||||||
reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
|
reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
|
||||||
CFURLRef item_url_ref = NULL;
|
base::ScopedCFTypeRef<CFErrorRef> error;
|
||||||
if (LSSharedFileListItemResolve(item, 0, &item_url_ref, NULL) == noErr &&
|
CFURLRef item_url_ref =
|
||||||
item_url_ref) {
|
LSSharedFileListItemCopyResolvedURL(item, 0, error.InitializeInto());
|
||||||
|
if (!error && item_url_ref) {
|
||||||
base::ScopedCFTypeRef<CFURLRef> item_url(item_url_ref);
|
base::ScopedCFTypeRef<CFURLRef> item_url(item_url_ref);
|
||||||
if (CFEqual(item_url, url)) {
|
if (CFEqual(item_url, url)) {
|
||||||
CFRetain(item);
|
CFRetain(item);
|
||||||
|
@ -265,9 +266,10 @@ void RemoveFromLoginItems() {
|
||||||
for (NSUInteger i = 0; i < [login_items_array count]; ++i) {
|
for (NSUInteger i = 0; i < [login_items_array count]; ++i) {
|
||||||
LSSharedFileListItemRef item =
|
LSSharedFileListItemRef item =
|
||||||
reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
|
reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
|
||||||
CFURLRef url_ref = NULL;
|
base::ScopedCFTypeRef<CFErrorRef> error;
|
||||||
if (LSSharedFileListItemResolve(item, 0, &url_ref, NULL) == noErr &&
|
CFURLRef url_ref =
|
||||||
item) {
|
LSSharedFileListItemCopyResolvedURL(item, 0, error.InitializeInto());
|
||||||
|
if (!error && url_ref) {
|
||||||
base::ScopedCFTypeRef<CFURLRef> url(url_ref);
|
base::ScopedCFTypeRef<CFURLRef> url(url_ref);
|
||||||
if ([[base::mac::CFToNSCast(url.get()) path]
|
if ([[base::mac::CFToNSCast(url.get()) path]
|
||||||
hasPrefix:[[NSBundle mainBundle] bundlePath]])
|
hasPrefix:[[NSBundle mainBundle] bundlePath]])
|
||||||
|
|
|
@ -167,20 +167,11 @@ NSString* AtomBundleMover::ContainingDiskImageDevice(NSString* bundlePath) {
|
||||||
NSData* data =
|
NSData* data =
|
||||||
[[[hdiutil standardOutput] fileHandleForReading] readDataToEndOfFile];
|
[[[hdiutil standardOutput] fileHandleForReading] readDataToEndOfFile];
|
||||||
|
|
||||||
NSDictionary* info = nil;
|
NSDictionary* info =
|
||||||
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
|
[NSPropertyListSerialization propertyListWithData:data
|
||||||
info = [NSPropertyListSerialization
|
options:NSPropertyListImmutable
|
||||||
propertyListWithData:data
|
format:NULL
|
||||||
options:NSPropertyListImmutable
|
error:NULL];
|
||||||
format:NULL
|
|
||||||
error:NULL];
|
|
||||||
} else {
|
|
||||||
info = [NSPropertyListSerialization
|
|
||||||
propertyListFromData:data
|
|
||||||
mutabilityOption:NSPropertyListImmutable
|
|
||||||
format:NULL
|
|
||||||
errorDescription:NULL];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (![info isKindOfClass:[NSDictionary class]])
|
if (![info isKindOfClass:[NSDictionary class]])
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -157,10 +157,13 @@ int ShowMessageBox(NativeWindow* parent_window,
|
||||||
callEndModal:true];
|
callEndModal:true];
|
||||||
|
|
||||||
NSWindow* window = parent_window->GetNativeWindow().GetNativeNSWindow();
|
NSWindow* window = parent_window->GetNativeWindow().GetNativeNSWindow();
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
[alert beginSheetModalForWindow:window
|
[alert beginSheetModalForWindow:window
|
||||||
modalDelegate:delegate
|
modalDelegate:delegate
|
||||||
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
||||||
contextInfo:nil];
|
contextInfo:nil];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
[NSApp runModalForWindow:window];
|
[NSApp runModalForWindow:window];
|
||||||
return ret_code;
|
return ret_code;
|
||||||
|
@ -196,11 +199,14 @@ void ShowMessageBox(NativeWindow* parent_window,
|
||||||
NSWindow* window =
|
NSWindow* window =
|
||||||
parent_window ? parent_window->GetNativeWindow().GetNativeNSWindow()
|
parent_window ? parent_window->GetNativeWindow().GetNativeNSWindow()
|
||||||
: nil;
|
: nil;
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
[alert
|
[alert
|
||||||
beginSheetModalForWindow:window
|
beginSheetModalForWindow:window
|
||||||
modalDelegate:delegate
|
modalDelegate:delegate
|
||||||
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
|
||||||
contextInfo:nil];
|
contextInfo:nil];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,8 +141,11 @@ void Beep() {
|
||||||
|
|
||||||
bool GetLoginItemEnabled() {
|
bool GetLoginItemEnabled() {
|
||||||
BOOL enabled = NO;
|
BOOL enabled = NO;
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
// SMJobCopyDictionary does not work in sandbox (see rdar://13626319)
|
// SMJobCopyDictionary does not work in sandbox (see rdar://13626319)
|
||||||
CFArrayRef jobs = SMCopyAllJobDictionaries(kSMDomainUserLaunchd);
|
CFArrayRef jobs = SMCopyAllJobDictionaries(kSMDomainUserLaunchd);
|
||||||
|
#pragma clang diagnostic pop
|
||||||
NSArray* jobs_ = CFBridgingRelease(jobs);
|
NSArray* jobs_ = CFBridgingRelease(jobs);
|
||||||
NSString* identifier = GetLoginHelperBundleIdentifier();
|
NSString* identifier = GetLoginHelperBundleIdentifier();
|
||||||
if (jobs_ && [jobs_ count] > 0) {
|
if (jobs_ && [jobs_ count] > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue