]> git.babelmonkeys.de Git - jubjub.git/commitdiff
Prefix ivars with an underscore
authorFlorian Zeitz <florob@babelmonkeys.de>
Sat, 16 Feb 2013 12:47:28 +0000 (13:47 +0100)
committerFlorian Zeitz <florob@babelmonkeys.de>
Sat, 16 Feb 2013 12:47:28 +0000 (13:47 +0100)
src/core/JubChatClient.h
src/core/JubChatClient.m
src/core/JubConfig.h
src/core/JubConfig.m
src/core/main.m
src/gui/gtk/JubGtkChatUI.h
src/gui/gtk/JubGtkChatUI.m
src/gui/gtk/JubGtkRosterUI.h
src/gui/gtk/JubGtkRosterUI.m
src/gui/gtk/JubGtkUI.h
src/gui/gtk/JubGtkUI.m

index c6a1da8b6df16fbe0f433312e9573163e2f6d703..79884f8ff6916613e79ab30d07e0ef27dc47cbb3 100644 (file)
@@ -7,13 +7,13 @@
 
 @interface JubChatClient : OFObject <XMPPConnectionDelegate, XMPPRosterDelegate>
 {
-       OFMutableDictionary *chatMap;
-       XMPPConnection *connection;
-       XMPPRoster *roster;
-       XMPPStreamManagement *streamManagement;
-       XMPPContactManager *contactManager;
-       XMPPPresence *presence;
-       id<JubUI> ui;
+       OFMutableDictionary *_chatMap;
+       XMPPConnection *_connection;
+       XMPPRoster *_roster;
+       XMPPStreamManagement *_streamManagement;
+       XMPPContactManager *_contactManager;
+       XMPPPresence *_presence;
+       id<JubUI> _ui;
 }
 @property (readonly) XMPPConnection *connection;
 @property (readonly) XMPPRoster *roster;
index 3c563f5e9dd1a9f267b9b09ad63787a8be9de1ea..9acdf3935addec8aed8df165bcb5630eb0208893 100644 (file)
@@ -1,37 +1,37 @@
 #import "JubChatClient.h"
 
 @implementation JubChatClient
-@synthesize connection;
-@synthesize roster;
-@synthesize contactManager;
-@synthesize presence;
-@synthesize ui;
+@synthesize connection = _connection;
+@synthesize roster = _roster;
+@synthesize contactManager = _contactManager;
+@synthesize presence = _presence;
+@synthesize ui = _ui;
 
 - initWithConfig: (JubConfig*)config
 {
        self = [super init];
 
        @try {
-               chatMap = [[OFMutableDictionary alloc] init];
+               _chatMap = [[OFMutableDictionary alloc] init];
 
-               connection = [XMPPConnection new];
-               connection.username = config.username;
-               connection.domain = config.domain;
-               connection.server = config.server;
-               connection.password = config.password;
-               [connection addDelegate: self];
+               _connection = [XMPPConnection new];
+               _connection.username = config.username;
+               _connection.domain = config.domain;
+               _connection.server = config.server;
+               _connection.password = config.password;
+               [_connection addDelegate: self];
 
-               roster = [[XMPPRoster alloc] initWithConnection: connection];
-               [roster addDelegate: self];
+               _roster = [[XMPPRoster alloc] initWithConnection: _connection];
+               [_roster addDelegate: self];
 
-               contactManager = [[XMPPContactManager alloc]
-                                     initWithConnection: connection
-                                                 roster: roster];
+               _contactManager = [[XMPPContactManager alloc]
+                   initWithConnection: _connection
+                               roster: _roster];
 
-               streamManagement = [[XMPPStreamManagement alloc]
-                   initWithConnection: connection];
+               _streamManagement = [[XMPPStreamManagement alloc]
+                   initWithConnection: _connection];
 
-               [connection asyncConnectAndHandle];
+               [_connection asyncConnectAndHandle];
        } @catch (id e) {
                [self release];
                @throw e;
 
 - (void)dealloc
 {
-       [roster release];
-       [contactManager release];
-       [streamManagement release];
-       [connection release];
-       [presence release];
-       [chatMap release];
+       [_roster release];
+       [_contactManager release];
+       [_streamManagement release];
+       [_connection release];
+       [_presence release];
+       [_chatMap release];
 
        [super dealloc];
 }
        OFAutoreleasePool *pool = [OFAutoreleasePool new];
        OFString *bareJID = [contact.rosterItem.JID bareJID];
 
-       id<JubChatUI> chat = [chatMap objectForKey: bareJID];
+       id<JubChatUI> chat = [_chatMap objectForKey: bareJID];
        if (chat == nil) {
                OFString * title =
                    [@"Chat with " stringByAppendingString: bareJID];
 
-               chat = [[[[ui chatUIClass] alloc]
+               chat = [[[[_ui chatUIClass] alloc]
                    initWithTitle: title
                       closeBlock: ^{
-                               [chatMap removeObjectForKey: bareJID];
+                               [_chatMap removeObjectForKey: bareJID];
                        }
                        sendBlock: ^(OFString *text) {
                                XMPPMessage *msg =
                                    [XMPPMessage messageWithType: @"chat"];
                                msg.body = text;
                                [contact sendMessage: msg
-                                         connection: connection];
+                                         connection: _connection];
                        }
                ] autorelease];
 
-               [chatMap setObject: chat
-                           forKey: bareJID];
+               [_chatMap setObject: chat
+                            forKey: bareJID];
        }
 
        [pool release];
        return chat;
 }
 
-- (void)connection: (XMPPConnection*)connection_
+- (void)connection: (XMPPConnection*)connection
      wasBoundToJID: (XMPPJID*)jid
 {
        of_log(@"Bound to JID: %@", [jid fullJID]);
 
-       [roster requestRoster];
+       [_roster requestRoster];
 }
 
--   (void)connection: (XMPPConnection*)connection_
-  didReceivePresence: (XMPPPresence*)presence_
+-   (void)connection: (XMPPConnection*)connection
+  didReceivePresence: (XMPPPresence*)presence
 {
-       if ([presence_.from isEqual: connection.JID]) {
-               [ui          client: self
-                 didChangePresence: presence_];
-               OF_SETTER(presence, presence_, YES, 0);
+       if ([presence.from isEqual: connection.JID]) {
+               [_ui         client: self
+                 didChangePresence: presence];
+               OF_SETTER(_presence, presence, YES, 0);
        }
 }
 
 {
        XMPPPresence *pres = [XMPPPresence presence];
        [pres setStatus: @"Hello from JubJub"];
-       [connection sendStanza: pres];
+       [_connection sendStanza: pres];
 }
 @end
index 8e8e6ae86b2720812ffe2cbb35eacc7b476eaa2b..ab4b0bb187a005188b9652ae7c63a6522cae9065 100644 (file)
@@ -4,9 +4,9 @@
 
 @interface JubConfig : OFObject
 {
-       OFString *domain, *server;
-       OFString *username;
-       OFString *password;
+       OFString *_domain, *_server;
+       OFString *_username;
+       OFString *_password;
 }
 @property (readonly) OFString *domain, *server;
 @property (readonly) OFString *username;
index a3f11960ac064d6d5c9fdaf0e12511fa61575666..b8a5f5a3f3652d1ba489d45493c8ec261cc4ca3f 100644 (file)
@@ -1,9 +1,10 @@
 #import "JubConfig.h"
 
 @implementation JubConfig
-@synthesize domain, server;
-@synthesize username;
-@synthesize password;
+@synthesize domain = _domain;
+@synthesize server = _server;;
+@synthesize username = _username;
+@synthesize password = _password;
 
 - initWithFile: (OFString*)file
 {
 
                // TODO: Add error handling for missing elements
                of_log(@"Parsed file: %@", element);
-               domain = [[[element
+               _domain = [[[element
                    elementForName: @"domain"
                         namespace: CONFIG_NS] stringValue] copy];
-               server = [[[element
+               _server = [[[element
                    elementForName: @"server"
                         namespace: CONFIG_NS] stringValue] copy];
-               username = [[[element
+               _username = [[[element
                    elementForName: @"username"
                         namespace: CONFIG_NS] stringValue] copy];
-               password = [[[element
+               _password = [[[element
                    elementForName: @"password"
                         namespace: CONFIG_NS] stringValue] copy];
 
 
 - (void)dealloc
 {
-       [domain release];
-       [server release];
-       [username release];
-       [password release];
+       [_domain release];
+       [_server release];
+       [_username release];
+       [_password release];
 
        [super dealloc];
 }
index 229e6c5aa502fe2624725beaaa08d9709d14d24a..459a15c9a898f0ab126b50aad6a81019a97e8a46 100644 (file)
@@ -7,8 +7,8 @@
 
 @interface AppDelegate: OFObject <OFApplicationDelegate, XMPPConnectionDelegate>
 {
-       JubChatClient *client;
-       id<JubUI> ui;
+       JubChatClient *_client;
+       id<JubUI> _ui;
 }
 @end
 
@@ -20,29 +20,29 @@ OF_APPLICATION_DELEGATE(AppDelegate)
        JubConfig *config = [[[JubConfig alloc] initWithFile: @"config.xml"]
            autorelease];
 
-       client = [[JubChatClient alloc] initWithConfig: config];
+       _client = [[JubChatClient alloc] initWithConfig: config];
 
-       ui = [[JubGtkUI alloc] initWithClient: client];
+       _ui = [[JubGtkUI alloc] initWithClient: _client];
 
-       client.ui = ui;
-       [client.connection addDelegate: self];
+       _client.ui = _ui;
+       [_client.connection addDelegate: self];
 
-       [ui startUIThread];
+       [_ui startUIThread];
 }
 
--  (void)connection: (XMPPConnection*)conn
+-  (void)connection: (XMPPConnection*)connection
   didReceiveElement: (OFXMLElement*)element
 {
        of_log(@"In:  %@", element);
 }
 
-- (void)connection: (XMPPConnection*)conn
+- (void)connection: (XMPPConnection*)connection
     didSendElement: (OFXMLElement*)element
 {
        of_log(@"Out: %@", element);
 }
 
--  (void)connection: (XMPPConnection*)connection_
+-  (void)connection: (XMPPConnection*)connection
   didThrowException: (id)e
 {
        @throw e;
index 37e47ff8066df99186307fdd05258c6760185298..4694d3f34a83d479031ee282545a37b056a67fcf 100644 (file)
@@ -6,11 +6,11 @@
 
 @interface JubGtkChatUI: OFObject <JubChatUI>
 {
-       GtkWidget *chat_window;
-       GtkTextView *chat_view;
-       GtkTextBuffer *chat_buffer;
-       jub_send_block_t sendBlock;
-       jub_close_block_t closeBlock;
-       BOOL bufferEmpty;
+       GtkWidget *_chat_window;
+       GtkTextView *_chat_view;
+       GtkTextBuffer *_chat_buffer;
+       jub_send_block_t _sendBlock;
+       jub_close_block_t _closeBlock;
+       BOOL _bufferEmpty;
 }
 @end
index 7db4aef354823a39363865817a87176096c40c47..975a08d21b8252360930ad8b7582acee1fa4e659 100644 (file)
@@ -36,19 +36,19 @@ static void call_close_block(GtkWidget *object, gpointer data)
 
 @implementation JubGtkChatUI
 - initWithTitle: (OFString*)title
-     closeBlock: (jub_close_block_t)closeBlock_
-      sendBlock: (jub_send_block_t)sendBlock_
+     closeBlock: (jub_close_block_t)closeBlock
+      sendBlock: (jub_send_block_t)sendBlock
 {
        self = [super init];
 
        @try {
                __block volatile BOOL initialized = NO;
-               __block GtkWidget *chat_window_;
-               __block GtkTextBuffer *chat_buffer_;
+               __block GtkWidget *chat_window;
+               __block GtkTextBuffer *chat_buffer;
 
-               closeBlock = [closeBlock_ copy];
-               sendBlock = [sendBlock_ copy];
-               bufferEmpty = YES;
+               _closeBlock = [closeBlock copy];
+               _sendBlock = [sendBlock copy];
+               _bufferEmpty = YES;
 
                g_idle_add_block(^{
                        GtkEntry *chat_entry;
@@ -57,15 +57,15 @@ static void call_close_block(GtkWidget *object, gpointer data)
                        gtk_builder_add_from_file(builder, "data/gtk/chat.ui",
                            NULL);
 
-                       chat_window_ = GTK_WIDGET(
+                       chat_window = GTK_WIDGET(
                            gtk_builder_get_object(builder, "ChatWindow"));
-                       g_signal_connect(chat_window_, "destroy",
+                       g_signal_connect(chat_window, "destroy",
                            G_CALLBACK(call_close_block), closeBlock);
 
-                       chat_view = GTK_TEXT_VIEW(
+                       _chat_view = GTK_TEXT_VIEW(
                            gtk_builder_get_object(builder, "ChatTextView"));
-                       chat_buffer_ = gtk_text_view_get_buffer(chat_view);
-                       gtk_text_buffer_create_tag(chat_buffer_, "bold",
+                       chat_buffer = gtk_text_view_get_buffer(_chat_view);
+                       gtk_text_buffer_create_tag(chat_buffer, "bold",
                            "weight", PANGO_WEIGHT_BOLD, NULL);
 
                        chat_entry = GTK_ENTRY(
@@ -77,9 +77,9 @@ static void call_close_block(GtkWidget *object, gpointer data)
                        g_signal_connect(chat_entry, "key_release_event",
                            G_CALLBACK(call_send_block), send_params);
 
-                       gtk_window_set_title(GTK_WINDOW(chat_window_),
+                       gtk_window_set_title(GTK_WINDOW(chat_window),
                            [title UTF8String]);
-                       gtk_widget_show(chat_window_);
+                       gtk_widget_show(chat_window);
 
                        initialized = YES;
 
@@ -88,8 +88,8 @@ static void call_close_block(GtkWidget *object, gpointer data)
 
                while (!initialized);
 
-               chat_buffer = chat_buffer_;
-               chat_window = chat_window_;
+               _chat_buffer = chat_buffer;
+               _chat_window = chat_window;
        } @catch (id e) {
                [self release];
                @throw e;
@@ -100,9 +100,9 @@ static void call_close_block(GtkWidget *object, gpointer data)
 
 - (void)dealloc
 {
-       gtk_widget_destroy(chat_window);
-       [sendBlock release];
-       [closeBlock release];
+       gtk_widget_destroy(_chat_window);
+       [_sendBlock release];
+       [_closeBlock release];
 
        [super dealloc];
 }
@@ -110,29 +110,29 @@ static void call_close_block(GtkWidget *object, gpointer data)
 - (void)addMessage: (OFString*)text
            sender: (OFString*)sender
 {
-       BOOL first = bufferEmpty;
-       if (OF_UNLIKELY(bufferEmpty)) bufferEmpty = NO;
+       BOOL first = _bufferEmpty;
+       if (OF_UNLIKELY(_bufferEmpty)) _bufferEmpty = NO;
 
        g_idle_add_block(^{
                GtkTextIter end_iter;
                GtkTextMark *insert_mark =
-                   gtk_text_buffer_get_insert(chat_buffer);
+                   gtk_text_buffer_get_insert(_chat_buffer);
 
                if (OF_LIKELY(!first))
-                       gtk_text_buffer_insert_at_cursor(chat_buffer, "\n", 1);
+                       gtk_text_buffer_insert_at_cursor(_chat_buffer, "\n", 1);
 
-               gtk_text_buffer_get_end_iter(chat_buffer, &end_iter);
-               gtk_text_buffer_insert_with_tags_by_name(chat_buffer, &end_iter,
-                   [sender UTF8String], [sender UTF8StringLength], "bold",
-                   NULL);
-               gtk_text_buffer_get_end_iter(chat_buffer, &end_iter);
-               gtk_text_buffer_insert_with_tags_by_name(chat_buffer, &end_iter,
-                   ": ", 2, "bold", NULL);
+               gtk_text_buffer_get_end_iter(_chat_buffer, &end_iter);
+               gtk_text_buffer_insert_with_tags_by_name(_chat_buffer,
+                   &end_iter, [sender UTF8String], [sender UTF8StringLength],
+                   "bold", NULL);
+               gtk_text_buffer_get_end_iter(_chat_buffer, &end_iter);
+               gtk_text_buffer_insert_with_tags_by_name(_chat_buffer,
+                   &end_iter, ": ", 2, "bold", NULL);
 
-               gtk_text_buffer_insert_at_cursor(chat_buffer, [text UTF8String],
-                   [text UTF8StringLength]);
+               gtk_text_buffer_insert_at_cursor(_chat_buffer,
+                   [text UTF8String], [text UTF8StringLength]);
 
-               gtk_text_view_scroll_to_mark(chat_view, insert_mark, 0,
+               gtk_text_view_scroll_to_mark(_chat_view, insert_mark, 0,
                    FALSE, 0, 0);
        });
 }
index 4f3d7ac826a4735bcba4a84027242cf15c9f8fdc..40214f76797598d70321cffe7286b8ca46c3a8e5 100644 (file)
@@ -8,14 +8,14 @@
 
 @interface JubGtkRosterUI: OFObject <XMPPContactManagerDelegate>
 {
-       GtkWidget *roster_window;
-       GtkTreeStore *roster_model;
-       GtkTreeModelFilter *roster_filter;
-       GtkComboBox *presence_combo;
-       gulong presence_combo_changed_handler_id;
-       OFMapTable *groupMap;
-       OFMutableDictionary *contactMap;
-       JubChatClient *client;
+       GtkWidget *_roster_window;
+       GtkTreeStore *_roster_model;
+       GtkTreeModelFilter *_roster_filter;
+       GtkComboBox *_presence_combo;
+       gulong _presence_combo_changed_handler_id;
+       OFMapTable *_groupMap;
+       OFMutableDictionary *_contactMap;
+       JubChatClient *_client;
 }
 
 - initWithClient: (JubChatClient*)client;
index 901da507e2411b08c05ff67aca7e019fec1e021c..99e51446e75486d6a6f97bafd732c0d9c83c5c8f 100644 (file)
@@ -73,7 +73,7 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
 }
 
 @implementation JubGtkRosterUI
-- initWithClient: (JubChatClient*)client_
+- initWithClient: (JubChatClient*)client
 {
        self = [super init];
 
@@ -81,30 +81,30 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
                GtkTreeView *roster_view;
                GtkBuilder *builder;
 
-               groupMap = [[OFMapTable alloc]
+               _groupMap = [[OFMapTable alloc]
                    initWithKeyFunctions: keyFunctions
                          valueFunctions: rowRefFunctions];
-               contactMap = [[OFMutableDictionary alloc] init];
-               client = [client_ retain];
+               _contactMap = [[OFMutableDictionary alloc] init];
+               _client = [client retain];
 
-               [client.contactManager addDelegate: self];
+               [_client.contactManager addDelegate: self];
 
                builder = gtk_builder_new();
                gtk_builder_add_from_file(builder, "data/gtk/roster.ui", NULL);
                gtk_builder_connect_signals(builder, NULL);
 
-               roster_window =
+               _roster_window =
                    GTK_WIDGET(gtk_builder_get_object(builder, "RosterWindow"));
 
-               gtk_widget_show(roster_window);
+               gtk_widget_show(_roster_window);
 
-               roster_model = GTK_TREE_STORE(gtk_builder_get_object(builder,
+               _roster_model = GTK_TREE_STORE(gtk_builder_get_object(builder,
                    "RosterTreeStore"));
 
-               roster_filter = GTK_TREE_MODEL_FILTER(
+               _roster_filter = GTK_TREE_MODEL_FILTER(
                    gtk_builder_get_object(builder, "RosterTreeModelFilter"));
 
-               gtk_tree_model_filter_set_visible_func(roster_filter,
+               gtk_tree_model_filter_set_visible_func(_roster_filter,
                    filter_roster_by_presence, NULL, NULL);
 
                roster_view = GTK_TREE_VIEW(gtk_builder_get_object(builder,
@@ -113,11 +113,11 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
                g_signal_connect(roster_view, "row_activated",
                    G_CALLBACK(roster_row_activated), client);
 
-               presence_combo = GTK_COMBO_BOX(gtk_builder_get_object(builder,
+               _presence_combo = GTK_COMBO_BOX(gtk_builder_get_object(builder,
                        "PresenceComboBox"));
 
-               presence_combo_changed_handler_id =
-                   g_signal_connect(presence_combo, "changed",
+               _presence_combo_changed_handler_id =
+                   g_signal_connect(_presence_combo, "changed",
                        G_CALLBACK(presence_changed), client.connection);
 
                g_object_unref(G_OBJECT(builder));
@@ -131,12 +131,12 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
 
 - (void)dealloc
 {
-       [client.contactManager removeDelegate: self];
-       [groupMap release];
-       [contactMap release];
-       [client release];
+       [_client.contactManager removeDelegate: self];
+       [_groupMap release];
+       [_contactMap release];
+       [_client release];
 
-       gtk_widget_destroy(roster_window);
+       gtk_widget_destroy(_roster_window);
 
        [super dealloc];
 }
@@ -147,7 +147,7 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
        if (message.body == nil || ![message.type isEqual: @"chat"])
                return;
 
-       id<JubChatUI> chat = [client chatForContact: contact];
+       id<JubChatUI> chat = [_client chatForContact: contact];
        [chat addMessage: message.body
                  sender: [message.from bareJID]];
 }
@@ -163,63 +163,64 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
                OFString *bareJID = [item.JID bareJID];
                OFMapTable *contactRows;
 
-               if (!(contactRows = [contactMap objectForKey: bareJID])) {
+               if (!(contactRows = [_contactMap objectForKey: bareJID])) {
                        contactRows = [OFMapTable
                            mapTableWithKeyFunctions: keyFunctions
                                      valueFunctions: rowRefFunctions];
 
-                       [contactMap setObject: contactRows
-                                      forKey: bareJID];
+                       [_contactMap setObject: contactRows
+                                       forKey: bareJID];
                }
 
-               group_ref = [groupMap valueForKey: group];
+               group_ref = [_groupMap valueForKey: group];
 
                if (!group_ref) {
                        // Create new group row
-                       gtk_tree_store_append(roster_model, &group_iter, NULL);
-                       gtk_tree_store_set(roster_model, &group_iter,
+                       gtk_tree_store_append(_roster_model, &group_iter, NULL);
+                       gtk_tree_store_set(_roster_model, &group_iter,
                            0, [group UTF8String], -1);
 
                        group_path = gtk_tree_model_get_path(GTK_TREE_MODEL(
-                               roster_model), &group_iter);
+                               _roster_model), &group_iter);
 
                        group_ref = gtk_tree_row_reference_new(GTK_TREE_MODEL(
-                               roster_model), group_path);
+                               _roster_model), group_path);
 
-                       [groupMap setValue: group_ref
-                                   forKey: group];
+                       [_groupMap setValue: group_ref
+                                    forKey: group];
                } else {
                        // Get iter for existing group row
                        group_path = gtk_tree_row_reference_get_path(group_ref);
 
-                       gtk_tree_model_get_iter(GTK_TREE_MODEL(roster_model),
+                       gtk_tree_model_get_iter(GTK_TREE_MODEL(_roster_model),
                            &group_iter, group_path);
                }
                gtk_tree_path_free(group_path);
 
                // Create new contact row
-               gtk_tree_store_append(roster_model, &contact_iter, &group_iter);
+               gtk_tree_store_append(_roster_model, &contact_iter,
+                   &group_iter);
                if (item.name)
-                       gtk_tree_store_set(roster_model, &contact_iter,
+                       gtk_tree_store_set(_roster_model, &contact_iter,
                            0, [item.name UTF8String],
                            1, [bareJID UTF8String],
                            2, "unavailable", -1);
                else if (item.JID.node)
-                       gtk_tree_store_set(roster_model, &contact_iter,
+                       gtk_tree_store_set(_roster_model, &contact_iter,
                            0, [item.JID.node UTF8String],
                            1, [bareJID UTF8String],
                            2, "unavailable", -1);
                else
-                       gtk_tree_store_set(roster_model, &contact_iter,
+                       gtk_tree_store_set(_roster_model, &contact_iter,
                            0, [item.JID.domain UTF8String],
                            1, [bareJID UTF8String],
                            2, "unavailable", -1);
 
                contact_path = gtk_tree_model_get_path(GTK_TREE_MODEL(
-                       roster_model), &contact_iter);
+                       _roster_model), &contact_iter);
 
                contact_ref = gtk_tree_row_reference_new(GTK_TREE_MODEL(
-                       roster_model), contact_path);
+                       _roster_model), contact_path);
 
                gtk_tree_path_free(contact_path);
 
@@ -236,32 +237,32 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
                GtkTreePath *contact_path, *group_path;
                GtkTreeRowReference *contact_ref, *group_ref;
                OFString *bareJID = [item.JID bareJID];
-               OFMapTable *contactRows = [contactMap objectForKey: bareJID];
+               OFMapTable *contactRows = [_contactMap objectForKey: bareJID];
 
                contact_ref = [contactRows valueForKey: group];
                contact_path = gtk_tree_row_reference_get_path(contact_ref);
-               gtk_tree_model_get_iter(GTK_TREE_MODEL(roster_model),
+               gtk_tree_model_get_iter(GTK_TREE_MODEL(_roster_model),
                    &contact_iter, contact_path);
                gtk_tree_path_free(contact_path);
 
-               gtk_tree_store_remove(roster_model, &contact_iter);
+               gtk_tree_store_remove(_roster_model, &contact_iter);
 
-               group_ref = [groupMap valueForKey: group];
+               group_ref = [_groupMap valueForKey: group];
                group_path = gtk_tree_row_reference_get_path(group_ref);
-               gtk_tree_model_get_iter(GTK_TREE_MODEL(roster_model),
+               gtk_tree_model_get_iter(GTK_TREE_MODEL(_roster_model),
                    &group_iter, group_path);
 
-               if (!gtk_tree_model_iter_has_child(GTK_TREE_MODEL(roster_model),
-                   &group_iter)) {
-                       gtk_tree_store_remove(roster_model, &group_iter);
-                       [groupMap removeValueForKey: group];
+               if (!gtk_tree_model_iter_has_child(GTK_TREE_MODEL(
+                   _roster_model), &group_iter)) {
+                       gtk_tree_store_remove(_roster_model, &group_iter);
+                       [_groupMap removeValueForKey: group];
                }
 
                gtk_tree_path_free(group_path);
 
                [contactRows removeValueForKey: group];
                if([contactRows count] == 0)
-                       [contactMap removeObjectForKey: bareJID];
+                       [_contactMap removeObjectForKey: bareJID];
        });
 }
 
@@ -348,32 +349,32 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
                GtkTreePath *path;
                GtkTreeRowReference *ref;
                OFString *bareJID = [contact.rosterItem.JID bareJID];
-               OFMapTable *contactRows = [contactMap objectForKey: bareJID];
+               OFMapTable *contactRows = [_contactMap objectForKey: bareJID];
 
                for (OFString *group in contact.rosterItem.groups) {
                        ref = [contactRows valueForKey: group];
                        path = gtk_tree_row_reference_get_path(ref);
-                       gtk_tree_model_get_iter(GTK_TREE_MODEL(roster_model),
+                       gtk_tree_model_get_iter(GTK_TREE_MODEL(_roster_model),
                            &iter, path);
                        gtk_tree_path_free(path);
 
                        if ([highPresence.type isEqual: @"available"]) {
                                if (highPresence.show != nil)
-                                       gtk_tree_store_set(roster_model, &iter,
+                                       gtk_tree_store_set(_roster_model, &iter,
                                            2, [highPresence.show UTF8String],
                                            -1);
                                else
-                                       gtk_tree_store_set(roster_model, &iter,
+                                       gtk_tree_store_set(_roster_model, &iter,
                                            2, "available", -1);
                        } else
-                               gtk_tree_store_set(roster_model, &iter,
+                               gtk_tree_store_set(_roster_model, &iter,
                                    2, "unavailable", -1);
 
-                       gtk_tree_store_set(roster_model, &iter,
+                       gtk_tree_store_set(_roster_model, &iter,
                            3, [tooltip UTF8String], -1);
                }
 
-               gtk_tree_model_filter_refilter(roster_filter);
+               gtk_tree_model_filter_refilter(_roster_filter);
        });
 }
 
@@ -394,24 +395,24 @@ static gboolean filter_roster_by_presence(GtkTreeModel *model,
        g_idle_add_block(^{
                // Block the PresenceComboBox's changed handler, so it doesn't
                // fire and resend presence
-               g_signal_handler_block(presence_combo,
-                   presence_combo_changed_handler_id);
+               g_signal_handler_block(_presence_combo,
+                   _presence_combo_changed_handler_id);
 
                if ([presence.type isEqual: @"unavailable"])
-                       gtk_combo_box_set_active_id(presence_combo,
+                       gtk_combo_box_set_active_id(_presence_combo,
                            "unavailable");
                else if (show == nil)
-                       gtk_combo_box_set_active_id(presence_combo,
+                       gtk_combo_box_set_active_id(_presence_combo,
                            "available");
                else
-                       gtk_combo_box_set_active_id(presence_combo,
+                       gtk_combo_box_set_active_id(_presence_combo,
                            [show UTF8String]);
 
                // Unblock the changed handler
-               g_signal_handler_unblock(presence_combo,
-                   presence_combo_changed_handler_id);
+               g_signal_handler_unblock(_presence_combo,
+                   _presence_combo_changed_handler_id);
 
-               gtk_widget_set_tooltip_markup(GTK_WIDGET(presence_combo),
+               gtk_widget_set_tooltip_markup(GTK_WIDGET(_presence_combo),
                    [tooltip UTF8String]);
        });
 }
index acf813a6c54901e90590b1f76b91113995f99065..83b1847af4fd343625cb99eba2fb9823654d8327 100644 (file)
@@ -8,6 +8,6 @@
 
 @interface JubGtkUI: OFObject <JubUI>
 {
-       JubGtkRosterUI *rosterUI;
+       JubGtkRosterUI *_rosterUI;
 }
 @end
index d3595a9840089648e8d9d8bbbff9f485e0ae7dac..52e31e73f235e2105606a4432b7c248c1dbdc22f 100644 (file)
@@ -24,7 +24,7 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
 
                gtk_init(argc, argv);
 
-               rosterUI = [[JubGtkRosterUI alloc]
+               _rosterUI = [[JubGtkRosterUI alloc]
                    initWithClient: client];
        } @catch (id e) {
                [self release];
@@ -36,7 +36,7 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
 
 - (void)dealloc
 {
-       [rosterUI release];
+       [_rosterUI release];
 
        [super dealloc];
 }
@@ -59,7 +59,7 @@ void on_roster_window_destroy(GObject *object, gpointer user_data)
 -      (void)client: (JubChatClient*)client
   didChangePresence: (XMPPPresence*)presence
 {
-       [rosterUI    client: client
+       [_rosterUI   client: client
          didChangePresence: presence];
 }
 @end