diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index d5a96aaa..531d4c64 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -60,6 +60,8 @@ typedef pair RclPII; // We default to a case- and diacritics-less index for now bool o_index_stripchars = true; +bool o_uptodate_test_use_mtime = false; + string RclConfig::o_localecharset; string RclConfig::o_origcwd; @@ -342,6 +344,7 @@ bool RclConfig::updateMainConfig() static int m_index_stripchars_init = 0; if (!m_index_stripchars_init) { getConfParam("indexStripChars", &o_index_stripchars); + getConfParam("testmodifusemtime", &o_uptodate_test_use_mtime); m_index_stripchars_init = 1; } diff --git a/src/common/rclconfig.h b/src/common/rclconfig.h index 9254d5da..b9db0d20 100644 --- a/src/common/rclconfig.h +++ b/src/common/rclconfig.h @@ -379,4 +379,9 @@ class RclConfig { // reset. When using multiple indexes, all must have the same value extern bool o_index_stripchars; +// This global variable defines if we use mtime instead of ctime for +// up-to-date tests. This is mostly incompatible with xattr indexing, +// in addition to other issues. See recoll.conf comments. +extern bool o_uptodate_test_use_mtime; + #endif /* _RCLCONFIG_H_INCLUDED_ */ diff --git a/src/index/fsindexer.cpp b/src/index/fsindexer.cpp index 75153b01..bf63875f 100644 --- a/src/index/fsindexer.cpp +++ b/src/index/fsindexer.cpp @@ -47,8 +47,6 @@ #include "execmd.h" #include "extrameta.h" -int FsIndexer::o_tstupdusemtime = -1; - using namespace std; #ifdef IDX_THREADS @@ -111,12 +109,6 @@ FsIndexer::FsIndexer(RclConfig *cnf, Rcl::Db *db, DbIxStatusUpdater *updfunc) m_havelocalfields = m_config->hasNameAnywhere("localfields"); m_config->getConfParam("detectxattronly", &m_detectxattronly); - if (o_tstupdusemtime == -1) { - bool b(false); - m_config->getConfParam("testmodifusemtime", &b); - o_tstupdusemtime = b ? 1 : 0; - } - #ifdef IDX_THREADS m_stableconfig = new RclConfig(*m_config); m_loglevel = DebugLog::getdbl()->getlevel(); @@ -497,7 +489,8 @@ void FsIndexer::makesig(const struct stat *stp, string& out) { char cbuf[100]; sprintf(cbuf, "%lld" "%ld", (long long)stp->st_size, - o_tstupdusemtime ? (long)stp->st_mtime : (long)stp->st_ctime); + o_uptodate_test_use_mtime ? + (long)stp->st_mtime : (long)stp->st_ctime); out = cbuf; } diff --git a/src/index/fsindexer.h b/src/index/fsindexer.h index 0c08550c..f7ce0cd9 100644 --- a/src/index/fsindexer.h +++ b/src/index/fsindexer.h @@ -135,10 +135,6 @@ class FsIndexer : public FsTreeWalkerCB { // Activate detection of xattr-only document updates. Experimental, so // needs a config option bool m_detectxattronly; - // Use mtime instead of ctime for up-to-date tests. This is mostly - // incompatible with xattr indexing, in addition to other - // issues. See recoll.conf comments. - static int o_tstupdusemtime; #ifdef IDX_THREADS friend void *FsIndexerDbUpdWorker(void*);