discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Mac compatility problem: recent items menu


From: Wolfgang Lux
Subject: Re: Mac compatility problem: recent items menu
Date: Mon, 8 Dec 2014 09:59:07 +0100

Am 07.12.2014 um 15:07 schrieb Riccardo Mottola <riccardo.mottola@libero.it>:
> 
> Hallo Wolfang,
> 
> Wolfgang Lux wrote:
>> Well, in that case the problem perhaps simply could be in the Info.plist 
>> file. I see that you are using the traditional CFBundleTypeExtensions and 
>> CFBundleTypeOSTypes keys to declare your document types. However, Apple has 
>> switched to using Universal Type Identifiers (UTIs) quite a while ago. 
>> AFAIR, if the NSDocument framework does not find UTIs in the Info.plist file 
>> but only the old keys, it calls some of the deprecated document controller 
>> methods itself and that may or may not work (I can't really tell because I 
>> added UTIs to all my document based applications long ago). I think you 
>> should try adding UTIs for document your types to PRICE.
> thanks for the hints.
> I added UTIs (for PRICE it is easy, they are all public), it did not help, 
> but I commitd the change anyway, it can't hurt. For Graphos I'll need to 
> define my own, that later, when we understand what's going on. Just adding 
> one makes the app not recognize its own docs anymore.
> 
> I put two breakpoints, in noteNewRecentDocumentURL: and noteNewRecentDocument:
> 
> I get first into the latter, then into the first, with this trace:
> (gdb) bt
> #0  0x920b4fd1 in -[NSDocumentController noteNewRecentDocumentURL:] ()
> #1  0x91f9c4b3 in -[NSDocumentController 
> _finishOpeningDocument:andShowWindows:] ()
> #2  0x91f9b672 in -[NSDocumentController 
> openDocumentWithContentsOfURL:display:error:] ()
> #3  0x91f9a858 in -[NSDocumentController 
> _openDocumentsWithContentsOfURLs:display:presentErrors:] ()
> #4  0x920b5dcb in -[NSDocumentController openDocument:] ()
> #5  0x91d8ea26 in -[NSApplication sendAction:to:from:] ()
> #6  0x91d8e8d9 in -[NSMenuItem _corePerformAction] ()
> #7  0x91d8e5ca in -[NSCarbonMenuImpl 
> performActionWithHighlightingForItemAtIndex:] ()
> #8  0x91d8e4b6 in -[NSMenu performActionForItemAtIndex:] ()
> #9  0x91d8e469 in -[NSMenu _internalPerformActionForItemAtIndex:] ()
> #10 0x91d8e3cf in -[NSMenuItem _internalPerformActionThroughMenuIfPossible] ()
> #11 0x91d8e313 in -[NSCarbonMenuImpl 
> _carbonCommandProcessEvent:handlerCallRef:] ()
> #12 0x91d82a55 in NSSLMMenuEventHandler ()
> 
> There is no single line of code of PRICE in this trace! Is there a way to 
> print out the URL? The document? 

You can use the po command in gdb to print the arguments. However, the exact 
way to do that would depend on the architecture. The following commands should 
work to show the first method argument:
  PowerPC: po (id)$r5
  x86:     po ((id*)%ebx)[5]
  x86_64:  po (id)%rdx
However, you could also create your own document controller class and override 
the noteNewRecentDocument: and noteNewDocumentURL: methods. If you do that make 
sure you add an instance of your document controller class to the nib files so 
that it gets used instead of the Cocoa one.

Wolfgang




reply via email to

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