Commit dfd04d09 authored by Michael Reeves's avatar Michael Reeves

Use QStringLIst for default patterns

parent 592f9c73
Pipeline #12829 passed with stage
in 7 minutes and 3 seconds
......@@ -19,12 +19,12 @@
void CvsIgnoreList::init(FileAccess& dir, const t_DirectoryList* pDirList)
{
static const QString ignorestr = QString::fromLatin1(". .. core RCSLOG tags TAGS RCS SCCS .make.state "
".nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj "
"*.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej *.exe _$* *$");
static const QStringList ignorestr = QStringList{".", ".. core", "RCSLOG", "tags", "TAGS", "RCS", "SCCS", ".make.state",
".nse_depinfo", "#* .#* cvslog.*", ",* CVS", "CVS.adm", ".del-*", "*.a", "*.olb", "*.o", "*.obj",
"*.so", "*.Z", "*~ *.old", "*.elc *.ln", "*.bak", "*.BAK", "*.orig", "*.rej", "*.exe", "_$*", "*$"};
static const char* varname = "CVSIGNORE";
addEntriesFromString(ignorestr);
addEntriesFromList(ignorestr);
addEntriesFromFile(QDir::homePath() + "/.cvsignore");
if(qEnvironmentVariableIsSet(varname) && !qEnvironmentVariableIsEmpty(varname))
{
......@@ -46,6 +46,14 @@ void CvsIgnoreList::init(FileAccess& dir, const t_DirectoryList* pDirList)
}
}
void CvsIgnoreList::addEntriesFromList(const QStringList& patternList)
{
for(const QString& pattern : patternList)
{
addEntry(pattern);
}
}
void CvsIgnoreList::addEntriesFromString(const QString& str)
{
QStringList patternList = str.split(' ');
......
......@@ -34,6 +34,7 @@ class CvsIgnoreList
friend class CvsIgnoreListTest;
bool cvsIgnoreExists(const t_DirectoryList* pDirList);
void addEntriesFromList(const QStringList& patternList);
void addEntriesFromString(const QString& str);
void addEntriesFromFile(const QString& name);
void addEntry(const QString& pattern);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment