From 5c00a9476a51623b0a82fb99e6c2bd4cbbd0db75 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 1 Aug 2007 12:52:33 -0700 Subject: [PATCH] * Source/DebuggerConnection: Adding getters for _host, _port, and _session ([DebuggerConnection host]): New method ([DebuggerConnection port]): ditto ([DebuggerConnection session]): ditto * Source/DebuggerWindowController.m: ([DebuggerWindowController initWithConnection:]): Set the window title when we load --- Source/DebuggerConnection.h | 6 ++++++ Source/DebuggerConnection.m | 24 ++++++++++++++++++++++++ Source/DebuggerWindowController.m | 1 + 3 files changed, 31 insertions(+) diff --git a/Source/DebuggerConnection.h b/Source/DebuggerConnection.h index d610007..ec6f0e4 100644 --- a/Source/DebuggerConnection.h +++ b/Source/DebuggerConnection.h @@ -26,6 +26,12 @@ DebuggerWindowController *_windowController; } +// initializer - (id)initWithHost: (NSString *)host port: (int)port session: (NSString *)session; +// getter +- (NSString *)host; +- (int)port; +- (NSString *)session; + @end diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index acbd7cb..4eb9321 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -48,4 +48,28 @@ [super dealloc]; } +/** + * Gets the hostname + */ +- (NSString *)host +{ + return _host; +} + +/** + * Gets the port number + */ +- (int)port +{ + return _port; +} + +/** + * Gets the session name + */ +- (NSString *)session +{ + return _session; +} + @end diff --git a/Source/DebuggerWindowController.m b/Source/DebuggerWindowController.m index 5848e7c..4c45336 100644 --- a/Source/DebuggerWindowController.m +++ b/Source/DebuggerWindowController.m @@ -27,6 +27,7 @@ if (self = [super initWithWindowNibName: @"Debugger"]) { _connection = [cnx retain]; + [[self window] setTitle: [NSString stringWithFormat: @"GDBp @ %@:%d/%@", [_connection host], [_connection port], [_connection session]]]; } return self; } -- 2.22.5