]> granicus.if.org Git - transmission/commitdiff
Revert r13468 for now.
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 6 Sep 2012 03:21:03 +0000 (03:21 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 6 Sep 2012 03:21:03 +0000 (03:21 +0000)
12 files changed:
Transmission.xcodeproj/project.pbxproj
libtransmission/torrent.c
libtransmission/utils.c
libtransmission/utils.h
macosx/Growl.framework/Versions/A/Growl
macosx/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h
macosx/Growl.framework/Versions/A/Headers/GrowlDefines.h
macosx/Growl.framework/Versions/A/Resources/Info.plist
macosx/Growl.framework/Versions/A/_CodeSignature/CodeResources
macosx/MessageWindowController.m
macosx/QuickLookPlugin/GeneratePreviewForURL.m
macosx/StatusBarView.m

index e13910ec8ca518338d507a72a3cc5f77374f6c89..1c6677610388a3acdbdd77a3bc7b814a0ccedec1 100644 (file)
                A2D77451154CC25700A62B93 /* WebSeedTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D7744F154CC25700A62B93 /* WebSeedTableView.h */; };
                A2D77452154CC25700A62B93 /* WebSeedTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D77450154CC25700A62B93 /* WebSeedTableView.m */; };
                A2D77453154CC72B00A62B93 /* WebSeedTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D77450154CC25700A62B93 /* WebSeedTableView.m */; };
-               A2D8CFBA15F82DFA0056E93D /* NSApplicationAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A29D84031049C25600D1987A /* NSApplicationAdditions.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
-               A2D8CFBB15F82E030056E93D /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DE5CC9C0980656F00BE280E /* NSStringAdditions.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+               A2D8CFBA15F82DFA0056E93D /* NSApplicationAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A29D84031049C25600D1987A /* NSApplicationAdditions.m */; };
+               A2D8CFBB15F82E030056E93D /* NSStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DE5CC9C0980656F00BE280E /* NSStringAdditions.m */; };
                A2DA362A0CBC674900C2ED41 /* InfoActivity.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DA36270CBC674900C2ED41 /* InfoActivity.png */; };
                A2DA362B0CBC674900C2ED41 /* InfoFiles.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DA36280CBC674900C2ED41 /* InfoFiles.png */; };
                A2DA362C0CBC674900C2ED41 /* InfoPeers.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DA36290CBC674900C2ED41 /* InfoPeers.png */; };
                A2F35BD115C5A0A100EBF632 /* Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               CLANG_ENABLE_OBJC_ARC = YES;
                                GCC_PREFIX_HEADER = "$(SRCROOT)/macosx/QuickLookPlugin/QuickLookPlugin-Prefix.pch";
                                INFOPLIST_FILE = "$(SRCROOT)/macosx/QuickLookPlugin/QuickLookPlugin-Info.plist";
                                INSTALL_PATH = /Library/QuickLook;
-                               LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MACOSX_DEPLOYMENT_TARGET = 10.6.8;
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)/third-party/curl/lib\"",
+                               );
                                OTHER_LDFLAGS = (
                                        "-read_only_relocs",
                                        suppress,
                A2F35BD215C5A0A100EBF632 /* Release - Debug */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               CLANG_ENABLE_OBJC_ARC = YES;
                                GCC_PREFIX_HEADER = "$(SRCROOT)/macosx/QuickLookPlugin/QuickLookPlugin-Prefix.pch";
                                INFOPLIST_FILE = "$(SRCROOT)/macosx/QuickLookPlugin/QuickLookPlugin-Info.plist";
                                INSTALL_PATH = /Library/QuickLook;
-                               LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MACOSX_DEPLOYMENT_TARGET = 10.6.8;
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)/third-party/curl/lib\"",
+                               );
                                OTHER_LDFLAGS = (
                                        "-read_only_relocs",
                                        suppress,
                A2F35BD315C5A0A100EBF632 /* Release */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               CLANG_ENABLE_OBJC_ARC = YES;
                                GCC_PREFIX_HEADER = "$(SRCROOT)/macosx/QuickLookPlugin/QuickLookPlugin-Prefix.pch";
                                INFOPLIST_FILE = "$(SRCROOT)/macosx/QuickLookPlugin/QuickLookPlugin-Info.plist";
                                INSTALL_PATH = /Library/QuickLook;
-                               LIBRARY_SEARCH_PATHS = "$(inherited)";
-                               MACOSX_DEPLOYMENT_TARGET = 10.6.8;
+                               LIBRARY_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "\"$(SRCROOT)/third-party/curl/lib\"",
+                               );
                                OTHER_LDFLAGS = (
                                        "-read_only_relocs",
                                        suppress,
index 378c357fe6238742573a173283cda5f8763881ab..aced253a635e03748b3ad3c0d2440f1f0974b982 100644 (file)
@@ -2914,6 +2914,8 @@ setLocation( void * vdata )
     if( !tr_is_same_file( location, tor->currentDir ) )
     {
         tr_file_index_t i;
+        tr_ptrArray copiedxattrs = TR_PTR_ARRAY_INIT;
+        const void * const vstrcmp = strcmp;
 
         /* bad idea to move files while they're being verified... */
         tr_verifyRemove( tor );
@@ -2935,6 +2937,7 @@ setLocation( void * vdata )
 
                 if( do_move && !tr_is_same_file( oldpath, newpath ) )
                 {
+                    char * cursub;
                     bool renamed = false;
                     errno = 0;
                     tr_torinf( tor, "moving \"%s\" to \"%s\"", oldpath, newpath );
@@ -2944,6 +2947,24 @@ setLocation( void * vdata )
                         tr_torerr( tor, "error moving \"%s\" to \"%s\": %s",
                                         oldpath, newpath, tr_strerror( errno ) );
                     }
+
+                    /* copy extended attributes */
+                    cursub = tr_dirname( sub );
+                    while( strcmp( cursub, "." ) != 0 ) {
+                        char * tmp;
+                        if ( tr_ptrArrayFindSorted( &copiedxattrs, cursub, vstrcmp ) == NULL ) {
+                            char * olddir = tr_buildPath( oldbase, cursub, NULL );
+                            char * newdir = tr_buildPath( location, cursub, NULL );
+                            tr_copyXattr( olddir, newdir );
+                            tr_free( olddir );
+                            tr_free( newdir );
+                            tr_ptrArrayInsertSorted( &copiedxattrs, tr_strdup( cursub ), vstrcmp );
+                        }
+                        tmp = tr_dirname( cursub );
+                        tr_free( cursub );
+                        cursub = tmp;
+                    }
+                    tr_free(cursub);
                 }
 
                 tr_free( newpath );
@@ -2967,6 +2988,7 @@ setLocation( void * vdata )
             /* set the new location and reverify */
             tr_torrentSetDownloadDir( tor, location );
         }
+        tr_ptrArrayDestruct( &copiedxattrs, tr_free );
     }
 
     if( !err && do_move )
index c09295791151c1bde34b686ac8fbcdb4acc26d95..89de3fd4602f6a78a9ee92e9c5689421e098b2c5 100644 (file)
@@ -19,6 +19,7 @@
  #define HAVE_ICONV_OPEN
  #define HAVE_MKDTEMP
  #define HAVE_VALLOC
+ #define HAVE_XATTRS_MACOS
 #endif
 
 #include <assert.h>
@@ -40,6 +41,9 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_XATTRS_MACOS
+ #include <sys/xattr.h> /*  listxattr(), getxattr(), setxattr() */
+#endif
 #include <unistd.h> /* stat(), getcwd(), getpagesize(), unlink() */
 
 #include <event2/buffer.h>
@@ -1510,6 +1514,75 @@ tr_strratio( char * buf, size_t buflen, double ratio, const char * infinity )
     return buf;
 }
 
+int
+tr_copyXattr( const char* srcpath, const char* dstpath )
+{
+    int ret = 0;
+#ifdef HAVE_XATTRS_MACOS
+    char * listbuf = NULL, * valuebuf = NULL;
+    ssize_t listlen = 0, valuelen = 0;
+    char* name;
+
+    listlen = listxattr( srcpath, NULL, 0, 0 );
+
+    if( listlen <= 0 ) {
+        ret = -1;
+        goto out;
+    }
+
+    listbuf = tr_malloc( listlen );
+    if( listbuf == NULL ) {
+        ret = -1;
+        goto out;
+    }
+
+    listlen = listxattr( srcpath, listbuf, listlen, 0 );
+    if( listlen <= 0) {
+        ret = -1;
+        goto out;
+    }
+
+    for( name = listbuf; name < listbuf + listlen; name = strchr( name, '\0' ) + 1) {
+        ssize_t len = getxattr( srcpath, name, NULL, 0, 0, 0);
+        if( len < 0 ) {
+            ret = -1;
+            goto out;
+        }
+
+        if( len > valuelen ) {
+            valuelen = len;
+            valuebuf = reallocf( valuebuf, valuelen );
+            if (valuebuf == NULL) {
+                ret = -1;
+                goto out;
+            }
+        }
+
+        len = getxattr( srcpath, name, valuebuf, valuelen, 0, 0 );
+        if ( len < 0) {
+            ret = -1;
+            goto out;
+        }
+
+        ret = setxattr( dstpath, name, valuebuf, len, 0, 0 );
+        if( ret != 0 ) {
+            ret = -1;
+            goto out;
+        }
+    }
+
+out:
+    tr_free( valuebuf );
+    tr_free( listbuf );
+
+    if( ret != 0 )
+        tr_err( "Couldn't copy xattrs from \"%s\" to \"%s\": %s",
+                srcpath, dstpath, tr_strerror( errno ) );
+
+#endif
+    return ret;
+}
+
 /***
 ****
 ***/
@@ -1578,6 +1651,7 @@ tr_moveFile( const char * oldpath, const char * newpath, bool * renamed )
     if( bytesLeft != 0 )
         return -1;
 
+    tr_copyXattr( oldpath, newpath );
     unlink( oldpath );
     return 0;
 }
index 826a9b30c01b1d706768fac7c4de5c28b74ec2d9..1dc8c06ac1d66f77f1ba4ae92644f2e3e7b1196a 100644 (file)
@@ -481,6 +481,12 @@ char* tr_strratio( char * buf, size_t buflen, double ratio, const char * infinit
 struct tm * tr_localtime_r( const time_t *_clock, struct tm *_result );
 
 
+/**
+ * @brief copy extended attributes of a file or a folder
+ * @return 0 on success; otherwise, return -1 and set errno
+ */
+int tr_copyXattr( const char* srcpath, const char* dstpath ) TR_GNUC_NONNULL(1,2);
+
 /**
  * @brief move a file
  * @return 0 on success; otherwise, return -1 and set errno
index db8d5b1af39d421408a2d5c9b5d8b10f19082747..f61df8393abbc7d13a1b8fed54ac7555a53dbc78 100755 (executable)
Binary files a/macosx/Growl.framework/Versions/A/Growl and b/macosx/Growl.framework/Versions/A/Growl differ
index d74182dc5a53295e86a5f22f6979df01240b4fca..36397576232c952d395745747e799a71f5297f3b 100644 (file)
  *
  *     @param inDelegate The delegate for the GrowlApplicationBridge. It must conform to the GrowlApplicationBridgeDelegate protocol.
  */
-+ (void) setGrowlDelegate:(NSObject<GrowlApplicationBridgeDelegate> *)inDelegate;
++ (void) setGrowlDelegate:(id<GrowlApplicationBridgeDelegate>)inDelegate;
 
 /*!
  *     @method growlDelegate
  *     @discussion See setGrowlDelegate: for details.
  *     @result The Growl delegate.
  */
-+ (NSObject<GrowlApplicationBridgeDelegate> *) growlDelegate;
++ (id<GrowlApplicationBridgeDelegate>) growlDelegate;
 
 #pragma mark -
 
  *      Growl when next it is ready; <code>NO</code> if not.
  */
 + (void) setWillRegisterWhenGrowlIsReady:(BOOL)flag;
+
 /*!    @method willRegisterWhenGrowlIsReady
  *     @abstract       Reports whether GrowlApplicationBridge will register with Growl
  *      when Growl next launches.
  *      copy of <code>regDict</code>.
  */
 + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
+
 /*!    @method registrationDictionaryByFillingInDictionary:restrictToKeys:
  *     @abstract       Tries to fill in missing keys in a registration dictionary.
  *     @discussion     This method examines the passed-in dictionary for missing keys,
 + (NSDictionary *) notificationDictionaryByFillingInDictionary:(NSDictionary *)regDict;
 
 + (NSDictionary *) frameworkInfoDictionary;
-@end
 
-//------------------------------------------------------------------------------
 #pragma mark -
 
 /*!
- *     @protocol GrowlApplicationBridgeDelegate
- *     @abstract Required protocol for the Growl delegate.
- *     @discussion The methods in this protocol are required and are called
- *      automatically as needed by GrowlApplicationBridge. See
- *      <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
- *      See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
+ *@method growlURLSchemeAvailable
+ *@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
+ *@return Returns whether growl:// is registered on the system
+ *@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
+ * Further, this method can provide a check on whether Growl is installed, 
+ * however, the framework will not be relying on this method for choosing when/how to notify, 
+ * and it is not recommended that the app rely on it for other than whether to use growl:// methods
+ *@since Growl.framework 1.4
  */
++ (BOOL) isGrowlURLSchemeAvailable;
 
-@protocol GrowlApplicationBridgeDelegate
-
-// -registrationDictionaryForGrowl has moved to the informal protocol as of 0.7.
+/*!
+ * @method openGrowlPreferences:
+ * @abstract Open Growl preferences, optionally to this app's settings, growl:// method
+ * @param showApp Whether to show the application's settings, otherwise just opens to the last position
+ * @return Return's whether opening the URL was succesfull or not.  
+ * @discussion Will launch if Growl is installed, but not running, and open the preferences window
+ * Uses growl:// URL scheme
+ * @since Growl.framework 1.4
+ */
++ (BOOL) openGrowlPreferences:(BOOL)showApp;
 
 @end
 
 #pragma mark -
 
 /*!
- *     @category NSObject(GrowlApplicationBridgeDelegate_InformalProtocol)
- *     @abstract Methods which may be optionally implemented by the GrowlDelegate.
- *     @discussion The methods in this informal protocol will only be called if implemented by the delegate.
+ *     @protocol GrowlApplicationBridgeDelegate
+ *     @abstract Required protocol for the Growl delegate.
+ *     @discussion The methods in this protocol are optional and are called
+ *      automatically as needed by GrowlApplicationBridge. See
+ *      <code>+[GrowlApplicationBridge setGrowlDelegate:]</code>.
+ *      See also <code>GrowlApplicationBridgeDelegate_InformalProtocol</code>.
  */
-@interface NSObject (GrowlApplicationBridgeDelegate_InformalProtocol)
+
+@protocol GrowlApplicationBridgeDelegate <NSObject>
+
+@optional
 
 /*!
  *     @method registrationDictionaryForGrowl
index 51ef630d207d6a42ddaeff8e70b2f17a30a84e28..0a196f1e37422c126ce57e96742a1dd42a3a330c 100644 (file)
 *  This key is optional.
 */
 #define GROWL_NOTIFICATIONS_DESCRIPTIONS               XSTR("NotificationDescriptions")
+/*! @defined GROWL_NOTIFICATIONS_ICONS
+ *  @abstract A dictionary of icons for each notification
+ *  @discussion This is an NSDictionary whose keys are GROWL_NOTIFICATION_NAME strings and whose objects are
+ *  icons for each notification, for GNTP spec
+ *
+ *  This key is optional.
+ */
+#define GROWL_NOTIFICATIONS_ICONS XSTR("NotificationIcons")
 
 /*!    @defined        GROWL_TICKET_VERSION
  *     @abstract       The version of your registration ticket.
 */
 #define GROWL_NOTIFICATION_PROGRESS            XSTR("NotificationProgress")
 
+/*!    @defined GROWL_NOTIFICATION_ALREADY_SHOWN
+ *     @abstract If this key is set, it should contain a bool value wrapped
+ *   in a NSNumber which describes whether the notification has
+ *   already been displayed, for instance by built in Notification
+ *   Center support.  This value can be used to allow display
+ *   plugins to skip a notification, while still allowing Growl
+ *   actions to run on them.
+ *
+ *      Optional. Not supported by all display plugins.
+ */
+#define GROWL_NOTIFICATION_ALREADY_SHOWN               XSTR("AlreadyShown")
+
+
 // Notifications
 #pragma mark Notifications
 
  */
 #define GROWL_DISTRIBUTED_NOTIFICATION_TIMED_OUT_SUFFIX                XSTR("GrowlTimedOut!")
 
+/*!    @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON
+ *     @abstract The distributed notification sent when the Notification Center support is toggled on in Growl 2.0
+ *     @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
+ *      to inform all running apps that they should now speak to Notification Center directly.
+ */
+#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_ON           XSTR("GrowlNotificationCenterOn!")
+
+/*!    @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF
+ *     @abstract The distributed notification sent when the Notification Center support is toggled off in Growl 2.0
+ *     @discussion When the user enables Notification Center support in Growl 2.0, this notification is sent
+ *      to inform all running apps that they should no longer speak to Notification Center directly.
+ */
+#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_OFF          XSTR("GrowlNotificationCenterOff!")
+
+/*!    @defined GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY
+ *     @abstract The distributed notification sent by an application to query Growl 2.0's notification center support.
+ *     @discussion When an app starts up, it will send this query to get Growl 2.0 to spit out whether notification
+ *      center support is on or off.
+ */
+#define GROWL_DISTRIBUTED_NOTIFICATION_NOTIFICATIONCENTER_QUERY                XSTR("GrowlNotificationCenterYN?")
+
+
 /*!    @group Other symbols */
 /* Symbols which don't fit into any of the other categories. */
 
 
 #define GROWL_POSITION_PREFERENCE_KEY                  @"GrowlSelectedPosition"
 
+#define GROWL_PLUGIN_CONFIG_ID XSTR("GrowlPluginConfigurationID")
+
 #endif //ndef _GROWLDEFINES_H
index 5f2a1f46d3a1968bdf31132514c5da03b6f91dae..4d9bd5f7aff520c640704d19577ce2b368e79c95 100644 (file)
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
        <key>BuildMachineOSBuild</key>
-       <string>11C74</string>
+       <string>12A269</string>
        <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
        <key>CFBundleExecutable</key>
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
-       <string>1.3.1</string>
+       <string>2.0</string>
        <key>CFBundleSignature</key>
        <string>GRRR</string>
        <key>CFBundleVersion</key>
-       <string>1.3.1</string>
+       <string>2.0</string>
        <key>DTCompiler</key>
        <string>com.apple.compilers.llvm.clang.1_0</string>
        <key>DTPlatformBuild</key>
-       <string>4D199</string>
+       <string>4F250</string>
        <key>DTPlatformVersion</key>
        <string>GM</string>
        <key>DTSDKBuild</key>
-       <string>11C63</string>
+       <string>12A264</string>
        <key>DTSDKName</key>
-       <string>macosx10.7</string>
+       <string>macosx10.8</string>
        <key>DTXcode</key>
-       <string>0420</string>
+       <string>0440</string>
        <key>DTXcodeBuild</key>
-       <string>4D199</string>
+       <string>4F250</string>
        <key>NSPrincipalClass</key>
        <string>GrowlApplicationBridge</string>
 </dict>
index d654425520ac5fb9de27465243a7990323cfd6de..d4a95e252b07fa53fb5526be23a846094b241737 100644 (file)
@@ -6,7 +6,7 @@
        <dict>
                <key>Resources/Info.plist</key>
                <data>
-               SwzGt9RQsuVafBBrfBalB75dCwU=
+               lnx8exuPwE/bsUq32R5DXDQholc=
                </data>
        </dict>
        <key>rules</key>
index ab35ded6567a1b013dbbc03418270c2d67cd1ff2..9d288f0b5abf598d930f8a043d24115fa3c4a01f 100644 (file)
     
     NSTableColumn * column = [tableView tableColumnWithIdentifier: @"Message"];
     const CGFloat count = floorf([message sizeWithAttributes: fAttributes].width / [column width]);
-    return [tableView rowHeight] * (count + 1.0);
+    
+    const CGFloat oldHeight = [tableView rowHeight] * (count + 1.0);
+    NSLog(@"oldHeight: %f", oldHeight);
+    
+    NSAttributedString * attributedMessage = [[NSAttributedString alloc] initWithString: message attributes: fAttributes];
+    CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)attributedMessage);
+    [attributedMessage release];
+    
+    const CGSize size = CTFramesetterSuggestFrameSizeWithConstraints(framesetter, CFRangeMake(0, 0), NULL, CGSizeMake([column width], CGFLOAT_MAX), NULL);
+    CFRelease(framesetter);
+    
+    NSLog(@"new %@", NSStringFromSize(size));
+    //NSLog(@"%@", fAttributes);
+    
+    CGFloat newHeight = size.height;
+    
+    //not sure why this is needed
+    const CGFloat numRows = newHeight / 13.0;
+    newHeight += numRows * 1.0;
+    
+    return newHeight;
 }
 
 - (void) tableView: (NSTableView *) tableView sortDescriptorsDidChange: (NSArray *) oldDescriptors
index 96585ad1f33ba0c2611de7c231d81309a8c53134..c1c68b2a23293305f3e139607a34dffc82300a76 100644 (file)
@@ -20,6 +20,7 @@ NSString * generateIconData(NSString * fileExtension, NSUInteger width, NSMutabl
         [renderedIcon unlockFocus];
         
         NSData * iconData = [renderedIcon TIFFRepresentation];
+        [renderedIcon release];
         
         NSDictionary * imgProps = @{
             (NSString *)kQLPreviewPropertyMIMETypeKey : @"image/png",
@@ -42,7 +43,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
     //try to parse the torrent file
     tr_info inf;
     tr_ctor * ctor = tr_ctorNew(NULL);
-    tr_ctorSetMetainfoFromFile(ctor, [[(__bridge NSURL *)url path] UTF8String]);
+    tr_ctorSetMetainfoFromFile(ctor, [[(NSURL *)url path] UTF8String]);
     const int err = tr_torrentParse(ctor, &inf);
     tr_ctorFree(ctor);
     if (err)
@@ -168,7 +169,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
                                 (NSString *)kQLPreviewPropertyMIMETypeKey : @"text/html",
                                 (NSString *)kQLPreviewPropertyAttachmentsKey : allImgProps };
     
-    QLPreviewRequestSetDataRepresentation(preview, (__bridge CFDataRef)[htmlString dataUsingEncoding: NSUTF8StringEncoding], kUTTypeHTML, (__bridge CFDictionaryRef)props);
+    QLPreviewRequestSetDataRepresentation(preview, (CFDataRef)[htmlString dataUsingEncoding: NSUTF8StringEncoding], kUTTypeHTML, (CFDictionaryRef)props);
     
     return noErr;
 }
index 3f264d4293ba53e8f7bcb485ed8bb5875073ca30..aafdb99889ef60904c2949fd56a732ba487ab0b1 100644 (file)
@@ -92,6 +92,7 @@
     NSRect gridRects[active ? 2 : 3];
     NSColor * colorRects[active ? 2 : 3];
     
+    //bottom line
     NSRect lineBorderRect = NSMakeRect(NSMinX(rect), 0.0, NSWidth(rect), 1.0);
     NSRect intersectLineBorderRect = NSIntersectionRect(lineBorderRect, rect);
     if (!NSIsEmptyRect(intersectLineBorderRect))
         rect.size.height -= intersectLineBorderRect.size.height;
     }
     
+    
+    //top line
     if (active)
     {
         lineBorderRect.origin.y = NSHeight([self bounds]) - 1.0;