X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Frecordbatches.C;h=df576ed175eb9060558d516f9f4749f4e1f7e164;hb=7b05ad287956f8bd00836d9b5fb39f899a5fb641;hp=861538c468c80ea21e5b9e1dc3def8e588e5e99a;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/recordbatches.C b/cinelerra-5.1/cinelerra/recordbatches.C index 861538c4..df576ed1 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.C +++ b/cinelerra-5.1/cinelerra/recordbatches.C @@ -354,21 +354,10 @@ RecordBatchesGUI::Dir:: int RecordBatchesGUI::Dir:: handle_event() { - strncpy(directory, get_text(),sizeof(directory)); - char *bp, *cp, *dp = &directory[0]; - if( *dp ) { - if( dp[0] != '~' || dp[1] != 0 ) { - for( cp=dp; *cp; ++cp ) { - if( *cp != '/' ) continue; - for( bp=cp; *bp=='/'; ++bp ); - if( *bp ) dp = cp; - } - if( *--cp != '/' ) return 1; - while( cp>dp && *cp=='/' ) *cp-- = 0; - } - load_dirs(directory); - calculate_suggestions(dir_entries); - } + char *path = FileSystem::basepath(directory); + load_dirs(path); + calculate_suggestions(dir_entries); + delete [] path; return 1; } @@ -392,28 +381,17 @@ Path(RecordBatches &batches, int x, int y) : BC_TextBox(x, y, 200, 1, batches.get_editing_batch()->asset->path), batches(batches) { - file_entries = new ArrayList; - FileSystem fs; char string[BCTEXTLEN]; -// Load current directory - fs.update(getcwd(string, BCTEXTLEN)); - int total_files = fs.total_files(); - for(int i = 0; i < total_files; i++) { - const char *name = fs.get_entry(i)->get_name(); - file_entries->append(new BC_ListBoxItem(name)); - } } RecordBatchesGUI::Path:: ~Path() { - file_entries->remove_all_objects(); - delete file_entries; } int RecordBatchesGUI::Path:: handle_event() { - calculate_suggestions(file_entries); + calculate_suggestions(); Batch *batch = batches.gui->get_editing_batch(); strcpy(batch->asset->path, get_text()); batches.gui->update_batches();