[gq-commit] gq/src search.c,1.37,1.38
Status: Beta
Brought to you by:
sur5r
From: <sta...@us...> - 2003-10-04 10:03:55
|
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv4011 Modified Files: search.c Log Message: * Undid one very stupid check-in (not mentioning which one) * Got rid of global struct gq_config object - use pointer now Index: search.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/search.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** search.c 4 Oct 2003 09:08:32 -0000 1.37 --- search.c 4 Oct 2003 10:03:50 -0000 1.38 *************** *** 108,113 **** searchbase_combo = gtk_combo_new(); ! if(config.ldapservers) ! gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(searchbase_combo)->entry), config.ldapservers->basedn); gtk_box_pack_start(GTK_BOX(hbox1), searchbase_combo, FALSE, TRUE, 0); --- 108,113 ---- searchbase_combo = gtk_combo_new(); ! if(config->ldapservers) ! gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(searchbase_combo)->entry), config->ldapservers->basedn); gtk_box_pack_start(GTK_BOX(hbox1), searchbase_combo, FALSE, TRUE, 0); *************** *** 363,367 **** } else { ! switch(config.search_argument) { case SEARCHARG_BEGINS_WITH: snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s*)", server->searchattr, querystring); --- 363,367 ---- } else { ! switch(config->search_argument) { case SEARCHARG_BEGINS_WITH: snprintf(filter, MAX_LDAPFILTER_LEN - 1, "(%s=%s*)", server->searchattr, querystring); *************** *** 468,472 **** enc_searchbase = encoded_string(cur_searchbase); ! if(config.sort_search) msg = ldap_search_s(ld, enc_searchbase, LDAP_SCOPE_SUBTREE, filter, NULL, 0, &res); --- 468,472 ---- enc_searchbase = encoded_string(cur_searchbase); ! if(config->sort_search) msg = ldap_search_s(ld, enc_searchbase, LDAP_SCOPE_SUBTREE, filter, NULL, 0, &res); *************** *** 478,483 **** free(filter); ! if((config.sort_search && msg != LDAP_SUCCESS) || msg == -1) { ! if (config.sort_search && msg != LDAP_SERVER_DOWN) { server->server_down++; } --- 478,483 ---- free(filter); ! if((config->sort_search && msg != LDAP_SUCCESS) || msg == -1) { ! if (config->sort_search && msg != LDAP_SERVER_DOWN) { server->server_down++; } *************** *** 524,528 **** /* reserve columns 0 & 1 for DN and objectClass, respectively */ ! if(config.showdn) { column_by_attr(&attrlist, "DN"); gtk_clist_set_column_title(GTK_CLIST(new_main_clist), 0, "DN"); --- 524,528 ---- /* reserve columns 0 & 1 for DN and objectClass, respectively */ ! if(config->showdn) { column_by_attr(&attrlist, "DN"); gtk_clist_set_column_title(GTK_CLIST(new_main_clist), 0, "DN"); *************** *** 533,541 **** gtk_clist_set_column_width(GTK_CLIST(new_main_clist), oc_col, 120); columns_done[oc_col] = 1; ! if(config.showoc == 0) gtk_clist_set_column_visibility(GTK_CLIST(new_main_clist), oc_col, 0); row = 0; ! if(!config.sort_search) rc = (ldap_result(ld, msg, 0, NULL, &res) == LDAP_RES_SEARCH_ENTRY); else --- 533,541 ---- gtk_clist_set_column_width(GTK_CLIST(new_main_clist), oc_col, 120); columns_done[oc_col] = 1; ! if(config->showoc == 0) gtk_clist_set_column_visibility(GTK_CLIST(new_main_clist), oc_col, 0); row = 0; ! if(!config->sort_search) rc = (ldap_result(ld, msg, 0, NULL, &res) == LDAP_RES_SEARCH_ENTRY); else *************** *** 558,562 **** strncpy(set->dn, dn, MAX_DN_LEN); ! if(config.showdn) { #if GTK_MAJOR >= 2 strcpy(tolist[0], dn); --- 558,562 ---- strncpy(set->dn, dn, MAX_DN_LEN); ! if(config->showdn) { #if GTK_MAJOR >= 2 strcpy(tolist[0], dn); *************** *** 576,579 **** --- 576,585 ---- for(attr = ldap_first_attribute(ld, e, &berptr); attr != NULL; attr = ldap_next_attribute(ld, e, berptr)) { + /* + struct syntax_handler *handler = + get_syntax_handler_of_attr(server, attr, NULL); + */ + + /* This should now work for ;binary as well */ cur_col = column_by_attr(&attrlist, attr); *************** *** 594,599 **** if(vals) { for(i = 0; vals[i] != NULL; i++) { - /* that's an awful lot of mallocs in the innermost loop, - but then we don't want to count on max valuelen either */ #if GTK_MAJOR >= 2 if(i == 0) --- 600,603 ---- *************** *** 630,634 **** } ! if(config.sort_search) rc = 0; else --- 634,638 ---- } ! if(config->sort_search) rc = 0; else *************** *** 647,651 **** else { snprintf(message, sizeof(message), ! ngettext(_("One entry found"), _("%d entries found"), row), row); statusbar_msg(message); --- 651,655 ---- else { snprintf(message, sizeof(message), ! ngettext("One entry found", "%d entries found", row), row); statusbar_msg(message); |