From 77cba9d0b315894be018c20b38460d525a91f5c0 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 6 Jun 2013 13:39:48 +0200 Subject: [PATCH] export RECOLL_CONFDIR to filters --- src/internfile/mh_exec.cpp | 1 + src/internfile/mh_execm.cpp | 6 ++---- src/utils/execmd.cpp | 7 +++++++ src/utils/execmd.h | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/internfile/mh_exec.cpp b/src/internfile/mh_exec.cpp index 77f3f0b3..f10da8f8 100644 --- a/src/internfile/mh_exec.cpp +++ b/src/internfile/mh_exec.cpp @@ -100,6 +100,7 @@ bool MimeHandlerExec::next_document() ExecCmd mexec; MEAdv adv(filtermaxseconds); mexec.setAdvise(&adv); + mexec.putenv("RECOLL_CONFDIR", m_config->getConfDir()); mexec.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" : "RECOLL_FILTER_FORPREVIEW=no"); diff --git a/src/internfile/mh_execm.cpp b/src/internfile/mh_execm.cpp index a337d669..51796ac2 100644 --- a/src/internfile/mh_execm.cpp +++ b/src/internfile/mh_execm.cpp @@ -18,6 +18,7 @@ #include #include +using namespace std; #include "cstr.h" #include "mh_execm.h" @@ -33,10 +34,6 @@ #include #include -#ifndef NO_NAMESPACES -using namespace std; -#endif /* NO_NAMESPACES */ - bool MimeHandlerExecMultiple::startCmd() { LOGDEB(("MimeHandlerExecMultiple::startCmd\n")); @@ -56,6 +53,7 @@ bool MimeHandlerExecMultiple::startCmd() oss << "RECOLL_FILTER_MAXMEMBERKB=" << m_maxmemberkb; m_cmd.putenv(oss.str()); + m_cmd.putenv("RECOLL_CONFDIR", m_config->getConfDir()); m_cmd.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" : "RECOLL_FILTER_FORPREVIEW=no"); diff --git a/src/utils/execmd.cpp b/src/utils/execmd.cpp index 4071b65d..45ab66b5 100644 --- a/src/utils/execmd.cpp +++ b/src/utils/execmd.cpp @@ -102,6 +102,13 @@ void ExecCmd::putenv(const string &ea) { m_env.push_back(ea); } + +void ExecCmd::putenv(const string &name, const string& value) +{ + string ea = name + "=" + value; + putenv(ea); +} + static void msleep(int millis) { struct timespec spec; diff --git a/src/utils/execmd.h b/src/utils/execmd.h index c8dcea1a..8b12da65 100644 --- a/src/utils/execmd.h +++ b/src/utils/execmd.h @@ -86,6 +86,7 @@ class ExecCmd { * @param envassign an environment assignment string ("name=value") */ void putenv(const string &envassign); + void putenv(const string &name, const string& value); /** * Set function objects to call whenever new data is available or on