[vlc-commits] macosx: Modernize code style for VLCTimeField

David Fuhrmann git at videolan.org
Tue Apr 6 09:55:48 UTC 2021


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Tue Apr  6 11:31:05 2021 +0200| [84847c28514a802585094338d2622be4bcdd0c89] | committer: David Fuhrmann

macosx: Modernize code style for VLCTimeField

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=84847c28514a802585094338d2622be4bcdd0c89
---

 modules/gui/macosx/VLCTimeField.h |  2 +-
 modules/gui/macosx/VLCTimeField.m | 26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/gui/macosx/VLCTimeField.h b/modules/gui/macosx/VLCTimeField.h
index 56a16c3645..ebb64ae62b 100644
--- a/modules/gui/macosx/VLCTimeField.h
+++ b/modules/gui/macosx/VLCTimeField.h
@@ -33,7 +33,7 @@
 
 @interface VLCTimeField : NSTextField
 
-- (void)setRemainingIdentifier:(NSString *)o_string;
+- (void)setRemainingIdentifier:(NSString *)identifier;
 - (void)setTime:(NSString *)time withRemainingTime:(NSString *)remainingTime;
 
 @end
diff --git a/modules/gui/macosx/VLCTimeField.m b/modules/gui/macosx/VLCTimeField.m
index 14dbad548d..ed482d7ab0 100644
--- a/modules/gui/macosx/VLCTimeField.m
+++ b/modules/gui/macosx/VLCTimeField.m
@@ -30,8 +30,8 @@
 
 @interface VLCTimeField ()
 {
-    NSString *o_remaining_identifier;
-    BOOL b_time_remaining;
+    NSString *_identifier;
+    BOOL _isTimeRemaining;
 
     NSString *_cachedTime;
     NSString *_remainingTime;
@@ -51,10 +51,10 @@
 }
 
 
-- (void)setRemainingIdentifier:(NSString *)o_string
+- (void)setRemainingIdentifier:(NSString *)identifier
 {
-    o_remaining_identifier = o_string;
-    b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
+    _identifier = identifier;
+    _isTimeRemaining = [[NSUserDefaults standardUserDefaults] boolForKey:_identifier];
 }
 
 - (void)mouseDown: (NSEvent *)ourEvent
@@ -63,12 +63,12 @@
         [[[VLCMain sharedInstance] mainMenu] goToSpecificTime: nil];
     else
     {
-        if (o_remaining_identifier) {
-            b_time_remaining = [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
-            b_time_remaining = !b_time_remaining;
-            [[NSUserDefaults standardUserDefaults] setObject:(b_time_remaining ? @"YES" : @"NO") forKey:o_remaining_identifier];
+        if (_identifier) {
+            _isTimeRemaining = [[NSUserDefaults standardUserDefaults] boolForKey:_identifier];
+            _isTimeRemaining = !_isTimeRemaining;
+            [[NSUserDefaults standardUserDefaults] setObject:(_isTimeRemaining ? @"YES" : @"NO") forKey:_identifier];
         } else {
-            b_time_remaining = !b_time_remaining;
+            _isTimeRemaining = !_isTimeRemaining;
         }
 
         [self updateTimeValue];
@@ -107,10 +107,10 @@
 
 - (BOOL)timeRemaining
 {
-    if (o_remaining_identifier)
-        return [[NSUserDefaults standardUserDefaults] boolForKey:o_remaining_identifier];
+    if (_identifier)
+        return [[NSUserDefaults standardUserDefaults] boolForKey:_identifier];
     else
-        return b_time_remaining;
+        return _isTimeRemaining;
 }
 
 @end



More information about the vlc-commits mailing list