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

include public.file-url data for pasteboard objects #1822

merged 2 commits into from Apr 17, 2014

include public.file-url data for pasteboard objects #1822

merged 2 commits into from Apr 17, 2014


Copy link

@skurfer skurfer commented Apr 15, 2014

Here’s an attempt at fixing #1805. I tried to do it with as few changes as possible. Note that no changes to the plug-in were required.

Probably not perfect, but this code should all go away soon, right?

@@ -53,6 +53,8 @@ - (void)writeToPasteboard:(NSPasteboard *)pasteboard data:(id)pbData forType:(NS
[pasteboard addTypes:[NSArray arrayWithObjects:NSURLPboardType, NSStringPboardType, nil] owner:nil];
[pasteboard setString:([pbData hasPrefix:@"mailto:"]) ?[pbData substringFromIndex:7] :pbData forType:NSStringPboardType];
[pasteboard setString:[pbData URLDecoding] forType:NSURLPboardType];
} else if ([type isEqualToString:@"public.file-url"]) {
[pasteboard setString:pbData[0] forType:type];
Copy link

@pjrobertson pjrobertson Apr 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth checking [pbData isKindOfClass:[NSArray class]] just incase something goes askew? Don't really see how.

Copy link

@pjrobertson pjrobertson commented Apr 17, 2014

Yep you're right, this is kinda hacky, but all of this pasteboard stuff is already hacky.
My nice new pasteboard branch is reaching maturity I think... :)

Other than my comment, go ahead and merge.
In reply to your v1.2/2.0 arguments - yes, OK. Let's get 1.2.0 damn well out the way.
...maybe the chance to make lots of changes will increase momentum? :D

before assuming we can get the first element
Copy link
Member Author

@skurfer skurfer commented Apr 17, 2014

Added the array check.

skurfer added a commit that referenced this issue Apr 17, 2014
include public.file-url data for pasteboard objects
@skurfer skurfer merged commit 4313a1f into master Apr 17, 2014
1 check passed
@skurfer skurfer deleted the i1805 branch Apr 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants