#5036 always use "Transmission" instead of "Transmission Web Interface" for consistency
This commit is contained in:
parent
610a8ee0fb
commit
72435a2f40
|
@ -49,22 +49,9 @@ BonjourController * fDefaultController = nil;
|
|||
{
|
||||
[self stop];
|
||||
|
||||
//Attempt full length service name
|
||||
#warning localize?
|
||||
NSString * mainName = @"Transmission Web Interface";
|
||||
NSString * details = [NSString stringWithFormat: @"%@ - %@", NSUserName(), [[NSHost currentHost] localizedName]];
|
||||
NSString * serviceName = [NSString stringWithFormat: @"%@ (%@)", mainName, details];
|
||||
|
||||
if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH) {
|
||||
//Remove Web Interface to shorten name
|
||||
mainName = @"Transmission";
|
||||
serviceName = [NSString stringWithFormat: @"%@ (%@)", mainName, details];
|
||||
|
||||
if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH) {
|
||||
//Last resort is to truncate the user name and computer name
|
||||
serviceName = [serviceName substringToIndex: BONJOUR_SERVICE_NAME_MAX_LENGTH];
|
||||
}
|
||||
}
|
||||
NSMutableString * serviceName = [NSMutableString stringWithFormat: @"Transmission (%@ - %@)", NSUserName(), [[NSHost currentHost] localizedName]];
|
||||
if ([serviceName length] > BONJOUR_SERVICE_NAME_MAX_LENGTH)
|
||||
[serviceName deleteCharactersInRange: NSMakeRange(BONJOUR_SERVICE_NAME_MAX_LENGTH, [serviceName length] - BONJOUR_SERVICE_NAME_MAX_LENGTH)];
|
||||
|
||||
fService = [[NSNetService alloc] initWithDomain: @"" type: @"_http._tcp." name: serviceName port: port];
|
||||
[fService setDelegate: self];
|
||||
|
|
Loading…
Reference in New Issue