centralize skippedNames computation to add dbdir always

This commit is contained in:
dockes
2006-10-24 09:09:36 +00:00
parent c78a055bb2
commit d8f8dd851e
4 changed files with 31 additions and 23 deletions
+21 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.31 2006-10-16 15:33:08 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.32 2006-10-24 09:09:36 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -313,6 +313,26 @@ string RclConfig::getDbDir()
return dbdir;
}
list<string> RclConfig::getSkippedNames()
{
list<string> skpl;
string skipped;
if (getConfParam("skippedNames", skipped)) {
stringToStrings(skipped, skpl);
}
// If current keydir is dbdir's ancestor, add dbdir name to skipped
// This is mainly for the real-time monitor that will otherwise go
// into a loop
// We'd prefer to do it for the direct ancestor only, but getSkippedNames()
// is only called for the topdirs, so this doesn't work
string kd = path_canon(getKeyDir());
string dbd = path_canon(getDbDir());
if (dbd.find(kd) == 0) {
skpl.push_back(path_getsimple(dbd));
}
return skpl;
}
// Look up an executable filter. We look in $RECOLL_FILTERSDIR,
// filtersdir in config file, then let the system use the PATH
+4 -1
View File
@@ -16,7 +16,7 @@
*/
#ifndef _RCLCONFIG_H_INCLUDED_
#define _RCLCONFIG_H_INCLUDED_
/* @(#$Id: rclconfig.h,v 1.23 2006-10-16 15:33:08 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: rclconfig.h,v 1.24 2006-10-24 09:09:36 dockes Exp $ (C) 2004 J.F.Dockes */
#include <list>
#include <string>
@@ -74,6 +74,9 @@ class RclConfig {
/** Get database directory */
string getDbDir();
/** Get list of skipped names for current keydir */
list<string> getSkippedNames();
/**
* Get list of ignored suffixes from mimemap
*