Commit 92c101e9 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk

app: prevent app store version from auto-starting app by default

Change-Id: I2a1a52ec7ff2f5c76b34438c250b8e9d019f846a
parent eab49b63
......@@ -38,6 +38,7 @@
#import "Constants.h"
#import "views/NSImage+Extensions.h"
#import "utils.h"
@interface RingWizardLinkAccountVC ()
......@@ -165,12 +166,14 @@
*/
- (void)registerDefaultPreferences
{
// enable AutoStartup
LSSharedFileListRef loginItemsRef = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
if (loginItemsRef == nil) return;
CFURLRef appUrl = (__bridge CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
LSSharedFileListItemRef itemRef = LSSharedFileListInsertItemURL(loginItemsRef, kLSSharedFileListItemLast, NULL, NULL, appUrl, NULL, NULL);
if (itemRef) CFRelease(itemRef);
if (!appSandboxed()) {
// enable AutoStartup
LSSharedFileListRef loginItemsRef = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
if (loginItemsRef == nil) return;
CFURLRef appUrl = (__bridge CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
LSSharedFileListItemRef itemRef = LSSharedFileListInsertItemURL(loginItemsRef, kLSSharedFileListItemLast, NULL, NULL, appUrl, NULL, NULL);
if (itemRef) CFRelease(itemRef);
}
// enable Notifications
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:Preferences::Notifications];
......
......@@ -42,6 +42,7 @@
#import "Constants.h"
#import "views/NSImage+Extensions.h"
#import "views/NSColor+RingTheme.h"
#import "utils.h"
@interface RingWizardNewAccountVC ()
@end
......@@ -254,12 +255,14 @@ NSInteger const ERROR_REPEAT_MISMATCH = -2;
*/
- (void)registerDefaultPreferences
{
// enable AutoStartup
LSSharedFileListRef loginItemsRef = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
if (loginItemsRef == nil) return;
CFURLRef appUrl = (__bridge CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
LSSharedFileListItemRef itemRef = LSSharedFileListInsertItemURL(loginItemsRef, kLSSharedFileListItemLast, NULL, NULL, appUrl, NULL, NULL);
if (itemRef) CFRelease(itemRef);
if (!appSandboxed()) {
// enable AutoStartup
LSSharedFileListRef loginItemsRef = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
if (loginItemsRef == nil) return;
CFURLRef appUrl = (__bridge CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
LSSharedFileListItemRef itemRef = LSSharedFileListInsertItemURL(loginItemsRef, kLSSharedFileListItemLast, NULL, NULL, appUrl, NULL, NULL);
if (itemRef) CFRelease(itemRef);
}
// enable Notifications
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:Preferences::Notifications];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment