Show
Ignore:
Timestamp:
14/01/10 15:10:39 (2 years ago)
Author:
westram
Message:
  • removed useless variable 'species_read'
  • fixed overflow if too many missing species in configuration
    • shortened error message (show only first 200 missing species)
  • moved some duplicated code into ED4_init_notFoundMessage / ED4_finish_and_show_notFoundMessage
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/EDIT4/ED4_cursor.cxx

    r6347 r6353  
    592592} 
    593593 
     594void ED4_init_notFoundMessage() { 
     595    not_found_counter = 0; 
     596    not_found_message = GBS_stropen(10000); 
     597    // GBS_strcat(not_found_message,"Species not found: "); 
     598} 
     599void ED4_finish_and_show_notFoundMessage() { 
     600    if (not_found_counter != 0) { 
     601        GBS_strcat(not_found_message, GBS_global_string("(skipped display of %i more species)\n", not_found_counter-MAX_SHOWN_MISSING_SPECIES)); 
     602        char *out_message = GBS_strclose(not_found_message); 
     603        aw_message(out_message); 
     604        aw_message(GBS_global_string("Couldn't load %i species:", not_found_counter)); 
     605        free(out_message); 
     606    } 
     607    else { 
     608        GBS_strforget(not_found_message); 
     609    } 
     610    not_found_message = 0; 
     611} 
     612 
    594613void ED4_get_and_jump_to_species(GB_CSTR species_name) 
    595614{ 
     
    608627        ED4_index                  lot                 = 0; 
    609628 
    610         all_found         = 0; 
    611         not_found_message = GBS_stropen(1000); 
    612         GBS_strcat(not_found_message,"Species not found: "); 
     629        ED4_init_notFoundMessage(); 
    613630 
    614631        sprintf(string, "-L%s", species_name); 
     
    618635        loaded = 1; 
    619636 
    620         { 
    621             char *out_message = GBS_strclose(not_found_message); 
    622             not_found_message = 0; 
    623             if (all_found != 0) aw_message(out_message); 
    624             free(out_message); 
    625         } 
     637        ED4_finish_and_show_notFoundMessage(); 
    626638 
    627639        { 
     
    698710        aw_status("Loading species..."); 
    699711 
    700         all_found         = 0; 
    701         not_found_message = GBS_stropen(1000); 
    702         GBS_strcat(not_found_message,"Species not found: "); 
     712        ED4_init_notFoundMessage(); 
    703713 
    704714        while (gb_species) { 
     
    754764        aw_message(GBS_global_string("Loaded %i of %i marked species.", inserted, marked)); 
    755765 
    756         { 
    757             char *out_message = GBS_strclose(not_found_message); 
    758             not_found_message = 0; 
    759             if (all_found != 0) aw_message(out_message); 
    760             free(out_message); 
    761         } 
    762  
     766        ED4_finish_and_show_notFoundMessage(); 
     767         
    763768        if (inserted) { 
    764769            /* new AAseqTerminals should be created if it is in ProtView mode */