Changeset 357


Ignore:
Timestamp:
Jun 14, 2006, 8:08:51 PM (16 years ago)
Author:
livings124
Message:

Get rid of unnecessary class by merging ellipsis code into StringAdditions?.

Location:
trunk/macosx
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r355 r357  
    3030#import "TorrentTableView.h"
    3131#import "StringAdditions.h"
    32 #import "Utils.h"
    3332
    3433#import <Sparkle/Sparkle.h>
     
    12731272   
    12741273        //append or remove ellipsis when needed
    1275         NSString * title = [menuItem title];
     1274        NSString * title = [menuItem title], * ellipsis = [NSString ellipsis];
    12761275        if (active && [fDefaults boolForKey: @"CheckRemove"])
    12771276        {
    1278             if (![title hasSuffix: NS_ELLIPSIS])
    1279                 [menuItem setTitle: [title stringByAppendingString: NS_ELLIPSIS]];
     1277            if (![title hasSuffix: ellipsis])
     1278                [menuItem setTitle: [title stringByAppendingEllipsis]];
    12801279        }
    12811280        else
    12821281        {
    1283             if ([title hasSuffix: NS_ELLIPSIS])
     1282            if ([title hasSuffix: ellipsis])
    12841283                [menuItem setTitle: [title substringToIndex:
    1285                             [title rangeOfString: NS_ELLIPSIS].location]];
     1284                            [title rangeOfString: ellipsis].location]];
    12861285        }
    12871286        return canUseMenu && [fTableView numberOfSelectedRows] > 0;
  • trunk/macosx/PrefsController.m

    r356 r357  
    2525#import "PrefsController.h"
    2626#import "StringAdditions.h"
    27 #import "Utils.h"
    2827
    2928#define MIN_PORT            1
     
    473472    [panel setCanChooseDirectories:          YES];
    474473
    475     [panel beginSheetForDirectory: NULL file: NULL types: NULL
     474    [panel beginSheetForDirectory: nil file: nil types: nil
    476475        modalForWindow: [self window] modalDelegate: self didEndSelector:
    477476        @selector( folderSheetClosed:returnCode:contextInfo: )
    478         contextInfo: NULL];
     477        contextInfo: nil];
    479478}
    480479
  • trunk/macosx/StringAdditions.h

    r272 r357  
    2727@interface NSString (StringAdditions)
    2828
     29+ (NSString *) ellipsis;
     30- (NSString *) stringByAppendingEllipsis;
     31
    2932+ (NSString *) stringWithInt: (int) value;
    3033
  • trunk/macosx/StringAdditions.m

    r272 r357  
    2424
    2525#import "StringAdditions.h"
    26 #import "Utils.h"
    2726
    2827@implementation NSString (StringAdditions)
     28
     29+ (NSString *) ellipsis
     30{
     31        return [NSString stringWithUTF8String: "\xE2\x80\xA6"];
     32}
     33
     34- (NSString *) stringByAppendingEllipsis
     35{
     36        return [self stringByAppendingString: [NSString ellipsis]];
     37}
    2938
    3039+ (NSString *) stringWithInt: (int) value
     
    115124        return [[[NSAttributedString alloc] initWithString: self attributes: attributes] autorelease];
    116125   
    117     float ellipsisWidth = [NS_ELLIPSIS sizeWithAttributes: attributes].width;
     126    float ellipsisWidth = [[NSString ellipsis] sizeWithAttributes: attributes].width;
    118127   
    119128    /* Width is too small */
     
    151160    else;
    152161
    153     return [[[NSAttributedString alloc] initWithString: [newString stringByAppendingString: NS_ELLIPSIS]
     162    return [[[NSAttributedString alloc] initWithString: [newString stringByAppendingEllipsis]
    154163                                        attributes: attributes] autorelease];
    155164}
  • trunk/macosx/Torrent.m

    r354 r357  
    2525#import "Torrent.h"
    2626#import "StringAdditions.h"
    27 #import "Utils.h"
    2827
    2928@interface Torrent (Private)
     
    168167
    169168        case TR_STATUS_CHECK:
    170             [fStatusString setString: [@"Checking existing files" stringByAppendingString: NS_ELLIPSIS]];
     169            [fStatusString setString: [@"Checking existing files" stringByAppendingEllipsis]];
    171170            break;
    172171
     
    203202
    204203        case TR_STATUS_STOPPING:
    205             [fStatusString setString: [@"Stopping" stringByAppendingString: NS_ELLIPSIS]];
     204            [fStatusString setString: [@"Stopping" stringByAppendingEllipsis]];
    206205            break;
    207206    }
     
    365364
    366365        case TR_STATUS_CHECK:
    367             return [@"Checking existing files" stringByAppendingString: NS_ELLIPSIS];
     366            return [@"Checking existing files" stringByAppendingEllipsis];
    368367            break;
    369368
     
    377376
    378377        case TR_STATUS_STOPPING:
    379             return [@"Stopping" stringByAppendingString: NS_ELLIPSIS];
     378            return [@"Stopping" stringByAppendingEllipsis];
    380379            break;
    381380       
Note: See TracChangeset for help on using the changeset viewer.