Changeset 13485


Ignore:
Timestamp:
Sep 9, 2012, 5:33:55 AM (9 years ago)
Author:
livings124
Message:

#5036 always use "Transmission" instead of "Transmission Web Interface" for consistency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BonjourController.m

    r13484 r13485  
    5050    [self stop];
    5151   
    52     //Attempt full length service name
    53     #warning localize?
    54     NSString * mainName = @"Transmission Web Interface";
    55     NSString * details = [NSString stringWithFormat: @"%@ - %@", NSUserName(), [[NSHost currentHost] localizedName]];
    56     NSString * serviceName = [NSString stringWithFormat: @"%@ (%@)", mainName, details];
    57    
    58     if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH) {
    59         //Remove Web Interface to shorten name
    60         mainName = @"Transmission";
    61         serviceName = [NSString stringWithFormat: @"%@ (%@)", mainName, details];
    62        
    63         if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH) {
    64             //Last resort is to truncate the user name and computer name
    65             serviceName = [serviceName substringToIndex: BONJOUR_SERVICE_NAME_MAX_LENGTH];
    66         }
    67     }
     52    NSMutableString * serviceName = [NSMutableString stringWithFormat: @"Transmission (%@ - %@)", NSUserName(), [[NSHost currentHost] localizedName]];
     53    if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH)
     54        [serviceName deleteCharactersInRange: NSMakeRange(BONJOUR_SERVICE_NAME_MAX_LENGTH, [serviceName length] - BONJOUR_SERVICE_NAME_MAX_LENGTH)];
    6855   
    6956    fService = [[NSNetService alloc] initWithDomain: @"" type: @"_http._tcp." name: serviceName port: port];
Note: See TracChangeset for help on using the changeset viewer.