mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 16:46:52 +08:00
Fix handling of filename matching - wasn't checking the basename of
the filename for a match. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2049 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
CHANGES IN FLTK 1.1.0
|
||||
|
||||
- Fl_File_Icon::find() did not check the basename of a
|
||||
filename for a match; this caused matches for a
|
||||
specific filename (e.g. "fluid") to fail.
|
||||
- The Fl_Shared_Image class now supports additional
|
||||
image handling functions - this allows you to support
|
||||
additional image file formats transparently.
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_File_Browser.cxx,v 1.1.2.7 2002/03/25 21:08:41 easysw Exp $"
|
||||
// "$Id: Fl_File_Browser.cxx,v 1.1.2.8 2002/03/29 14:16:03 easysw Exp $"
|
||||
//
|
||||
// Fl_File_Browser routines.
|
||||
//
|
||||
@@ -238,10 +238,10 @@ Fl_File_Browser::item_width(void *p) const // I - List item data
|
||||
|
||||
void
|
||||
Fl_File_Browser::item_draw(void *p, // I - List item data
|
||||
int x, // I - Upper-lefthand X coordinate
|
||||
int y, // I - Upper-lefthand Y coordinate
|
||||
int w, // I - Width of item
|
||||
int h) const // I - Height of item
|
||||
int x, // I - Upper-lefthand X coordinate
|
||||
int y, // I - Upper-lefthand Y coordinate
|
||||
int w, // I - Width of item
|
||||
int h) const// I - Height of item
|
||||
{
|
||||
int i; // Looping var
|
||||
FL_BLINE *line; // Pointer to line
|
||||
@@ -365,10 +365,10 @@ Fl_File_Browser::item_draw(void *p, // I - List item data
|
||||
//
|
||||
|
||||
Fl_File_Browser::Fl_File_Browser(int x, // I - Upper-lefthand X coordinate
|
||||
int y, // I - Upper-lefthand Y coordinate
|
||||
int w, // I - Width in pixels
|
||||
int h, // I - Height in pixels
|
||||
const char *l) // I - Label text
|
||||
int y, // I - Upper-lefthand Y coordinate
|
||||
int w, // I - Width in pixels
|
||||
int h, // I - Height in pixels
|
||||
const char *l) // I - Label text
|
||||
: Fl_Browser(x, y, w, h, l)
|
||||
{
|
||||
// Initialize the filter pattern, current directory, and icon size...
|
||||
@@ -559,5 +559,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.7 2002/03/25 21:08:41 easysw Exp $".
|
||||
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.8 2002/03/29 14:16:03 easysw Exp $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_File_Icon.cxx,v 1.1.2.8 2002/03/25 21:08:41 easysw Exp $"
|
||||
// "$Id: Fl_File_Icon.cxx,v 1.1.2.9 2002/03/29 14:16:03 easysw Exp $"
|
||||
//
|
||||
// Fl_File_Icon routines.
|
||||
//
|
||||
@@ -192,6 +192,7 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
|
||||
{
|
||||
Fl_File_Icon *current; // Current file in list
|
||||
struct stat fileinfo; // Information on file
|
||||
const char *name; // Base name of filename
|
||||
|
||||
|
||||
// Get file information if needed...
|
||||
@@ -216,11 +217,15 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
|
||||
filetype = PLAIN;
|
||||
}
|
||||
|
||||
// Look at the base name in the filename
|
||||
name = fl_filename_name(filename);
|
||||
|
||||
// Loop through the available file types and return any match that
|
||||
// is found...
|
||||
for (current = first_; current != (Fl_File_Icon *)0; current = current->next_)
|
||||
if ((current->type_ == filetype || current->type_ == ANY) &&
|
||||
fl_filename_match(filename, current->pattern_))
|
||||
(fl_filename_match(filename, current->pattern_) ||
|
||||
fl_filename_match(name, current->pattern_)))
|
||||
break;
|
||||
|
||||
// Return the match (if any)...
|
||||
@@ -466,5 +471,5 @@ Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.8 2002/03/25 21:08:41 easysw Exp $".
|
||||
// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.9 2002/03/29 14:16:03 easysw Exp $".
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user