From 3124794f1fe6e7a5e0e201f6a3e773ed58ad1e5e Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 5 Feb 2005 18:26:21 +0000 Subject: Fl_File_Chooser was slow with large directories (STR #654) FL/Fl_File_Browser.H: - Don't reload the directory view unless asked to. FL/Fl_File_Chooser.H: - Rebuilt using current FLUID. src/Fl_File_Browser.cxx: - Don't reload the directory view unless asked to. src/Fl_File_Chooser.cxx: - Fl_File_Chooser::show() calls rescan(). src/Fl_File_Chooser.fl: - Fl_File_Chooser::show() calls rescan(). src/Fl_File_Chooser2.cxx: - Only call rescan() when chooser is shown. src/Fl_File_Icon.cxx: - Add optimization for Windows - filenames with trailing slash are directories. test/file_chooser.cxx: - Only call show() once... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4010 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_File_Chooser2.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/Fl_File_Chooser2.cxx') diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 045f04e6a..b615fe1ca 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.38 2004/09/07 20:59:16 easysw Exp $" +// "$Id$" // // More Fl_File_Chooser routines. // @@ -196,8 +196,10 @@ Fl_File_Chooser::directory(const char *d)// I - Directory to change to else directory_[0] = '\0'; - // Rescan the directory... - rescan(); + if (shown()) { + // Rescan the directory... + rescan(); + } } @@ -834,7 +836,11 @@ Fl_File_Chooser::showChoiceCB() } fileList->filter(pattern_); - rescan(); + + if (shown()) { + // Rescan the directory... + rescan(); + } } @@ -1160,5 +1166,5 @@ unquote_pathname(char *dst, // O - Destination string // -// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.38 2004/09/07 20:59:16 easysw Exp $". +// End of "$Id$". // -- cgit v1.2.3