Fix ou handling in netdomjoin-gui.
authorGünther Deschner <gd@samba.org>
Sat, 12 Apr 2008 21:12:53 +0000 (23:12 +0200)
committerGünther Deschner <gd@samba.org>
Sat, 12 Apr 2008 22:46:33 +0000 (00:46 +0200)
The ou list was concatenated again and again...

Guenther
(This used to be commit 84608e165e24c68c12d40086f81684ef37f69159)

source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c

index fa1bafd5ae74ea16735f6bf7477ea7bdc9e34657..a7b2079f95e77e7329fec06ad85f5fab3b1ec40f 100644 (file)
@@ -84,6 +84,7 @@ typedef struct join_state {
        uint16_t server_role;
        gboolean settings_changed;
        gboolean hostname_changed;
+       uint32_t stored_num_ous;
 } join_state;
 
 static void debug(const char *format, ...)
@@ -932,11 +933,15 @@ static void callback_do_getous(GtkWidget *widget,
                return;
        }
 
+       for (i=0; i<state->stored_num_ous; i++) {
+               gtk_combo_box_remove_text(GTK_COMBO_BOX(state->entry_ou_list), 0);
+       }
        for (i=0; i<num_ous && ous[i] != NULL; i++) {
                gtk_combo_box_append_text(GTK_COMBO_BOX(state->entry_ou_list),
                                          ous[i]);
        }
        NetApiBufferFree(ous);
+       state->stored_num_ous = num_ous;
        gtk_combo_box_set_active(GTK_COMBO_BOX(state->entry_ou_list), num_ous-1);
 }