discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error in -NSURL writeToPasteboard:


From: Andreas Schik
Subject: Error in -NSURL writeToPasteboard:
Date: Tue, 24 Apr 2012 09:37:32 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20

Hi,
I was trying to install a default OpenURL service on my system and came
across the following: while my service was being called it could not
read the URL from the pasteboard. The pasteboard passed to my service
reported an empty list of types, while there should of course be data of
type NSURLPboardType.
Digging around I found the above mentioned method declared in
NSPasteboard.m. This is called from somewhere in NSWorkspace to pass the
URL to the service. While the URL as such gets written to the
pasteboard, the method IMHO forgets to declare the proper type. Changing
the method as follows remedied my problem:

- (void) writeToPasteboard: (NSPasteboard *)pasteBoard
{
  [pasteBoard  declareTypes: [NSArray arrayWithObjects:
                        NSURLPboardType,nil]
                owner: nil];
  [pasteBoard setString: [self absoluteString]
                forType: NSURLPboardType];
}


-- 
Grüße / Cheers

Andreas Schik

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]