Revision: 12589
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12589&view=rev
Author:   hofman
Date:     2008-01-19 16:07:24 -0800 (Sat, 19 Jan 2008)

Log Message:
-----------
Strip extra search criteria from spotlight search pre-filled into search field.

Modified Paths:
--------------
    trunk/bibdesk/BibDocument.m

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2008-01-19 21:02:59 UTC (rev 12588)
+++ trunk/bibdesk/BibDocument.m 2008-01-20 00:07:24 UTC (rev 12589)
@@ -349,6 +349,13 @@
         
         OBPOSTCONDITION(fileURL != nil);
         if(fileURL == nil || [[[NSWorkspace sharedWorkspace] 
UTIForURL:fileURL] isEqualToUTI:@"net.sourceforge.bibdesk.bdskcache"] == NO){
+            // strip extra search criteria
+            NSRange range = [searchString rangeOfString:@":"];
+            if (range.location != NSNotFound) {
+                range = [searchString rangeOfCharacterFromSet:[NSCharacterSet 
whitespaceCharacterSet] options:NSBackwardsSearch range:NSMakeRange(0, 
range.location)];
+                if (range.location != NSNotFound && range.location > 0)
+                    searchString = [searchString 
substringWithRange:NSMakeRange(0, range.location)];
+            }
             [self selectLibraryGroup:nil];
             [self setSearchString:searchString];
         }


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to