This does not make sense to me. It seems to return a UTI type, not  
one of our document types.

Christiaan

On 8 Aug 2007, at 6:36 AM, [EMAIL PROTECTED] wrote:

> Revision: 10896
>           http://bibdesk.svn.sourceforge.net/bibdesk/? 
> rev=10896&view=rev
> Author:   amaxwell
> Date:     2007-08-07 21:36:45 -0700 (Tue, 07 Aug 2007)
>
> Log Message:
> -----------
> Another attempt at fixing this problem, since my previous one
> was reverted.  This is due to the inconsistent type declaration
> in the Info.plist.
>
> Modified Paths:
> --------------
>     trunk/bibdesk/BDSKDocumentController.m
>     trunk/bibdesk/BibDocument.m
>
> Modified: trunk/bibdesk/BDSKDocumentController.m
> ===================================================================
> --- trunk/bibdesk/BDSKDocumentController.m    2007-08-08 00:04:37 UTC  
> (rev 10895)
> +++ trunk/bibdesk/BDSKDocumentController.m    2007-08-08 04:36:45 UTC  
> (rev 10896)
> @@ -436,13 +436,32 @@
>
>  - (NSString *)typeFromFileExtension:(NSString *) 
> fileExtensionOrHFSFileType
>  {
> -     NSString *type = [super  
> typeFromFileExtension:fileExtensionOrHFSFileType];
> -    if(type == nil){
> -        type = [[BDSKTemplate  
> defaultStyleNameForFileType:fileExtensionOrHFSFileType]  
> valueForKey:BDSKTemplateNameString];
> -    }else if ([type isEqualToString:BDSKMinimalBibTeXDocumentType]){
> -        // fix of bug when reading a .bib file
> -        // this is interpreted as Minimal BibTeX, even though we  
> don't declare that as a readable type
> -        type = BDSKBibTeXDocumentType;
> +    NSString *type = nil;
> +
> +    long majorVersion;
> +    long minorVersion;
> +    OSStatus err;
> +    err = Gestalt(gestaltSystemVersionMajor, &majorVersion);
> +    if (noErr == err)
> +        Gestalt(gestaltSystemVersionMinor, &minorVersion);
> +
> +    if ((noErr != err || (10 == majorVersion && 4 >=  
> minorVersion))) {
> +        type = [super  
> typeFromFileExtension:fileExtensionOrHFSFileType];
> +        if(type == nil){
> +            type = [[BDSKTemplate  
> defaultStyleNameForFileType:fileExtensionOrHFSFileType]  
> valueForKey:BDSKTemplateNameString];
> +        }else if ([type  
> isEqualToString:BDSKMinimalBibTeXDocumentType]){
> +            // fix of bug when reading a .bib file
> +            // this is interpreted as Minimal BibTeX, even though  
> we don't declare that as a readable type
> +            type = BDSKBibTeXDocumentType;
> +        }
> +    } else {
> +        type = [[NSWorkspace sharedWorkspace]  
> UTIForPathExtension:fileExtensionOrHFSFileType];
> +        if (nil == type)
> +            type = [(id)UTTypeCreatePreferredIdentifierForTag 
> (kUTTagClassOSType, (CFStringRef)fileExtensionOrHFSFileType, NULL)  
> autorelease];
> +        if (nil == type)
> +            type = [super  
> typeFromFileExtension:fileExtensionOrHFSFileType];
> +        if (nil == type)
> +            type = [[BDSKTemplate  
> defaultStyleNameForFileType:fileExtensionOrHFSFileType]  
> valueForKey:BDSKTemplateNameString];
>      }
>       return type;
>  }
>
> Modified: trunk/bibdesk/BibDocument.m
> ===================================================================
> --- trunk/bibdesk/BibDocument.m       2007-08-08 00:04:37 UTC (rev 10895)
> +++ trunk/bibdesk/BibDocument.m       2007-08-08 04:36:45 UTC (rev 10896)
> @@ -1490,9 +1490,8 @@
>      if(outError) *outError = error;
>      [self setPublicationsWithoutUndo:newPubs];
>
> -    if (type == BDSKRISStringType) // since we can't save pubmed  
> files as pubmed files:
> -        [self updateChangeCount:NSChangeDone];
> -    else // since we can't save other files in its native format
> +    // since we can't save other files in their native format  
> (BibTeX is handled separately)
> +    if (type != BDSKRISStringType)
>          [self setFileName:nil];
>
>      return newPubs != nil;
>
>
> This was sent by the SourceForge.net collaborative development  
> platform, the world's largest Open Source development site.
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a  
> browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Bibdesk-commit mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to