[Bibdesk-commit] www.mp3-now.com.ar

2008-01-02 Thread Pls check this new site
Please see this site in Subject

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12191] trunk/bibdesk

2008-01-02 Thread hofman
Revision: 12191
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12191view=rev
Author:   hofman
Date: 2008-01-02 04:01:32 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Resolve FSRefs for linked files without resolving final symlinks and links. We 
can't use BDAlias, so we wrap our own AliasHandle related functions. Every step 
should still be tested. Use path based conversion to FSRef.

Modified Paths:
--
trunk/bibdesk/BDSKLinkedFile.h
trunk/bibdesk/BDSKLinkedFile.m
trunk/bibdesk/BibItem.m

Modified: trunk/bibdesk/BDSKLinkedFile.h
===
--- trunk/bibdesk/BDSKLinkedFile.h  2008-01-02 07:00:56 UTC (rev 12190)
+++ trunk/bibdesk/BDSKLinkedFile.h  2008-01-02 12:01:32 UTC (rev 12191)
@@ -52,6 +52,7 @@
 
 - (NSURL *)URL;
 - (NSURL *)displayURL;
+- (NSString *)path;
 
 // string value to be saved as a field value, base64 encoded data for a local 
file or an absolute URL string for a remote URL
 - (NSString *)stringRelativeToPath:(NSString *)newBasePath;
@@ -70,5 +71,5 @@
 
 
 @interface NSObject (BDSKLinkedFileDelegate)
-- (NSURL *)baseURLForLinkedFile:(BDSKLinkedFile *)file;
+- (NSString *)basePathForLinkedFile:(BDSKLinkedFile *)file;
 @end

Modified: trunk/bibdesk/BDSKLinkedFile.m
===
--- trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 07:00:56 UTC (rev 12190)
+++ trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 12:01:32 UTC (rev 12191)
@@ -40,11 +40,115 @@
 #import BDAlias.h
 #import OmniFoundation/NSData-OFExtensions.h
 
+static AliasHandle BDSKDataToAliasHandle(CFDataRef inData)
+{
+CFIndex len;
+Handle handle = NULL;
+
+if (inData != NULL) {
+len = CFDataGetLength(inData);
+handle = NewHandle(len);
+
+if ((handle != NULL)  (len  0)) {
+HLock(handle);
+BlockMoveData(CFDataGetBytePtr(inData), *handle, len);
+HUnlock(handle);
+}
+}
+return (AliasHandle)handle;
+}
+
+static CFDataRef BDSKAliasHandleToData(AliasHandle inAlias)
+{
+Handle inHandle = (Handle)inAlias;
+CFDataRef data = NULL;
+CFIndex len;
+SInt8 handleState;
+
+if (inHandle != NULL) {
+len = GetHandleSize(inHandle);
+handleState = HGetState(inHandle);
+
+HLock(inHandle);
+
+data = CFDataCreate(kCFAllocatorDefault, (const UInt8 *) *inHandle, 
len);
+
+HSetState(inHandle, handleState);
+}
+return data;
+}
+
+static OSStatus BDSKPathToFSRef(CFStringRef inPath, FSRef *outRef)
+{
+OSStatus err = noErr;
+
+if (inPath == NULL)
+err = fnfErr;
+else
+err = FSPathMakeRefWithOptions((UInt8 *)[(NSString *)inPath 
fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, outRef, NULL); 
+
+return err;
+}
+
+static CFStringRef BDSKFSRefToPathCopy(const FSRef *inRef)
+{
+CFURLRef tmpURL = NULL;
+CFStringRefresult = NULL;
+
+if (inRef != NULL) {
+tmpURL = CFURLCreateFromFSRef(kCFAllocatorDefault, inRef);
+
+if (tmpURL != NULL) {
+result = CFURLCopyFileSystemPath(tmpURL, kCFURLPOSIXPathStyle);
+CFRelease(tmpURL);
+}
+}
+
+return result;
+}
+
+static AliasHandle BDSKFSRefToAliasHandle(const FSRef *inRef, const FSRef 
*inBaseRef)
+{
+OSStatus err = noErr;
+AliasHandlealias = NULL;
+
+err = FSNewAlias(inBaseRef, inRef, alias);
+
+if (err != noErr  alias != NULL) {
+DisposeHandle((Handle)alias);
+alias = NULL;
+}
+
+return alias;
+}
+
+static AliasHandle BDSKPathToAliasHandle(CFStringRef inPath, CFStringRef 
inBasePath)
+{
+OSStatus err = noErr;
+FSRef ref, baseRef;
+AliasHandle alias = NULL;
+
+err = BDSKPathToFSRef(inPath, ref);
+
+if (err == noErr) {
+if (inBasePath != NULL) {
+err = BDSKPathToFSRef(inBasePath, baseRef);
+
+if (err != noErr)
+alias = BDSKFSRefToAliasHandle(ref, baseRef);
+} else {
+alias = BDSKFSRefToAliasHandle(ref, NULL);
+}
+}
+
+return alias;
+}
+
 // Private concrete subclasses
 
 @interface BDSKLinkedAliasFile : BDSKLinkedFile
 {
-BDAlias *alias;
+AliasHandle alias;
 const FSRef *fileRef;
 NSString *relativePath;
 id delegate;
@@ -53,9 +157,9 @@
 - (id)initWithPath:(NSString *)aPath delegate:(id)aDelegate;
 
 - (void)setRelativePath:(NSString *)newRelativePath;
+- (void)updateRelativePathWithBasePath:(NSString *)basePath;
 
 - (const FSRef *)fileRef;
-- (NSString *)path;
 
 - (NSData *)aliasDataRelativeToPath:(NSString *)newBasePath;
 
@@ -154,6 +258,11 @@
 return [self URL];
 }
 
+- (NSString *)path;
+{
+return [[self URL] path];
+}
+
 - (NSString *)stringRelativeToPath:(NSString *)newBasePath;
 {
 

[Bibdesk-commit] SF.net SVN: bibdesk: [12192] trunk/bibdesk/BDSKLinkedFile.m

2008-01-02 Thread hofman
Revision: 12192
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12192view=rev
Author:   hofman
Date: 2008-01-02 04:19:27 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Replace header import.

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

Modified: trunk/bibdesk/BDSKLinkedFile.m
===
--- trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 12:01:32 UTC (rev 12191)
+++ trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 12:19:27 UTC (rev 12192)
@@ -37,7 +37,7 @@
  */
 
 #import BDSKLinkedFile.h
-#import BDAlias.h
+#import CoreServices/CoreServices.h
 #import OmniFoundation/NSData-OFExtensions.h
 
 static AliasHandle BDSKDataToAliasHandle(CFDataRef inData)


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] 商业合作

2008-01-02 Thread hongyun

   您好!
 
   深圳市群力税 务代理有限公司实力雄厚,与全国各地众多公司有业务往来,

  可以提供税 务机关代开发 票咨询。咨询范围:商品普通销售发 票、广告发 票、
  
  电脑版运输发 票、国际运输发 票、其它服务发 票、租赁发 票、建筑安装发 票等。
  
  郑重承诺:所有票 据可以上网或到税务局验证!


祝:

商祺!

 联系人:张生 13510428202 

 E-mail: [EMAIL PROTECTED]

深 圳 市 群 力 税 务 代 理 有 限 公 司

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] www.dyspepsy.com

2008-01-02 Thread Pls check this new site
Please see this site in Subject

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12193] trunk/bibdesk/BDSKLinkedFile.m

2008-01-02 Thread amaxwell
Revision: 12193
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12193view=rev
Author:   amaxwell
Date: 2008-01-02 09:13:16 -0800 (Wed, 02 Jan 2008)

Log Message:
---
add #warning to make sure this gets fixed; I'm not sure what's going on here

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

Modified: trunk/bibdesk/BDSKLinkedFile.m
===
--- trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 12:19:27 UTC (rev 12192)
+++ trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 17:13:16 UTC (rev 12193)
@@ -534,6 +534,7 @@
 BOOL hasBaseRef = (newBasePath  noErr == 
BDSKPathToFSRef((CFStringRef)newBasePath, baseRef));
 anAlias = BDSKFSRefToAliasHandle(fsRef, hasBaseRef ? baseRef : NULL);
 } else if (relativePath  newBasePath) {
+#warning uninitialized variable
 anAlias = BDSKPathToAliasHandle((CFStringRef)[basePath 
stringByAppendingPathComponent:relativePath], (CFStringRef)newBasePath);
 }
 if (anAlias != NULL) {


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12194] trunk/bibdesk/BDSKEditor.m

2008-01-02 Thread hofman
Revision: 12194
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12194view=rev
Author:   hofman
Date: 2008-01-02 09:15:11 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Fix type of argument.

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

Modified: trunk/bibdesk/BDSKEditor.m
===
--- trunk/bibdesk/BDSKEditor.m  2008-01-02 17:13:16 UTC (rev 12193)
+++ trunk/bibdesk/BDSKEditor.m  2008-01-02 17:15:11 UTC (rev 12194)
@@ -587,7 +587,7 @@
   contextInfo:(void *)anIndex];
 }
 
-- (void)chooseRemoteURLSheetDidEnd:(NSOpenPanel *)sheet 
returnCode:(int)returnCode contextInfo:(void *)contextInfo{
+- (void)chooseRemoteURLSheetDidEnd:(NSWindow *)sheet 
returnCode:(int)returnCode contextInfo:(void *)contextInfo{
 
 if (returnCode == NSOKButton) {
 NSString *aURLString = [chooseURLField stringValue];


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12195] trunk/bibdesk/BDSKLinkedFile.m

2008-01-02 Thread hofman
Revision: 12195
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12195view=rev
Author:   hofman
Date: 2008-01-02 09:31:23 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Remove warning and local variable. Rename confused argument. Search fileID 
first when resolving aliases, because this does not follow symlinks to their 
targets, unlike what searching path first does.

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

Modified: trunk/bibdesk/BDSKLinkedFile.m
===
--- trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 17:15:11 UTC (rev 12194)
+++ trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 17:31:23 UTC (rev 12195)
@@ -469,7 +469,8 @@
 }
 
 if (hasRef == false  alias != NULL) {
-hasRef = noErr == FSMatchAliasNoUI(hasBaseRef ? baseRef : NULL, 
kARMNoUI | kARMSearch | kARMSearchRelFirst, alias, aliasCount, aRef, 
shouldUpdate, NULL, NULL);
+// it would be preferable to search the (relative) path before the 
fileID, but than links to symlinks will always be resolved to the target
+hasRef = noErr == FSMatchAliasNoUI(hasBaseRef ? baseRef : NULL, 
kARMNoUI | kARMSearch | kARMSearchRelFirst | kARMTryFileIDFirst, alias, 
aliasCount, aRef, shouldUpdate, NULL, NULL);
 shouldUpdate = shouldUpdate  hasBaseRef  hasRef;
 }
 
@@ -519,23 +520,21 @@
 return [path autorelease];
 }
 
-- (NSData *)aliasDataRelativeToPath:(NSString *)newBasePath;
+- (NSData *)aliasDataRelativeToPath:(NSString *)basePath;
 {
 // make sure the fileRef is valid
 [self path];
 
 FSRef *fsRef = (FSRef *)[self fileRef];
 FSRef baseRef;
-NSString *basePath;
 AliasHandle anAlias = NULL;
 CFDataRef data = NULL;
 
 if (fsRef) {
-BOOL hasBaseRef = (newBasePath  noErr == 
BDSKPathToFSRef((CFStringRef)newBasePath, baseRef));
+BOOL hasBaseRef = (basePath  noErr == 
BDSKPathToFSRef((CFStringRef)basePath, baseRef));
 anAlias = BDSKFSRefToAliasHandle(fsRef, hasBaseRef ? baseRef : NULL);
-} else if (relativePath  newBasePath) {
-#warning uninitialized variable
-anAlias = BDSKPathToAliasHandle((CFStringRef)[basePath 
stringByAppendingPathComponent:relativePath], (CFStringRef)newBasePath);
+} else if (relativePath  basePath) {
+anAlias = BDSKPathToAliasHandle((CFStringRef)[basePath 
stringByAppendingPathComponent:relativePath], (CFStringRef)basePath);
 }
 if (anAlias != NULL) {
 data = BDSKAliasHandleToData(anAlias);


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12196] trunk/bibdesk/BDSKEditor.h

2008-01-02 Thread amaxwell
Revision: 12196
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12196view=rev
Author:   amaxwell
Date: 2008-01-02 09:37:02 -0800 (Wed, 02 Jan 2008)

Log Message:
---
fix type in header as well

Modified Paths:
--
trunk/bibdesk/BDSKEditor.h

Modified: trunk/bibdesk/BDSKEditor.h
===
--- trunk/bibdesk/BDSKEditor.h  2008-01-02 17:31:23 UTC (rev 12195)
+++ trunk/bibdesk/BDSKEditor.h  2008-01-02 17:37:02 UTC (rev 12196)
@@ -155,7 +155,7 @@
 
 - (IBAction)chooseRemoteURL:(id)sender;
 - (IBAction)dismissChooseURLSheet:(id)sender;
-- (void)chooseRemoteURLSheetDidEnd:(NSOpenPanel *)sheet 
returnCode:(int)returnCode contextInfo:(void *)contextInfo;
+- (void)chooseRemoteURLSheetDidEnd:(NSWindow *)sheet 
returnCode:(int)returnCode contextInfo:(void *)contextInfo;
 
 - (IBAction)toggleStatusBar:(id)sender;
 


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12197] trunk/bibdesk_vendorsrc/amaxwell/FileView/ FVWebViewIcon.m

2008-01-02 Thread amaxwell
Revision: 12197
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12197view=rev
Author:   amaxwell
Date: 2008-01-02 10:29:14 -0800 (Wed, 02 Jan 2008)

Log Message:
---
- size check in needsRenderForSize: was incorrect
- cancel pending loads in -releaseResources
- decrease full image size for caching (significantly reduces memory usage and 
compression overhead)

Modified Paths:
--
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
===
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2008-01-02 
17:37:02 UTC (rev 12196)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2008-01-02 
18:29:14 UTC (rev 12197)
@@ -86,9 +86,9 @@
 - (void)_releaseWebView
 {
 NSAssert2(pthread_main_np() != 0, @*** threading violation *** -[%@ 
[EMAIL PROTECTED] requires main thread, [self class], 
NSStringFromSelector(_cmd));
-[_webView stopLoading:nil];
 [_webView setPolicyDelegate:nil];
 [_webView setFrameLoadDelegate:nil];
+[_webView stopLoading:nil];
 [_webView release];
 _webView = nil;
 }
@@ -107,10 +107,22 @@
 [super dealloc];
 }
 
+- (void)_releaseWebViewAndRetryIfNeeded
+{
+if (nil != _webView) {
+_triedWebView = NO;
+[self _releaseWebView];
+}
+}
+
 - (void)releaseResources
 { 
 // the thumbnail is small enough to always keep around
 pthread_mutex_lock(_mutex);
+
+// Cancel any pending loads; set _triedWebView to NO if there was a 
non-nil webview (i.e. it was loading), or else -renderOffscreenOnMainThread 
will never complete if it gets called again.
+[self 
performSelectorOnMainThread:@selector(_releaseWebViewAndRetryIfNeeded) 
withObject:nil waitUntilDone:YES];
+
 CGImageRelease(_fullImageRef);
 _fullImageRef = NULL;
 
@@ -119,8 +131,15 @@
 pthread_mutex_unlock(_mutex);
 }
 
-- (NSSize)size { return (NSSize){ 1000, 900 }; }
+// size of the _fullImageRef
+- (NSSize)size { return (NSSize){ 500, 450 }; }
 
+// actual size of the webview; large enough to fit a reasonably sized page
+- (NSSize)_webviewSize { return (NSSize){ 1000, 900 }; }
+
+// size of the _thumbnailRef (1/5 of webview size)
+- (NSSize)_thumbnailSize { return (NSSize){ 200, 180 }; }
+
 - (BOOL)needsRenderForSize:(NSSize)size
 {
 BOOL needsRender = NO;
@@ -134,7 +153,7 @@
 
 if (YES == _webviewFailed)
 needsRender = (nil == _fallbackIcon || [_fallbackIcon 
needsRenderForSize:size]);
-else if (size.height  1.2 * [self size].height)
+else if (size.height  1.2 * [self _thumbnailSize].height)
 needsRender = (NULL == _fullImageRef);
 else
 needsRender = (NULL == _thumbnailRef);
@@ -154,17 +173,16 @@
 return reachable;
 }
 
-// returns a 1/5 scale image; change this if -size changes (small image should 
be = 200 pixels)
-- (CGImageRef)_createResampledImage;
+- (CGImageRef)_createResampledImageOfSize:(NSSize)size 
fromCGImage:(CGImageRef)largeImage;
 {
-CGFloat width = [self size].width / 5;
-CGFloat height = [self size].height / 5;
+CGFloat width = size.width;
+CGFloat height = size.height;
 
 // these will always be the same size, so use the context cache
 CGContextRef ctxt = [FVBitmapContextCache newBitmapContextOfWidth:width 
height:height];
 CGContextSaveGState(ctxt);
 CGContextSetInterpolationQuality(ctxt, kCGInterpolationHigh);
-CGContextDrawImage(ctxt, CGRectMake(0, 0, CGBitmapContextGetWidth(ctxt), 
CGBitmapContextGetHeight(ctxt)), _fullImageRef);
+CGContextDrawImage(ctxt, CGRectMake(0, 0, CGBitmapContextGetWidth(ctxt), 
CGBitmapContextGetHeight(ctxt)), largeImage);
 CGContextRestoreGState(ctxt);
 
 CGImageRef smallImage = CGBitmapContextCreateImage(ctxt);
@@ -201,7 +219,7 @@
 WebFrameView *view = [[_webView mainFrame] frameView];
 [view setAllowsScrolling:NO];
 
-NSSize size = [self size];
+NSSize size = [self _webviewSize];
 CGContextRef context = [FVBitmapContextCache 
newBitmapContextOfWidth:size.width height:size.height];
 NSGraphicsContext *nsContext = [NSGraphicsContext 
graphicsContextWithGraphicsPort:context flipped:[view isFlipped]];
 
@@ -223,19 +241,23 @@
 
 [NSGraphicsContext restoreGraphicsState]; // restore previous context
 
+// temporary CGImage from the full webview
+CGImageRef largeImage = CGBitmapContextCreateImage(context);
+
 pthread_mutex_lock(_mutex);
 
 // full image is large, so cache it to disk in case we get a 
-releaseResources or another view needs it
 CGImageRelease(_fullImageRef);
-_fullImageRef = CGBitmapContextCreateImage(context);
+_fullImageRef = [self _createResampledImageOfSize:[self size] 

[Bibdesk-commit] SF.net SVN: bibdesk: [12198] trunk/bibdesk

2008-01-02 Thread amaxwell
Revision: 12198
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12198view=rev
Author:   amaxwell
Date: 2008-01-02 11:09:32 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Add a flag to display the automatic migration alert after the window loads, so 
it can be a sheet, and the migration controller is guaranteed to be the front 
window.

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

Modified: trunk/bibdesk/BibDocument.h
===
--- trunk/bibdesk/BibDocument.h 2008-01-02 18:29:14 UTC (rev 12197)
+++ trunk/bibdesk/BibDocument.h 2008-01-02 19:09:32 UTC (rev 12198)
@@ -224,6 +224,7 @@
 BOOLisDocumentClosed;
 BOOLdidImport;
 int itemChangeMask;
+BOOLdisplayMigrationAlert;
 } docState;
 
 NSURL *saveTargetURL;

Modified: trunk/bibdesk/BibDocument.m
===
--- trunk/bibdesk/BibDocument.m 2008-01-02 18:29:14 UTC (rev 12197)
+++ trunk/bibdesk/BibDocument.m 2008-01-02 19:09:32 UTC (rev 12198)
@@ -258,6 +258,7 @@
 docState.sortGroupsDescending = NO;
 docState.didImport = NO;
 docState.itemChangeMask = 0;
+docState.displayMigrationAlert = NO;
 
 // these are created lazily when needed
 fileSearchController = nil;
@@ -336,6 +337,15 @@
 return @BibDocument;
 }
 
+- (void)migrationAlertDidEnd:(BDSKAlert *)alert returnCode:(int)returnCode 
contextInfo:(void *)unused {
+
+if ([alert checkValue] == YES)
+[[NSUserDefaults standardUserDefaults] setBool:YES 
forKey:@BDSKDisableMigrationWarning];
+
+if (NSAlertDefaultReturn == returnCode)
+[self migrateFiles:self];
+}
+
 - (void)showWindows{
 [super showWindows];
 
@@ -368,6 +378,23 @@
 [self setSearchString:searchString];
 }
 }
+
+
+if (docState.displayMigrationAlert) {
+
+docState.displayMigrationAlert = NO;
+// If a single file was migrated, this alert will be shown even if all 
other BibItems already use BDSKLinkedFile.  However, I think that's an edge 
case, since the user had to manually add that pub in a text editor or by 
setting the local-url field.  Items imported or added in BD will already use 
BDSKLinkedFile, so this notification won't be posted.
+BDSKAlert *alert = [BDSKAlert 
alertWithMessageText:NSLocalizedString(@Automatically migrated files, 
@warning in document)
+ 
defaultButton:NSLocalizedString(@Migrate, @) 
+   
alternateButton:NSLocalizedString(@Later, @) 
+   otherButton:nil 
+ 
informativeTextWithFormat:NSLocalizedString(@Local File and URL fields have 
been converted to use a more flexible storage format.  Choose \Migrate\ to 
display the migration interface, which can show problems and convert 
permanently to the new format., @)];
+
+// @@ Should we show a check button? If the user saves the doc as-is, 
it'll have local-url and bdsk-file fields in it, and there will be no warning 
the next time it's opened.  Someone who uses a script hook to convert bdsk-file 
back to local-url won't want to see it, though.
+[alert setHasCheckButton:YES];
+[alert setCheckValue:NO];
+[alert beginSheetModalForWindow:[self windowForSheet] 
modalDelegate:self 
didEndSelector:@selector(migrationAlertDidEnd:returnCode:contextInfo:) 
contextInfo:NULL];
+}
 }
 
 - (void)windowControllerDidLoadNib:(NSWindowController *) aController
@@ -528,6 +555,7 @@
 [self updateCategoryGroupsPreservingSelection:NO];
 
 [saveTextEncodingPopupButton setEncoding:0];
+
 }
 
 - (BOOL)undoManagerShouldUndoChange:(id)sender{
@@ -2759,28 +2787,9 @@
 }
 
 - (void)handleTemporaryFileMigrationNotification:(NSNotification 
*)notification{
-if ([[NSUserDefaults standardUserDefaults] 
boolForKey:@BDSKDisableMigrationWarning] == NO) {
-
-// If a single file was migrated, this alert will be shown even if all 
other BibItems already use BDSKLinkedFile.  However, I think that's an edge 
case, since the user had to manually add that pub in a text editor or by 
setting the local-url field.  Items imported or added in BD will already use 
BDSKLinkedFile, so this notification won't be posted.
-BDSKAlert *alert = [BDSKAlert 
alertWithMessageText:NSLocalizedString(@Automatically migrated files, 
@warning in document)
- 
defaultButton:NSLocalizedString(@Migrate, @) 
-   
alternateButton:NSLocalizedString(@Later, @) 
-   otherButton:nil 
- 

[Bibdesk-commit] SF.net SVN: bibdesk: [12199] trunk/bibdesk/BDSKLinkedFile.m

2008-01-02 Thread hofman
Revision: 12199
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12199view=rev
Author:   hofman
Date: 2008-01-02 11:51:19 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Invert check.

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

Modified: trunk/bibdesk/BDSKLinkedFile.m
===
--- trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 19:09:32 UTC (rev 12198)
+++ trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 19:51:19 UTC (rev 12199)
@@ -134,7 +134,7 @@
 if (inBasePath != NULL) {
 err = BDSKPathToFSRef(inBasePath, baseRef);
 
-if (err != noErr)
+if (err == noErr)
 alias = BDSKFSRefToAliasHandle(ref, baseRef);
 } else {
 alias = BDSKFSRefToAliasHandle(ref, NULL);


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12200] trunk/bibdesk/BibItem.m

2008-01-02 Thread amaxwell
Revision: 12200
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12200view=rev
Author:   amaxwell
Date: 2008-01-02 12:12:31 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Fix bug #1861070.  Migration controller value transformer and other UI requires 
NSURL.  Since we can't create it, pass it in the description.

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

Modified: trunk/bibdesk/BibItem.m
===
--- trunk/bibdesk/BibItem.m 2008-01-02 19:51:19 UTC (rev 12199)
+++ trunk/bibdesk/BibItem.m 2008-01-02 20:12:31 UTC (rev 12200)
@@ -2799,8 +2799,7 @@
 } else {
 NSString *stringValue = [self valueOfField:(id)key inherit:NO];
 if (NO == [NSString isEmptyString:stringValue]) {
-// @@ this error message is lame
-NSDictionary *message = [[NSDictionary alloc] 
initWithObjectsAndKeys:stringValue, @URL, NSLocalizedString(@File or URL 
invalid, @), @error, nil];
+NSDictionary *message = [[NSDictionary alloc] 
initWithObjectsAndKeys:[NSString stringWithFormat:NSLocalizedString(@URL 
\[EMAIL PROTECTED] is invalid, @), stringValue], @error, nil];
 [ctxt-messages addObject:message];
 [message release];
 }


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12201] trunk/bibdesk/BDSKLinkedFile.m

2008-01-02 Thread hofman
Revision: 12201
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12201view=rev
Author:   hofman
Date: 2008-01-02 12:19:21 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Convert FSRef to URL to avoid an extra conversion back and forth to the path.

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

Modified: trunk/bibdesk/BDSKLinkedFile.m
===
--- trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 20:12:31 UTC (rev 12200)
+++ trunk/bibdesk/BDSKLinkedFile.m  2008-01-02 20:19:21 UTC (rev 12201)
@@ -292,38 +292,37 @@
 
 @implementation BDSKLinkedAliasFile
 
-// guaranteed to be called with a non-nil alias
+// takes possession of anAlias, even if it fails
 - (id)initWithAlias:(AliasHandle)anAlias relativePath:(NSString *)relPath 
delegate:(id)aDelegate;
 {
-NSParameterAssert(nil == aDelegate || [aDelegate 
respondsToSelector:@selector(basePathForLinkedFile:)]);
-NSParameterAssert(NULL != anAlias);
-if (self = [super init]) {
+OBASSERT(nil == aDelegate || [aDelegate 
respondsToSelector:@selector(basePathForLinkedFile:)]);
+
+if (anAlias == NULL) {
+[[super init] release];
+self = nil;
+} else if (self = [super init]) {
 fileRef = NULL; // this is updated lazily, as we don't know the base 
path at this point
 alias = anAlias;
 relativePath = [relPath copy];
 delegate = aDelegate;
+} else {
+DisposeHandle((Handle)anAlias);
 }
 return self;
 }
 
 - (id)initWithAliasData:(NSData *)data relativePath:(NSString *)relPath 
delegate:(id)aDelegate;
 {
-NSParameterAssert(nil != data);
+OBASSERT(nil != data);
+
 AliasHandle anAlias = BDSKDataToAliasHandle((CFDataRef)data);
-if (anAlias == NULL) {
-[[super init] release];
-self = nil;
-} else {
-self = [self initWithAlias:anAlias relativePath:relPath 
delegate:aDelegate];
-if (self == nil)
-DisposeHandle((Handle)anAlias);
-}
-return self;
+return [self initWithAlias:anAlias relativePath:relPath 
delegate:aDelegate];
 }
 
 - (id)initWithBase64String:(NSString *)base64String delegate:(id)aDelegate;
 {
-NSParameterAssert(nil != base64String);
+OBASSERT(nil != base64String);
+
 NSData *data = [[NSData alloc] initWithBase64String:base64String];
 NSDictionary *dictionary = [NSKeyedUnarchiver 
unarchiveObjectWithData:data];
 [data release];
@@ -332,22 +331,17 @@
 
 - (id)initWithPath:(NSString *)aPath delegate:(id)aDelegate;
 {
-NSParameterAssert(nil != aPath);
-NSParameterAssert(nil == aDelegate || [aDelegate 
respondsToSelector:@selector(basePathForLinkedFile:)]);
+OBASSERT(nil != aPath);
+OBASSERT(nil == aDelegate || [aDelegate 
respondsToSelector:@selector(basePathForLinkedFile:)]);
+
 NSString *basePath = [aDelegate basePathForLinkedFile:self];
 NSString *relPath = [basePath relativePathToFilename:aPath];
 AliasHandle anAlias = BDSKPathToAliasHandle((CFStringRef)aPath, 
(CFStringRef)basePath);
 
-if (anAlias != NULL) {
-if ((self = [self initWithAlias:anAlias relativePath:relPath 
delegate:aDelegate])) {
-if (basePath)
-// this initalizes the FSRef and update the alias
-[self fileRef];
-} else
-DisposeHandle((Handle)anAlias);
-} else {
-[[super init] release];
-self = nil;
+if (self = [self initWithAlias:anAlias relativePath:relPath 
delegate:aDelegate]) {
+if (basePath)
+// this initalizes the FSRef and update the alias
+[self fileRef];
 }
 return self;
 }
@@ -355,12 +349,13 @@
 - (id)initWithURL:(NSURL *)aURL delegate:(id)aDelegate;
 {
 OBASSERT([aURL isFileURL]);
+
 return [self initWithPath:[aURL path] delegate:aDelegate];
 }
 
 - (id)initWithURLString:(NSString *)aString;
 {
-OBASSERT_NOT_REACHED(Attempt to initialize BDSKLocalFile with a URL 
string);
+OBASSERT_NOT_REACHED(Attempt to initialize BDSKLinkedAliasFile with a URL 
string);
 return nil;
 }
 
@@ -420,7 +415,8 @@
 }
 
 - (void)setDelegate:(id)newDelegate {
-NSParameterAssert(nil == newDelegate || [newDelegate 
respondsToSelector:@selector(basePathForLinkedFile:)]);
+OBASSERT(nil == newDelegate || [newDelegate 
respondsToSelector:@selector(basePathForLinkedFile:)]);
+
 delegate = newDelegate;
 }
 
@@ -493,8 +489,16 @@
 
 - (NSURL *)URL;
 {
-NSString *path = [self path];
-return path ? [NSURL fileURLWithPath:path] : nil;
+BOOL hadFileRef = fileRef != NULL;
+CFURLRef aURL = hadFileRef ? CFURLCreateFromFSRef(NULL, fileRef) : NULL;
+
+if (aURL == NULL  hadFileRef) {
+// fileRef was invalid, try to update it
+[self setFileRef:NULL];
+if ([self fileRef] != NULL)
+aURL = CFURLCreateFromFSRef(NULL, fileRef);
+}
+return [(NSURL *)aURL autorelease];

[Bibdesk-commit] SF.net SVN: bibdesk: [12202] trunk/bibdesk/BDSKAppController.m

2008-01-02 Thread amaxwell
Revision: 12202
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12202view=rev
Author:   amaxwell
Date: 2008-01-02 12:29:24 -0800 (Wed, 02 Jan 2008)

Log Message:
---
uncomment OBINITIALIZE

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

Modified: trunk/bibdesk/BDSKAppController.m
===
--- trunk/bibdesk/BDSKAppController.m   2008-01-02 20:19:21 UTC (rev 12201)
+++ trunk/bibdesk/BDSKAppController.m   2008-01-02 20:29:24 UTC (rev 12202)
@@ -107,7 +107,7 @@
 
 + (void)initialize
 {
-//OBINITIALIZE;
+OBINITIALIZE;
 
 // make sure we use Spotlight's plugins on 10.4 and later
 SKLoadDefaultExtractorPlugIns();


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] www.selfbanking.com.ar

2008-01-02 Thread Pls check this new site
Please see this site in Subject

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12205] trunk/bibdesk/BDSKSearchIndex.m

2008-01-02 Thread amaxwell
Revision: 12205
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12205view=rev
Author:   amaxwell
Date: 2008-01-02 12:48:13 -0800 (Wed, 02 Jan 2008)

Log Message:
---
un-import header

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

Modified: trunk/bibdesk/BDSKSearchIndex.m
===
--- trunk/bibdesk/BDSKSearchIndex.m 2008-01-02 20:36:16 UTC (rev 12204)
+++ trunk/bibdesk/BDSKSearchIndex.m 2008-01-02 20:48:13 UTC (rev 12205)
@@ -40,7 +40,6 @@
 #import BibDocument.h
 #import BibItem.h
 #import libkern/OSAtomic.h
-#import BDSKTypeManager.h
 #import BDSKThreadSafeMutableArray.h
 #import NSObject_BDSKExtensions.h
 


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12206] trunk/bibdesk/BDSKTypeManager.m

2008-01-02 Thread amaxwell
Revision: 12206
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12206view=rev
Author:   amaxwell
Date: 2008-01-02 13:39:46 -0800 (Wed, 02 Jan 2008)

Log Message:
---
eliminate @synchronized since the local file set isn't accessed from a 
secondary thread anymore

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

Modified: trunk/bibdesk/BDSKTypeManager.m
===
--- trunk/bibdesk/BDSKTypeManager.m 2008-01-02 20:48:13 UTC (rev 12205)
+++ trunk/bibdesk/BDSKTypeManager.m 2008-01-02 21:39:46 UTC (rev 12206)
@@ -52,7 +52,6 @@
 + (void)initialize
 {
 OBINITIALIZE;
-// Create the singleton here since +initialize is thread safe; 
@synchronized in +sharedManager was killing performance, especially with the 
NSString category methods.
 if(sharedInstance == nil) 
 sharedInstance = [[self alloc] init];
 }
@@ -184,42 +183,40 @@
 }
 
 - (void)reloadTypeInfo{
-   @synchronized(self){
-// Load the TypeInfo plists
-NSDictionary *typeInfoDict = [NSDictionary 
dictionaryWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] 
stringByAppendingPathComponent:TYPE_INFO_FILENAME]];
+// Load the TypeInfo plists
+NSDictionary *typeInfoDict = [NSDictionary 
dictionaryWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] 
stringByAppendingPathComponent:TYPE_INFO_FILENAME]];
 
-NSFileManager *fm = [NSFileManager defaultManager];
-NSString *userTypeInfoPath = [[fm 
currentApplicationSupportPathForCurrentUser] 
stringByAppendingPathComponent:TYPE_INFO_FILENAME];
-NSDictionary *userTypeInfoDict;
-
-if ([fm fileExistsAtPath:userTypeInfoPath]) {
-userTypeInfoDict = [NSDictionary 
dictionaryWithContentsOfFile:userTypeInfoPath];
-// set all the lists we support in the user file
-[self setFieldsForTypesDict:[userTypeInfoDict 
objectForKey:FIELDS_FOR_TYPES_KEY]];
-[self setTypesForFileTypeDict:[NSDictionary 
dictionaryWithObjectsAndKeys: 
-[[userTypeInfoDict objectForKey:TYPES_FOR_FILE_TYPE_KEY] 
objectForKey:BDSKBibtexString], BDSKBibtexString, 
-[[typeInfoDict objectForKey:TYPES_FOR_FILE_TYPE_KEY] 
objectForKey:@PubMed], @PubMed, nil]];
-} else {
-[self setFieldsForTypesDict:[typeInfoDict 
objectForKey:FIELDS_FOR_TYPES_KEY]];
-[self setTypesForFileTypeDict:[typeInfoDict 
objectForKey:TYPES_FOR_FILE_TYPE_KEY]];
-}
-
-[self setFileTypesDict:[typeInfoDict objectForKey:FILE_TYPES_KEY]];
-[self setFieldNameForPubMedTagDict:[typeInfoDict 
objectForKey:BIBTEX_FIELDS_FOR_PUBMED_TAGS_KEY]];
-[self setBibtexTypeForPubMedTypeDict:[typeInfoDict 
objectForKey:BIBTEX_TYPES_FOR_PUBMED_TYPES_KEY]];
-[self setFieldNamesForMARCTagDict:[typeInfoDict 
objectForKey:BIBTEX_FIELDS_FOR_MARC_TAGS_KEY]];
-[self setMODSGenresForBibTeXTypeDict:[typeInfoDict 
objectForKey:MODS_GENRES_FOR_BIBTEX_TYPES_KEY]];
-[self setFieldNameForJSTORTagDict:[typeInfoDict 
objectForKey:BIBTEX_FIELDS_FOR_JSTOR_TAGS_KEY]];
-[self setFieldDescriptionForJSTORTagDict:[typeInfoDict 
objectForKey:FIELD_DESCRIPTIONS_FOR_JSTOR_TAGS_KEY]];
-[self setFieldNameForWebOfScienceTagDict:[typeInfoDict 
objectForKey:BIBTEX_FIELDS_FOR_WOS_TAGS_KEY]];
-[self setFieldDescriptionForWebOfScienceTagDict:[typeInfoDict 
objectForKey:FIELD_DESCRIPTIONS_FOR_WOS_TAGS_KEY]];
-[self setBibtexTypeForWebOfScienceTypeDict:[typeInfoDict 
objectForKey:BIBTEX_TYPES_FOR_WOS_TYPES_KEY]];
-[self setBibtexTypeForDublinCoreTypeDict:[typeInfoDict 
objectForKey:BIBTEX_TYPES_FOR_DC_TYPES_KEY]];
-[self setFieldNameForDublinCoreTermDict:[typeInfoDict 
objectForKey:BIBTEX_FIELDS_FOR_DC_TERMS_KEY]];
-[self setFieldNameForReferTagDict:[typeInfoDict 
objectForKey:BIBTEX_FIELDS_FOR_REFER_TAGS_KEY]];
-[self setBibtexTypeForReferTypeDict:[typeInfoDict 
objectForKey:BIBTEX_TYPES_FOR_REFER_TYPES_KEY]];
-[self setBibtexTypeForHCiteTypeDict:[typeInfoDict 
objectForKey:BIBTEX_TYPES_FOR_HCITE_TYPES_KEY]];
+NSFileManager *fm = [NSFileManager defaultManager];
+NSString *userTypeInfoPath = [[fm 
currentApplicationSupportPathForCurrentUser] 
stringByAppendingPathComponent:TYPE_INFO_FILENAME];
+NSDictionary *userTypeInfoDict;
+
+if ([fm fileExistsAtPath:userTypeInfoPath]) {
+userTypeInfoDict = [NSDictionary 
dictionaryWithContentsOfFile:userTypeInfoPath];
+// set all the lists we support in the user file
+[self setFieldsForTypesDict:[userTypeInfoDict 
objectForKey:FIELDS_FOR_TYPES_KEY]];
+[self setTypesForFileTypeDict:[NSDictionary 
dictionaryWithObjectsAndKeys: 
+[[userTypeInfoDict objectForKey:TYPES_FOR_FILE_TYPE_KEY] 
objectForKey:BDSKBibtexString], BDSKBibtexString, 
+[[typeInfoDict objectForKey:TYPES_FOR_FILE_TYPE_KEY] 

[Bibdesk-commit] SF.net SVN: bibdesk: [12207] trunk/bibdesk/BibItem+Scripting.m

2008-01-02 Thread hofman
Revision: 12207
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12207view=rev
Author:   hofman
Date: 2008-01-02 14:36:20 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Make sure URLs inserted using AppleScript are properly %-escaped.

Modified Paths:
--
trunk/bibdesk/BibItem+Scripting.m

Modified: trunk/bibdesk/BibItem+Scripting.m
===
--- trunk/bibdesk/BibItem+Scripting.m   2008-01-02 21:39:46 UTC (rev 12206)
+++ trunk/bibdesk/BibItem+Scripting.m   2008-01-02 22:36:20 UTC (rev 12207)
@@ -42,6 +42,7 @@
 #import BDSKBibTeXParser.h
 #import BDSKPublicationsArray.h
 #import BDSKLinkedFile.h
+#import NSURL_BDSKExtensions.h
 
 /* ssp
 A Category on BibItem with a few additional methods to enable and enhance its 
scriptability beyond what comes for free with key value coding.
@@ -135,7 +136,8 @@
 }
 
 - (void)insertInLinkedURLs:(NSString *)newURLString atIndex:(unsigned int)idx {
-BDSKLinkedFile *file = [[[BDSKLinkedFile alloc] 
initWithURLString:newURLString] autorelease];
+NSURL *newURL = [NSURL 
URLWithStringByNormalizingPercentEscapes:newURLString];
+BDSKLinkedFile *file = [[[BDSKLinkedFile alloc] initWithURL:newURL] 
autorelease];
 if (file) {
 NSArray *remoteURLs = [self remoteURLs];
 if (idx  [remoteURLs count]) {


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12208] trunk/bibdesk_vendorsrc/amaxwell/FileView/ FVPreviewer.m

2008-01-02 Thread hofman
Revision: 12208
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12208view=rev
Author:   hofman
Date: 2008-01-02 17:10:30 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Close previewer using Cmd-Y from previewer.

Modified Paths:
--
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m
===
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m 2008-01-02 
22:36:20 UTC (rev 12207)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m 2008-01-03 
01:10:30 UTC (rev 12208)
@@ -364,4 +364,8 @@
 }
 }
 
+- (IBAction)previewAction:(id)sender {
+   [[self window] close];
+}
+
 @end


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12209] trunk/bibdesk

2008-01-02 Thread hofman
Revision: 12209
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12209view=rev
Author:   hofman
Date: 2008-01-02 18:10:16 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Cache objects representing displayed files. Use the same keys for objects 
representing files of normal selected items and for file content search.

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

Modified: trunk/bibdesk/BDSKFileContentSearchController.h
===
--- trunk/bibdesk/BDSKFileContentSearchController.h 2008-01-03 01:10:30 UTC 
(rev 12208)
+++ trunk/bibdesk/BDSKFileContentSearchController.h 2008-01-03 02:10:16 UTC 
(rev 12209)
@@ -108,6 +108,7 @@
 - (NSArray *)identifierURLsOfSelectedItems;
 - (NSArray *)URLsOfSelectedItems;
 - (NSArray *)titlesOfSelectedItems;
+- (NSArray *)selectedResults;
 
 - (NSArray *)results;
 - (void)setResults:(NSArray *)newResults;

Modified: trunk/bibdesk/BDSKFileContentSearchController.m
===
--- trunk/bibdesk/BDSKFileContentSearchController.m 2008-01-03 01:10:30 UTC 
(rev 12208)
+++ trunk/bibdesk/BDSKFileContentSearchController.m 2008-01-03 02:10:16 UTC 
(rev 12209)
@@ -342,6 +342,10 @@
 return [[resultsArrayController selectedObjects] valueForKey:@string];
 }
 
+- (NSArray *)selectedResults {
+return [resultsArrayController selectedObjects];
+}
+
 #pragma mark -
 #pragma mark SearchKit methods
 

Modified: trunk/bibdesk/BibDocument.h
===
--- trunk/bibdesk/BibDocument.h 2008-01-03 01:10:30 UTC (rev 12208)
+++ trunk/bibdesk/BibDocument.h 2008-01-03 02:10:16 UTC (rev 12209)
@@ -188,6 +188,8 @@
 // All display related operations should use shownPublications

 BDSKGroupsArray *groups;
+
+NSMutableArray *shownFiles;

 #pragma mark Search group bookmarks
 
@@ -481,6 +483,9 @@
 
 - (NSArray *)selectedFileURLs;
 
+- (NSArray *)shownFiles;
+- (void)invalidateShownFiles;
+
 - (void)setStatus:(NSString *)status;
 - (void)setStatus:(NSString *)status immediate:(BOOL)now;
 

Modified: trunk/bibdesk/BibDocument.m
===
--- trunk/bibdesk/BibDocument.m 2008-01-03 01:10:30 UTC (rev 12208)
+++ trunk/bibdesk/BibDocument.m 2008-01-03 02:10:16 UTC (rev 12209)
@@ -151,17 +151,18 @@
 enum {
 BDSKItemChangedGroupFieldMask = 1,
 BDSKItemChangedSearchKeyMask = 2,
-BDSKItemChangedSortKeyMask = 4
+BDSKItemChangedSortKeyMask = 4,
+BDSKItemChangedFilesMask = 8
 };
 
 @interface BDSKFileViewObject : NSObject
 {
-NSString *subtitle;
+NSString *string;
 NSURL *URL;
 }
-- (id)initWithURL:(NSURL *)aURL subtitle:(NSString *)aString;
-- (NSString *)subtitle;
-- (void)setSubtitle:(NSString *)value;
+- (id)initWithURL:(NSURL *)aURL string:(NSString *)aString;
+- (NSString *)string;
+- (void)setString:(NSString *)value;
 
 - (NSURL *)URL;
 - (void)setURL:(NSURL *)value;
@@ -170,11 +171,11 @@
 
 @implementation BDSKFileViewObject
 
-- (id)initWithURL:(NSURL *)aURL subtitle:(NSString *)aString;
+- (id)initWithURL:(NSURL *)aURL string:(NSString *)aString;
 {
 self = [super init];
 if (self) {
-[self setSubtitle:aString];
+[self setString:aString];
 [self setURL:aURL];
 }
 return self;
@@ -182,19 +183,19 @@
 
 - (void)dealloc
 {
-[subtitle release];
+[string release];
 [URL release];
 [super dealloc];
 }
 
-- (NSString *)subtitle {
-return subtitle;
+- (NSString *)string {
+return string;
 }
 
-- (void)setSubtitle:(NSString *)value {
-if (subtitle != value) {
-[subtitle release];
-subtitle = [value copy];
+- (void)setString:(NSString *)value {
+if (string != value) {
+[string release];
+string = [value copy];
 }
 }
 
@@ -309,6 +310,7 @@
 [shownPublications release];
 [groupedPublications release];
 [groups release];
+[shownFiles release];
 [frontMatter release];
 [documentInfo release];
 [drawerController release];
@@ -2617,6 +2619,9 @@
 if (docState.isDocumentClosed)
 return;
 
+if ((docState.itemChangeMask  BDSKItemChangedFilesMask) != 0)
+[self invalidateShownFiles];
+
 BOOL shouldUpdateGroups = [NSString isEmptyString:[self 
currentGroupField]] == NO  (docState.itemChangeMask  
BDSKItemChangedGroupFieldMask) != 0;
[self updateSmartGroupsCountAndContent:shouldUpdateGroups];
 
@@ -2729,7 +2734,10 @@
 docState.itemChangeMask |= BDSKItemChangedSortKeyMask;
 if ([self searchKeyDependsOnKey:changedKey])
 docState.itemChangeMask |= BDSKItemChangedSearchKeyMask;
+if ([changedKey isEqualToString:BDSKLocalFileString] || [changedKey 

[Bibdesk-commit] SF.net SVN: bibdesk: [12210] trunk/bibdesk_vendorsrc/amaxwell/FileView

2008-01-02 Thread amaxwell
Revision: 12210
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12210view=rev
Author:   amaxwell
Date: 2008-01-02 19:11:10 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Pass updated icons in update callback from the rendering thread.  This allows
the view to only redraw regions that have changed, which gives a nice
performance improvement in drawing.

Modified Paths:
--
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconQueue.m
trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconQueue.m
===
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconQueue.m 2008-01-03 
02:10:16 UTC (rev 12209)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIconQueue.m 2008-01-03 
03:11:10 UTC (rev 12210)
@@ -137,10 +137,11 @@
 NSUInteger i = 0, iMax = [taskQueue count], length = MIN((iMax - i), 
(NSUInteger)5);
 while (length) {
 NSRange r = NSMakeRange(i, length);
-[[taskQueue subarrayWithRange:r] 
makeObjectsPerformSelector:@selector(renderOffscreen)];
+NSArray *toRender = [taskQueue subarrayWithRange:r];
+[toRender makeObjectsPerformSelector:@selector(renderOffscreen)];
 
 // using waitUntilDone:YES keeps the app much more responsive; 
otherwise we end up with too many drawing updates and repetitive rendering 
requests
-[target performSelectorOnMainThread:@selector(iconQueueUpdated) 
withObject:nil waitUntilDone:YES modes:modes];
+[target performSelectorOnMainThread:@selector(iconQueueUpdated:) 
withObject:toRender waitUntilDone:YES modes:modes];
 i = NSMaxRange(r);
 length = MIN((iMax - i), (NSUInteger)5);
 }

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m
===
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m2008-01-03 
02:10:16 UTC (rev 12209)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FileView.m2008-01-03 
03:11:10 UTC (rev 12210)
@@ -729,9 +729,36 @@
 [[FVIconQueue sharedQueue] enqueueRenderIcons:icons forObject:self];
 }
 
-- (void)iconQueueUpdated;
+- (void)iconQueueUpdated:(NSArray *)updatedIcons;
 {
-[self setNeedsDisplay:YES];
+// Only iterate icons in the visible range, since we know the overall 
geometry
+NSRange rowRange, columnRange;
+[self _getRangeOfRows:rowRange columns:columnRange inRect:[self 
visibleRect]];
+
+NSUInteger iMin, iMax = [self numberOfIcons];
+
+// _indexForGridRow:column: returns NSNotFound if we're in a short row 
(empty column)
+iMin = [self _indexForGridRow:rowRange.location 
column:columnRange.location];
+if (NSNotFound == iMin)
+iMin = [self numberOfIcons];
+else
+iMax = MIN([self numberOfIcons], iMin + rowRange.length * [self 
numberOfColumns]);
+
+NSArray *visibleIcons = [self iconsAtIndexes:[NSIndexSet 
indexSetWithIndexesInRange:NSMakeRange(iMin, iMax - iMin)]];
+NSUInteger i;
+NSSet *updatedIconSet = [[NSSet alloc] initWithArray:updatedIcons];
+CGFloat padding = 3.0 * [self iconScale];
+
+// If an icon isn't visible, there's no need to redisplay anything.  
Similarly, if 20 icons are displayed and only 5 updated, there's no need to 
redraw all 20.  Geometry calculations are much faster than redrawing, in 
general.
+for (i = iMin; i  iMax; i++) {
+
+if ([updatedIconSet containsObject:[visibleIcons objectAtIndex:(i - 
iMin)]]) {
+NSUInteger r, c;
+if ([self _getGridRow:r column:c ofIndex:i])
+[self setNeedsDisplayInRect:NSInsetRect([self 
_rectOfIconInRow:r column:c], -padding, -padding)];
+}
+}
+[updatedIconSet release];
 }
 
 // drawRect: uses -releaseResources on icons that aren't visible but present 
in the datasource, so we just need a way to cull icons that are cached but not 
currently in the datasource


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit


[Bibdesk-commit] SF.net SVN: bibdesk: [12213] trunk/bibdesk/Bibdesk.xcodeproj/project. pbxproj

2008-01-02 Thread amaxwell
Revision: 12213
  http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12213view=rev
Author:   amaxwell
Date: 2008-01-02 23:05:24 -0800 (Wed, 02 Jan 2008)

Log Message:
---
Change version to 987

Modified Paths:
--
trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj

Modified: trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
===
--- trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj 2008-01-03 07:04:35 UTC 
(rev 12212)
+++ trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj 2008-01-03 07:05:24 UTC 
(rev 12213)
@@ -4468,7 +4468,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = F95C5E970D10E87C00C81970 
/* BibDesk-Debug.xcconfig */;
buildSettings = {
-   CURRENT_PROJECT_VERSION = 986;
+   CURRENT_PROJECT_VERSION = 987;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
@@ -4508,7 +4508,7 @@
i386,
);
COPY_PHASE_STRIP = YES;
-   CURRENT_PROJECT_VERSION = 986;
+   CURRENT_PROJECT_VERSION = 987;
FRAMEWORK_SEARCH_PATHS = ;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
@@ -4563,7 +4563,7 @@
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
-   CURRENT_PROJECT_VERSION = 986;
+   CURRENT_PROJECT_VERSION = 987;
DEBUG_INFORMATION_FORMAT = dwarf;
FRAMEWORK_SEARCH_PATHS = ;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
@@ -4915,7 +4915,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = $(NATIVE_ARCH);
-   CURRENT_PROJECT_VERSION = 986;
+   CURRENT_PROJECT_VERSION = 987;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_AUTO_VECTORIZATION = NO;
GCC_PREPROCESSOR_DEFINITIONS = ;


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 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit