export RECOLL_CONFDIR to filters

This commit is contained in:
Jean-Francois Dockes 2013-06-06 13:39:48 +02:00
parent 6a5cc1b7fe
commit 77cba9d0b3
4 changed files with 11 additions and 4 deletions

View File

@ -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");

View File

@ -18,6 +18,7 @@
#include <iostream>
#include <sstream>
using namespace std;
#include "cstr.h"
#include "mh_execm.h"
@ -33,10 +34,6 @@
#include <sys/types.h>
#include <sys/wait.h>
#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");

View File

@ -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;

View File

@ -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