Revision: 23920
          http://sourceforge.net/p/bibdesk/svn/23920
Author:   hofman
Date:     2019-07-02 09:15:55 +0000 (Tue, 02 Jul 2019)
Log Message:
-----------
call script hook after downloading a file

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

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2019-07-02 06:32:40 UTC (rev 23919)
+++ trunk/bibdesk/BibItem.m     2019-07-02 09:15:55 UTC (rev 23920)
@@ -3219,12 +3219,21 @@
                 [self removeObjectFromFilesAtIndex:idx];
             BDSKLinkedFile *file = [[BDSKLinkedFile alloc] initWithURL:fileURL 
delegate:self];
             [self insertObject:file inFilesAtIndex:realIdx == NSNotFound ? idx 
: realIdx];
-            if (useLocalUrl == NO && autoFile)
-                [self autoFileLinkedFile:file];
+            if (useLocalUrl == NO) {
+                if ([owner isDocument])
+                    [(BibDocument *)[self owner] userAddedURL:fileURL 
forPublication:self];
+                if (autoFile)
+                    [self autoFileLinkedFile:file];
+            }
         } else {
+            NSString *oldValue = [self valueOfField:BDSKLocalUrlString 
inherit:NO] ?: @"";
             [self setField:BDSKLocalUrlString toURLValue:fileURL];
-            if (useLocalUrl && autoFile)
-                [self autoFileLocalUrl];
+            if (useLocalUrl) {
+                if ([owner isDocument])
+                    [(BibDocument *)[self owner] 
userChangedField:BDSKLocalUrlString ofPublication:self from:oldValue to:[self 
valueOfField:BDSKLocalUrlString inherit:NO]];
+                if (autoFile)
+                    [self autoFileLocalUrl];
+            }
         }
     }
     [downloads removeObject:download];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to