Changeset 8304 for branches

Show
Ignore:
Timestamp:
14/12/11 09:36:49 (5 months ago)
Author:
westram
Message:
  • removed ED4_species_container_changed_cb
    • that callback triggered whenever the number of species in database increased and then loaded the "last" species in species container
      • most likely was thought to load species after creating a new species, but also triggered after delete+undo and similar
    • removed GB_search_last_son (only used there)
Location:
branches/e4fix
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/e4fix/ARBDB/ad_prot.h

    r8287 r8304  
    232232GBDATA *GB_searchOrCreate_int(GBDATA *gb_container, const char *fieldpath, long default_value); 
    233233GBDATA *GB_searchOrCreate_float(GBDATA *gb_container, const char *fieldpath, double default_value); 
    234 GBDATA *GB_search_last_son(GBDATA *gbd); 
    235234long GB_number_of_marked_subentries(GBDATA *gbd); 
    236235GBDATA *GB_first_marked(GBDATA *gbd, const char *keystring); 
  • branches/e4fix/ARBDB/adquery.cxx

    r8274 r8304  
    653653        } 
    654654        if (!skip_over--) return gb; 
    655     } 
    656     return NULL; 
    657 } 
    658  
    659 GBDATA *GB_search_last_son(GBDATA *gbd) { 
    660     GBCONTAINER    *gbc    = (GBCONTAINER *)gbd; 
    661     int             index; 
    662     int             end    = gbc->d.nheader; 
    663     GBDATA         *gb; 
    664     gb_header_list *header = GB_DATA_LIST_HEADER(gbc->d); 
    665  
    666     for (index = end-1; index>=0; index--) { 
    667         if (header[index].flags.changed >= GB_DELETED) continue; 
    668         if ((gb=GB_HEADER_LIST_GBD(header[index]))==NULL) 
    669         { 
    670             gb_unfold(gbc, 0, index); 
    671             header = GB_DATA_LIST_HEADER(gbc->d); 
    672             gb = GB_HEADER_LIST_GBD(header[index]); 
    673         } 
    674         return gb; 
    675655    } 
    676656    return NULL; 
  • branches/e4fix/EDIT4/ED4_base.cxx

    r8290 r8304  
    178178    if (gbtype&GB_CB_SON_CREATED) { 
    179179        // @@@ New son for database-member was created ... what may we do now? 
    180     } 
    181 } 
    182  
    183 int ED4_elements_in_species_container; // # of elements in species container 
    184 void ED4_species_container_changed_cb(GBDATA *gb_species_data, int * /* cl */, GB_CB_TYPE gbtype) 
    185 { 
    186     if (gbtype==GB_CB_CHANGED) { 
    187         int nsons = GB_number_of_subentries(gb_species_data); 
    188  
    189         if (nsons>ED4_elements_in_species_container) { // new species was created 
    190 #if defined(DEBUG) && 1 
    191             printf("# of species in species-container changed from %i to %i\n", ED4_elements_in_species_container, nsons); 
    192             aw_popup_ok("Species container changed!"); 
    193 #endif 
    194             GBDATA *gb_lastSon = GB_search_last_son(gb_species_data); 
    195  
    196             if (gb_lastSon) { 
    197                 GBDATA *gb_name = GB_search(gb_lastSon, "name", GB_FIND); 
    198  
    199                 if (gb_name) { 
    200                     char *name = GB_read_as_string(gb_name); 
    201  
    202                     ED4_get_and_jump_to_species(name); 
    203 #if defined(DEBUG) && 1 
    204                     printf("new species = '%s'\n", name); 
    205 #endif 
    206                     free(name); 
    207                 } 
    208             } 
    209         } 
    210         ED4_elements_in_species_container = nsons; 
    211180    } 
    212181} 
  • branches/e4fix/EDIT4/ED4_main.cxx

    r8275 r8304  
    637637 
    638638    // now bind DB depending callbacks 
    639  
    640639    ed4_bind_mainDB_awar_callbacks(ED4_ROOT->aw_root); 
    641     { 
    642         GB_transaction dummy(GLOBAL_gb_main); 
    643         GBDATA *species_container = GB_search(GLOBAL_gb_main, "species_data", GB_FIND); 
    644         GB_add_callback(species_container, (GB_CB_TYPE)GB_CB_CHANGED, (GB_CB)ED4_species_container_changed_cb, 0); // callback if species_data changes 
    645  
    646         ED4_elements_in_species_container = GB_number_of_subentries(species_container); // store # of species 
    647 #if defined(DEBUG) && 0 
    648         printf("Species container contains %i species (at startup)\n", ED4_elements_in_species_container); 
    649 #endif 
    650     } 
    651640 
    652641    // Create Additional sequence (aminoacid) terminals to be used in Protein Viewer 
  • branches/e4fix/EDIT4/ed4_class.hxx

    r8296 r8304  
    22082208void ED4_finish_and_show_notFoundMessage(); 
    22092209 
    2210 extern int  ED4_elements_in_species_container; // # of elements in species container 
    2211 void        ED4_undo_redo               (AW_window*, AW_CL undo_type); 
     2210void ED4_undo_redo(AW_window*, AW_CL undo_type); 
    22122211 
    22132212ED4_species_name_terminal *ED4_find_species_name_terminal(const char *species_name); 
     
    22212220 
    22222221extern "C" { 
    2223     void    ED4_species_container_changed_cb(GBDATA *gbd, int *cl, GB_CB_TYPE gbtype); 
    22242222    void    ED4_sequence_changed_cb(GBDATA *gb_seq, int *cl, GB_CB_TYPE gbtype); 
    22252223    void    ED4_alignment_length_changed(GBDATA *gb_alignment_len, int *dummy, GB_CB_TYPE gbtype);