Target 10.7, Apple doesn't support 10.6; Enable App Sandbox; Fix warnings

This commit is contained in:
David Personette 2014-03-15 07:18:36 -04:00
parent 0b79c1fafd
commit 3dcda827a1
6 changed files with 54 additions and 31 deletions

View file

@ -424,7 +424,7 @@
break;
default: // It's not a navigation/application-defined thing, so let's figure out what to do with it.
NSLog(@"PRESSED %d", pressed);
NSLog(@"CODE %d", [mainRecorder keyCombo].code);
NSLog(@"CODE %ld", (long)[mainRecorder keyCombo].code);
break;
}
}
@ -723,7 +723,7 @@
[self toggleMainHotKey: aRecorder];
[self setHotKeyPreferenceForRecorder: aRecorder];
}
NSLog(@"code: %d, flags: %u", newKeyCombo.code, newKeyCombo.flags);
NSLog(@"code: %ld, flags: %lu", (long)newKeyCombo.code, (unsigned long)newKeyCombo.flags);
}
- (IBAction)toggleDropboxSync:(NSButtonCell*)sender {

8
Flycut.entitlements Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>

View file

@ -103,6 +103,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0474801818D46BDB00AA9857 /* Flycut.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Flycut.entitlements; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@ -235,6 +236,7 @@
29B97314FDCFA39411CA2CEA /* Jumpcut */ = {
isa = PBXGroup;
children = (
0474801818D46BDB00AA9857 /* Flycut.entitlements */,
7794D3D4139BF28B0047E862 /* flycut.icns */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
@ -440,6 +442,15 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
TargetAttributes = {
8D1107260486CEB800E47090 = {
SystemCapabilities = {
com.apple.Sandbox = {
enabled = 1;
};
};
};
};
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Flycut" */;
compatibilityVersion = "Xcode 3.2";
@ -531,6 +542,8 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = Flycut.entitlements;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -542,7 +555,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.6;
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = Flycut;
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
@ -552,6 +565,8 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = Flycut.entitlements;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(FRAMEWORK_SEARCH_PATHS)",
@ -561,7 +576,7 @@
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = 10.6;
MACOSX_DEPLOYMENT_TARGET = 10.7;
PRODUCT_NAME = Flycut;
STRIP_INSTALLED_PRODUCT = YES;
WRAPPER_EXTENSION = app;

View file

@ -17,7 +17,7 @@
OSStatus err = LIAECopyLoginItems( (CFArrayRef*) &itemsList ); // Take advantage of toll-free bridging.
if( err != noErr )
{
NSLog(@"Couldn't list login items error %ld", err);
NSLog(@"Couldn't list login items error %d", (int)err);
return nil;
}
@ -29,7 +29,7 @@
OSStatus err = LIAEAddURLAtEnd( (CFURLRef) url, hide ); // CFURLRef is toll-free bridged to NSURL.
if( err != noErr )
NSLog(@"Couldn't add login item error %ld", err);
NSLog(@"Couldn't add login item error %d", (int)err);
return( err == noErr );
}
@ -40,7 +40,7 @@
OSStatus err = LIAERemove( idx );
if( err != noErr )
NSLog(@"Couldn't remove login intem error %ld", err);
NSLog(@"Couldn't remove login intem error %d", (int)err);
return( err == noErr );
}

View file

@ -50,10 +50,10 @@ NSString * SRStringForKeyCode( NSInteger keyCode )
NSString * SRStringForCarbonModifierFlags( NSUInteger flags )
{
NSString *modifierFlagsString = [NSString stringWithFormat:@"%@%@%@%@",
( flags & controlKey ? [NSString stringWithFormat:@"%C", KeyboardControlGlyph] : @"" ),
( flags & optionKey ? [NSString stringWithFormat:@"%C", KeyboardOptionGlyph] : @"" ),
( flags & shiftKey ? [NSString stringWithFormat:@"%C", KeyboardShiftGlyph] : @"" ),
( flags & cmdKey ? [NSString stringWithFormat:@"%C", KeyboardCommandGlyph] : @"" )];
( flags & controlKey ? [NSString stringWithFormat:@"%C", (unichar)KeyboardControlGlyph] : @"" ),
( flags & optionKey ? [NSString stringWithFormat:@"%C", (unichar)KeyboardOptionGlyph] : @"" ),
( flags & shiftKey ? [NSString stringWithFormat:@"%C", (unichar)KeyboardShiftGlyph] : @"" ),
( flags & cmdKey ? [NSString stringWithFormat:@"%C", (unichar)KeyboardCommandGlyph] : @"" )];
return modifierFlagsString;
}
@ -73,10 +73,10 @@ NSString * SRStringForCarbonModifierFlagsAndKeyCode( NSUInteger flags, NSInteger
NSString * SRStringForCocoaModifierFlags( NSUInteger flags )
{
NSString *modifierFlagsString = [NSString stringWithFormat:@"%@%@%@%@",
( flags & NSControlKeyMask ? [NSString stringWithFormat:@"%C", KeyboardControlGlyph] : @"" ),
( flags & NSAlternateKeyMask ? [NSString stringWithFormat:@"%C", KeyboardOptionGlyph] : @"" ),
( flags & NSShiftKeyMask ? [NSString stringWithFormat:@"%C", KeyboardShiftGlyph] : @"" ),
( flags & NSCommandKeyMask ? [NSString stringWithFormat:@"%C", KeyboardCommandGlyph] : @"" )];
( flags & NSControlKeyMask ? [NSString stringWithFormat:@"%C", (unichar)KeyboardControlGlyph] : @"" ),
( flags & NSAlternateKeyMask ? [NSString stringWithFormat:@"%C", (unichar)KeyboardOptionGlyph] : @"" ),
( flags & NSShiftKeyMask ? [NSString stringWithFormat:@"%C", (unichar)KeyboardShiftGlyph] : @"" ),
( flags & NSCommandKeyMask ? [NSString stringWithFormat:@"%C", (unichar)KeyboardCommandGlyph] : @"" )];
return modifierFlagsString;
}

View file

@ -58,22 +58,22 @@ static NSArray *padKeysArray = nil;
@"F18", SRInt(79),
@"F19", SRInt(80),
SRLoc(@"Space"), SRInt(49),
SRChar(KeyboardDeleteLeftGlyph), SRInt(51),
SRChar(KeyboardDeleteRightGlyph), SRInt(117),
SRChar(KeyboardPadClearGlyph), SRInt(71),
SRChar(KeyboardLeftArrowGlyph), SRInt(123),
SRChar(KeyboardRightArrowGlyph), SRInt(124),
SRChar(KeyboardUpArrowGlyph), SRInt(126),
SRChar(KeyboardDownArrowGlyph), SRInt(125),
SRChar(KeyboardSoutheastArrowGlyph), SRInt(119),
SRChar(KeyboardNorthwestArrowGlyph), SRInt(115),
SRChar(KeyboardEscapeGlyph), SRInt(53),
SRChar(KeyboardPageDownGlyph), SRInt(121),
SRChar(KeyboardPageUpGlyph), SRInt(116),
SRChar(KeyboardReturnR2LGlyph), SRInt(36),
SRChar(KeyboardReturnGlyph), SRInt(76),
SRChar(KeyboardTabRightGlyph), SRInt(48),
SRChar(KeyboardHelpGlyph), SRInt(114),
SRChar((unichar)KeyboardDeleteLeftGlyph), SRInt(51),
SRChar((unichar)KeyboardDeleteRightGlyph), SRInt(117),
SRChar((unichar)KeyboardPadClearGlyph), SRInt(71),
SRChar((unichar)KeyboardLeftArrowGlyph), SRInt(123),
SRChar((unichar)KeyboardRightArrowGlyph), SRInt(124),
SRChar((unichar)KeyboardUpArrowGlyph), SRInt(126),
SRChar((unichar)KeyboardDownArrowGlyph), SRInt(125),
SRChar((unichar)KeyboardSoutheastArrowGlyph), SRInt(119),
SRChar((unichar)KeyboardNorthwestArrowGlyph), SRInt(115),
SRChar((unichar)KeyboardEscapeGlyph), SRInt(53),
SRChar((unichar)KeyboardPageDownGlyph), SRInt(121),
SRChar((unichar)KeyboardPageUpGlyph), SRInt(116),
SRChar((unichar)KeyboardReturnR2LGlyph), SRInt(36),
SRChar((unichar)KeyboardReturnGlyph), SRInt(76),
SRChar((unichar)KeyboardTabRightGlyph), SRInt(48),
SRChar((unichar)KeyboardHelpGlyph), SRInt(114),
nil];
// We want to identify if the key was pressed on the numpad