Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to Add Clipboard and Check for Nil #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions SparrowToOmnifocus.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
32C84BB013DB16580079A822 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0410;
ORGANIZATIONNAME = "Too Much Tea, LLC";
};
buildConfigurationList = 32C84BB313DB16580079A822 /* Build configuration list for PBXProject "SparrowToOmnifocus" */;
Expand Down Expand Up @@ -210,7 +211,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -226,7 +227,7 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.4;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
Expand All @@ -236,7 +237,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand All @@ -246,7 +247,7 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
MACOSX_DEPLOYMENT_TARGET = 10.4;
SDKROOT = macosx;
};
name = Release;
Expand All @@ -257,6 +258,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SparrowToOmnifocus/SparrowToOmnifocus-Prefix.pch";
INFOPLIST_FILE = "SparrowToOmnifocus/SparrowToOmnifocus-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.4;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -268,6 +270,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SparrowToOmnifocus/SparrowToOmnifocus-Prefix.pch";
INFOPLIST_FILE = "SparrowToOmnifocus/SparrowToOmnifocus-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.4;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -292,6 +295,7 @@
32C84BD913DB16590079A822 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
14 changes: 11 additions & 3 deletions SparrowToOmnifocus/DropView.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender {
}

- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];
NSString* str = [pasteboard stringForType:NSPasteboardTypeString];
if (str == nil) str = @"";

for (NSPasteboardItem* item in [[sender draggingPasteboard] pasteboardItems]) {
[self createOmnifocusTaskWithName:[item stringForType:@"public.url-name"]
andNote:[item stringForType:@"public.url"]];
if ([item stringForType:@"public.url-name"]) {

NSString *note = [NSString stringWithFormat:@"%@\n\n%@", [item stringForType:@"public.url"], str];
[self createOmnifocusTaskWithName:[item stringForType:@"public.url-name"]
andNote:note];
}
}

return YES;
}

Expand Down