Merge pull request #1958 from DDRBoxman/format

Apply clang-format to objective c code
This commit is contained in:
Colin Edwards
2019-07-12 21:43:55 -05:00
committed by GitHub
13 changed files with 1102 additions and 1132 deletions

View File

@@ -58,7 +58,7 @@ bool InitApplicationBundle()
throw "Could not change working directory to "
"bundle path";
} catch (const char* error) {
} catch (const char *error) {
blog(LOG_ERROR, "InitBundle: %s", error);
return false;
}
@@ -77,7 +77,7 @@ string GetDefaultVideoSavePath()
appropriateForURL:nil
create:true
error:nil];
if (!url)
return getenv("HOME");
@@ -97,7 +97,7 @@ vector<string> GetPreferredLocales()
return locale.first;
if (!lang_match.size() &&
locale.first.substr(0, 2) == lang.substr(0, 2))
locale.first.substr(0, 2) == lang.substr(0, 2))
lang_match = locale.first;
}
@@ -150,12 +150,13 @@ void EnableOSXVSync(bool enable)
if (!initialized) {
void *quartzCore = dlopen("/System/Library/Frameworks/"
"QuartzCore.framework/QuartzCore", RTLD_LAZY);
"QuartzCore.framework/QuartzCore",
RTLD_LAZY);
if (quartzCore) {
set_debug_options = (set_int_t)dlsym(quartzCore,
"CGSSetDebugOptions");
deferred_updates = (set_int_t)dlsym(quartzCore,
"CGSDeferredUpdates");
set_debug_options = (set_int_t)dlsym(
quartzCore, "CGSSetDebugOptions");
deferred_updates = (set_int_t)dlsym(
quartzCore, "CGSDeferredUpdates");
valid = set_debug_options && deferred_updates;
}
@@ -174,5 +175,6 @@ void EnableOSXDockIcon(bool enable)
if (enable)
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
else
[NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited];
[NSApp setActivationPolicy:
NSApplicationActivationPolicyProhibited];
}

View File

@@ -6,15 +6,13 @@ static inline bool equali(NSString *a, NSString *b)
return a && b && [a caseInsensitiveCompare:b] == NSOrderedSame;
}
@interface OBSSparkleUpdateDelegate :
NSObject<SUUpdaterDelegate, SUVersionComparison>
{
@interface OBSSparkleUpdateDelegate
: NSObject <SUUpdaterDelegate, SUVersionComparison> {
}
@property (nonatomic) bool updateToUndeployed;
@end
@implementation OBSSparkleUpdateDelegate
{
@implementation OBSSparkleUpdateDelegate {
}
@synthesize updateToUndeployed;
@@ -50,11 +48,11 @@ static inline bool equali(NSString *a, NSString *b)
item = mpkg;
NSMutableDictionary *dict = [NSMutableDictionary
dictionaryWithDictionary:item.propertiesDictionary];
dictionaryWithDictionary:item.propertiesDictionary];
NSString *build = [host objectForInfoDictionaryKey:@"CFBundleVersion"];
NSString *url = dict[@"sparkle:releaseNotesLink"];
dict[@"sparkle:releaseNotesLink"] = [url stringByAppendingFormat:@"#%@",
build];
dict[@"sparkle:releaseNotesLink"] =
[url stringByAppendingFormat:@"#%@", build];
return [[SUAppcastItem alloc] initWithDictionary:dict];
}
@@ -62,9 +60,9 @@ static inline bool equali(NSString *a, NSString *b)
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast
forUpdater:(SUUpdater *)updater
{
SUAppcastItem *selected =
[self bestValidUpdateWithDeltasInAppcast:appcast
forUpdater:updater];
SUAppcastItem *selected = [self
bestValidUpdateWithDeltasInAppcast:appcast
forUpdater:updater];
NSBundle *host = updater.hostBundle;
NSString *build = [host objectForInfoDictionaryKey:@"CFBundleVersion"];
@@ -91,8 +89,8 @@ static inline bool equali(NSString *a, NSString *b)
return NSOrderedSame;
}
- (id <SUVersionComparison>)
versionComparatorForUpdater:(SUUpdater *)__unused updater
- (id<SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)__unused
updater
{
return self;
}
@@ -141,4 +139,3 @@ void trigger_sparkle_update()
{
[updater checkForUpdates:nil];
}