Skip to content

Commit

Permalink
Allow case insensitive file pattern matching based on CASE_SENSE_NAMES
Browse files Browse the repository at this point in the history
  • Loading branch information
ksztyber committed Dec 10, 2017
1 parent 4f45bd2 commit bd759f9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7902,9 +7902,16 @@ QCString filterTitle(const QCString &title)

bool patternMatch(const QFileInfo &fi,const QStrList *patList)
{
bool found=FALSE;
static bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
bool found = FALSE;

// For Windows/Mac, always do the case insensitive match
#if defined(_WIN32) || defined(__MACOSX__)
caseSenseNames = FALSE;
#endif

if (patList)
{
{
QStrListIterator it(*patList);
QCString pattern;

Expand All @@ -7919,11 +7926,8 @@ bool patternMatch(const QFileInfo &fi,const QStrList *patList)
int i=pattern.find('=');
if (i!=-1) pattern=pattern.left(i); // strip of the extension specific filter name

#if defined(_WIN32) || defined(__MACOSX__) // Windows or MacOSX
QRegExp re(pattern,FALSE,TRUE); // case insensitive match
#else // unix
QRegExp re(pattern,TRUE,TRUE); // case sensitive match
#endif
QRegExp re(pattern,caseSenseNames,TRUE);

found = re.match(fn)!=-1 ||
re.match(fp)!=-1 ||
re.match(afp)!=-1;
Expand Down

0 comments on commit bd759f9

Please sign in to comment.