Changeset 7005


Ignore:
Timestamp:
Nov 1, 2008, 2:26:51 PM (12 years ago)
Author:
livings124
Message:

trivial code changes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r6995 r7005  
    774774                D4AF3B2D0C41F7A500D46B6B /* list.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = list.c; path = libtransmission/list.c; sourceTree = "<group>"; };
    775775                D4AF3B2E0C41F7A500D46B6B /* list.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = list.h; path = libtransmission/list.h; sourceTree = "<group>"; };
    776                 E138A9730C04D88F00C5426C /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CTGradient.h; sourceTree = "<group>"; };
    777                 E138A9740C04D88F00C5426C /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CTGradient.m; sourceTree = "<group>"; };
    778                 E138A9750C04D88F00C5426C /* ProgressGradients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ProgressGradients.h; path = ../ProgressGradients.h; sourceTree = "<group>"; };
    779                 E138A9760C04D88F00C5426C /* ProgressGradients.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ProgressGradients.m; path = ../ProgressGradients.m; sourceTree = "<group>"; };
     776                E138A9730C04D88F00C5426C /* CTGradient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CTGradient.h; path = macosx/CTGradient/CTGradient.h; sourceTree = "<group>"; };
     777                E138A9740C04D88F00C5426C /* CTGradient.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CTGradient.m; path = macosx/CTGradient/CTGradient.m; sourceTree = "<group>"; };
     778                E138A9750C04D88F00C5426C /* ProgressGradients.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ProgressGradients.h; path = macosx/ProgressGradients.h; sourceTree = "<group>"; };
     779                E138A9760C04D88F00C5426C /* ProgressGradients.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ProgressGradients.m; path = macosx/ProgressGradients.m; sourceTree = "<group>"; };
    780780/* End PBXFileReference section */
    781781
     
    915915                                E1B6FBFD0C0D72430015FE4D /* Prefs Window */,
    916916                                E1B6FC000C0D72A00015FE4D /* Overlay Window */,
    917                                 E138A9720C04D88F00C5426C /* CTGradient */,
    918917                                E1B6FBEB0C0D70AC0015FE4D /* UKKQueue */,
     918                                E138A9730C04D88F00C5426C /* CTGradient.h */,
     919                                E138A9740C04D88F00C5426C /* CTGradient.m */,
     920                                E138A9750C04D88F00C5426C /* ProgressGradients.h */,
     921                                E138A9760C04D88F00C5426C /* ProgressGradients.m */,
    919922                                A21282A50CA6C66800EAEE0F /* StatusBarView.h */,
    920923                                A21282A60CA6C66800EAEE0F /* StatusBarView.m */,
     
    13081311                        );
    13091312                        name = daemon;
    1310                         sourceTree = "<group>";
    1311                 };
    1312                 E138A9720C04D88F00C5426C /* CTGradient */ = {
    1313                         isa = PBXGroup;
    1314                         children = (
    1315                                 E138A9730C04D88F00C5426C /* CTGradient.h */,
    1316                                 E138A9740C04D88F00C5426C /* CTGradient.m */,
    1317                                 E138A9750C04D88F00C5426C /* ProgressGradients.h */,
    1318                                 E138A9760C04D88F00C5426C /* ProgressGradients.m */,
    1319                         );
    1320                         name = CTGradient;
    1321                         path = macosx/CTGradient;
    13221313                        sourceTree = "<group>";
    13231314                };
  • trunk/macosx/FileNameCell.m

    r6885 r7005  
    3030#import "NSStringAdditions.h"
    3131
    32 #define PADDING_HORIZONAL 2.0
    33 #define IMAGE_FOLDER_SIZE 16.0
    34 #define IMAGE_ICON_SIZE 32.0
    35 #define PADDING_BETWEEN_IMAGE_AND_TITLE 4.0
    36 #define PADDING_ABOVE_TITLE_FILE 2.0
    37 #define PADDING_BELOW_STATUS_FILE 2.0
    38 #define PADDING_BETWEEN_NAME_AND_FOLDER_STATUS 4.0
     32#define PADDING_HORIZONAL 2.0f
     33#define IMAGE_FOLDER_SIZE 16.0f
     34#define IMAGE_ICON_SIZE 32.0f
     35#define PADDING_BETWEEN_IMAGE_AND_TITLE 4.0f
     36#define PADDING_ABOVE_TITLE_FILE 2.0f
     37#define PADDING_BELOW_STATUS_FILE 2.0f
     38#define PADDING_BETWEEN_NAME_AND_FOLDER_STATUS 4.0f
    3939
    4040@interface FileNameCell (Private)
     
    5858       
    5959        fTitleAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
    60                             [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
     60                            [NSFont messageFontOfSize: 12.0f], NSFontAttributeName,
    6161                            paragraphStyle, NSParagraphStyleAttributeName, nil];
    6262       
    6363        fStatusAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
    64                                 [NSFont messageFontOfSize: 9.0], NSFontAttributeName,
     64                                [NSFont messageFontOfSize: 9.0f], NSFontAttributeName,
    6565                                paragraphStyle, NSParagraphStyleAttributeName, nil];
    6666       
     
    117117    result.origin.x += PADDING_HORIZONAL;
    118118   
    119     const float IMAGE_SIZE = [(FileListNode *)[self objectValue] isFolder] ? IMAGE_FOLDER_SIZE : IMAGE_ICON_SIZE;
    120     result.origin.y += (result.size.height - IMAGE_SIZE) * 0.5;
     119    const CGFloat IMAGE_SIZE = [(FileListNode *)[self objectValue] isFolder] ? IMAGE_FOLDER_SIZE : IMAGE_ICON_SIZE;
     120    result.origin.y += (result.size.height - IMAGE_SIZE) * 0.5f;
    121121    result.size = NSMakeSize(IMAGE_SIZE, IMAGE_SIZE);
    122122   
     
    178178    {
    179179        result.origin.x += PADDING_HORIZONAL + IMAGE_FOLDER_SIZE + PADDING_BETWEEN_IMAGE_AND_TITLE;
    180         result.origin.y += (result.size.height - titleSize.height) * 0.5;
     180        result.origin.y += (result.size.height - titleSize.height) * 0.5f;
    181181    }
    182182    result.size = titleSize;
     
    201201    {
    202202        result.origin.x = NSMaxX(titleRect) + PADDING_BETWEEN_NAME_AND_FOLDER_STATUS;
    203         result.origin.y = NSMaxY(titleRect) - statusSize.height - 1.0;
     203        result.origin.y = NSMaxY(titleRect) - statusSize.height - 1.0f;
    204204    }
    205205       
     
    228228   
    229229    NSString * percentString;
    230     float progress = [torrent fileProgress: node];
    231     percentString = progress == 1.0 ? @"100%" : [NSString localizedStringWithFormat: @"%.2f%%", progress * 100.0];
     230    CGFloat progress = [torrent fileProgress: node];
     231    percentString = progress == 1.0f ? @"100%" : [NSString localizedStringWithFormat: @"%.2f%%", progress * 100.0f];
    232232   
    233233   
  • trunk/macosx/FileOutlineController.m

    r6888 r7005  
    3131#import "NSApplicationAdditions.h"
    3232
    33 #define ROW_SMALL_HEIGHT 18.0
     33#define ROW_SMALL_HEIGHT 18.0f
    3434
    3535typedef enum
     
    9898}
    9999
    100 - (int) outlineView: (NSOutlineView *) outlineView numberOfChildrenOfItem: (id) item
     100- (NSInteger) outlineView: (NSOutlineView *) outlineView numberOfChildrenOfItem: (id) item
    101101{
    102102    if (!item)
     
    114114}
    115115
    116 - (id) outlineView: (NSOutlineView *) outlineView child: (int) index ofItem: (id) item
     116- (id) outlineView: (NSOutlineView *) outlineView child: (NSInteger) index ofItem: (id) item
    117117{
    118118    return [(item ? [(FileListNode *)item children] : [fTorrent fileList]) objectAtIndex: index];
     
    137137        [cell setRepresentedObject: item];
    138138       
    139         int hoveredRow = [fOutline hoveredRow];
     139        NSInteger hoveredRow = [fOutline hoveredRow];
    140140        [(FilePriorityCell *)cell setHovered: hoveredRow != -1 && hoveredRow == [fOutline rowForItem: item]];
    141141    }
     
    212212}
    213213
    214 - (float) outlineView: (NSOutlineView *) outlineView heightOfRowByItem: (id) item
     214- (CGFloat) outlineView: (NSOutlineView *) outlineView heightOfRowByItem: (id) item
    215215{
    216216    if ([(FileListNode *)item isFolder])
     
    222222- (void) setCheck: (id) sender
    223223{
    224     int state = [sender tag] == FILE_UNCHECK_TAG ? NSOffState : NSOnState;
     224    NSInteger state = [sender tag] == FILE_UNCHECK_TAG ? NSOffState : NSOnState;
    225225   
    226226    NSIndexSet * indexSet = [fOutline selectedRowIndexes];
     
    251251- (void) setPriority: (id) sender
    252252{
    253     int priority;
     253    NSInteger priority;
    254254    switch ([sender tag])
    255255    {
  • trunk/macosx/TrackerTableView.m

    r6955 r7005  
    8181        }
    8282       
    83         float newY = NSMaxY([self rectOfRow: i-1]);
     83        CGFloat newY = NSMaxY([self rectOfRow: i-1]);
    8484        visibleRect.size.height -= newY - visibleRect.origin.y;
    8585        visibleRect.origin.y = newY;
     
    8787   
    8888    //remaining visible rows continue alternating
    89     float height = [self rowHeight] + [self intercellSpacing].height;
    90     int numberOfRects = ceil(visibleRect.size.height / height);
     89    CGFloat height = [self rowHeight] + [self intercellSpacing].height;
     90    NSInteger numberOfRects = ceil(visibleRect.size.height / height);
    9191    visibleRect.size.height = height;
    9292   
Note: See TracChangeset for help on using the changeset viewer.