Browse Source

macosx: remove occurances of unsafe_unretained

pull/91/head
Felix Paul Kühne 7 years ago
parent
commit
1c8ad8f231
  1. 8
      modules/gui/macosx/panels/VLCAudioEffectsWindowController.m
  2. 6
      modules/gui/macosx/panels/VLCVideoEffectsWindowController.m
  3. 2
      modules/gui/macosx/preferences/prefs.m
  4. 4
      modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m
  5. 4
      modules/gui/macosx/windows/video/VLCWindow.m

8
modules/gui/macosx/panels/VLCAudioEffectsWindowController.m

@ -497,7 +497,7 @@
[_textfieldPanel setCancelButtonString:_NS("Cancel")];
[_textfieldPanel setOkButtonString:_NS("Save")];
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_textfieldPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSString *resultingText) {
NSInteger currentProfileIndex = [_self currentProfileIndex];
@ -552,7 +552,7 @@
[_popupPanel setCancelButtonString:_NS("Cancel")];
[_popupPanel setPopupButtonContent:[self nonDefaultProfileNames]];
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
NSInteger currentProfileIndex = [_self currentProfileIndex];
@ -798,7 +798,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
[_textfieldPanel setCancelButtonString:_NS("Cancel")];
[_textfieldPanel setOkButtonString:_NS("Save")];
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_textfieldPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSString *resultingText) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@ -842,7 +842,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
[_popupPanel setCancelButtonString:_NS("Cancel")];
[_popupPanel setPopupButtonContent:[[NSUserDefaults standardUserDefaults] objectForKey:@"EQTitles"]];
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
if (returnCode != NSModalResponseOK)

6
modules/gui/macosx/panels/VLCVideoEffectsWindowController.m

@ -783,8 +783,7 @@
[_textfieldPanel setCancelButtonString:_NS("Cancel")];
[_textfieldPanel setOkButtonString:_NS("Save")];
// TODO: Change to weak, when dropping 10.7 support
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_textfieldPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSString *resultingText) {
NSInteger currentProfileIndex = [_self currentProfileIndex];
@ -842,8 +841,7 @@
[_popupPanel setCancelButtonString:_NS("Cancel")];
[_popupPanel setPopupButtonContent:[self nonDefaultProfileNames]];
// TODO: Change to weak, when dropping 10.7 support
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {

2
modules/gui/macosx/preferences/prefs.m

@ -86,7 +86,7 @@
NSMutableArray *_options;
NSMutableArray *_subviews;
}
@property (readwrite, unsafe_unretained) VLCPrefs *prefsViewController;
@property (readwrite, weak) VLCPrefs *prefsViewController;
- (id)initWithName:(NSString*)name;

4
modules/gui/macosx/windows/convertandsave/VLCConvertAndSaveWindowController.m

@ -333,7 +333,7 @@
[_popupPanel setCancelButtonString:_NS("Cancel")];
[_popupPanel setPopupButtonContent:self.profileNames];
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
if (returnCode != NSModalResponseOK)
@ -480,7 +480,7 @@
[_textfieldPanel setCancelButtonString: _NS("Cancel")];
[_textfieldPanel setOkButtonString: _NS("Save")];
__unsafe_unretained typeof(self) _self = self;
__weak typeof(self) _self = self;
[_textfieldPanel runModalForWindow:_customizePanel completionHandler:^(NSInteger returnCode, NSString *resultingText) {
if (returnCode != NSModalResponseOK || [resultingText length] == 0)
return;

4
modules/gui/macosx/windows/video/VLCWindow.m

@ -94,7 +94,7 @@
// Animate window alpha value
[self setAlphaValue:1.0];
__unsafe_unretained typeof(self) this = self;
__weak typeof(self) this = self;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
[[NSAnimationContext currentContext] setDuration:0.9];
[[this animator] setAlphaValue:0.0];
@ -114,7 +114,7 @@
[super orderOut:self];
return;
}
__unsafe_unretained typeof(self) this = self;
__weak typeof(self) this = self;
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
[[NSAnimationContext currentContext] setDuration:0.5];
[[this animator] setAlphaValue:0.0];

Loading…
Cancel
Save