Permalink
Browse files

Make list of default extensions consistent with language mapping list

In the forum a discrepancy was noted between config.l and config.xml (http://doxygen.10944.n7.nabble.com/FILE-PATTERNS-one-custom-plus-all-defaults-td7308.html). The config.xml list was based on the function initDefaultExtensionMapping in util.cpp and the list in the function Config::check in config.l. Now both routines use the same list.
  • Loading branch information...
albert-github committed Aug 16, 2015
1 parent 625e7a1 commit bf35f16863f067286260ad4b68ec4c0ae7febdf1
Showing with 23 additions and 65 deletions.
  1. +1 −65 src/config.l
  2. +21 −0 src/util.cpp
  3. +1 −0 src/util.h
@@ -1426,71 +1426,7 @@ void Config::check()
}
}
// add default pattern if needed
QStrList &filePatternList = Config_getList("FILE_PATTERNS");
if (filePatternList.isEmpty())
{
filePatternList.append("*.c");
filePatternList.append("*.cc");
filePatternList.append("*.cxx");
filePatternList.append("*.cpp");
filePatternList.append("*.c++");
//filePatternList.append("*.d");
filePatternList.append("*.java");
filePatternList.append("*.ii");
filePatternList.append("*.ixx");
filePatternList.append("*.ipp");
filePatternList.append("*.i++");
filePatternList.append("*.inl");
filePatternList.append("*.h");
filePatternList.append("*.hh");
filePatternList.append("*.hxx");
filePatternList.append("*.hpp");
filePatternList.append("*.h++");
filePatternList.append("*.idl");
filePatternList.append("*.odl");
filePatternList.append("*.cs");
filePatternList.append("*.php");
filePatternList.append("*.php3");
filePatternList.append("*.inc");
filePatternList.append("*.m");
filePatternList.append("*.mm");
filePatternList.append("*.dox");
filePatternList.append("*.py");
filePatternList.append("*.f90");
filePatternList.append("*.f");
filePatternList.append("*.for");
filePatternList.append("*.vhd");
filePatternList.append("*.vhdl");
filePatternList.append("*.tcl");
filePatternList.append("*.md");
filePatternList.append("*.markdown");
if (portable_fileSystemIsCaseSensitive())
{
// unix => case sensitive match => also include useful uppercase versions
filePatternList.append("*.C");
filePatternList.append("*.CC");
filePatternList.append("*.C++");
filePatternList.append("*.II");
filePatternList.append("*.I++");
filePatternList.append("*.H");
filePatternList.append("*.HH");
filePatternList.append("*.H++");
filePatternList.append("*.CS");
filePatternList.append("*.PHP");
filePatternList.append("*.PHP3");
filePatternList.append("*.M");
filePatternList.append("*.MM");
filePatternList.append("*.PY");
filePatternList.append("*.F90");
filePatternList.append("*.F");
filePatternList.append("*.VHD");
filePatternList.append("*.VHDL");
filePatternList.append("*.TCL");
filePatternList.append("*.MD");
filePatternList.append("*.MARKDOWN");
}
}
initFilePattern();
// add default pattern if needed
QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS");
21 src/util.cpp 100644 → 100755
@@ -6854,6 +6854,7 @@ bool updateLanguageMapping(const QCString &extension,const QCString &language)
void initDefaultExtensionMapping()
{
// NOTE: when adding an extension, also add the extension in config.xml
g_extLookup.setAutoDelete(TRUE);
// extension parser id
updateLanguageMapping(".dox", "c");
@@ -8419,3 +8420,23 @@ QCString getDotImageExtension(void)
imgExt = imgExt.replace( QRegExp(":.*"), "" );
return imgExt;
}
void initFilePattern(void)
{
// add default pattern if needed
QStrList &filePatternList = Config_getList("FILE_PATTERNS");
if (filePatternList.isEmpty())
{
QDictIterator<int> it( g_extLookup );
QCString pattern;
bool caseSens = portable_fileSystemIsCaseSensitive();
for (;it.current();++it)
{
pattern = "*";
pattern += it.currentKey();
filePatternList.append(pattern.data());
if (caseSens) filePatternList.append(pattern.upper().data());
}
}
}
1 src/util.h 100644 → 100755
@@ -464,6 +464,7 @@ void convertProtectionLevel(
);
bool mainPageHasTitle();
void initFilePattern(void);
#endif

0 comments on commit bf35f16

Please sign in to comment.