|
a/src/internfile/mh_text.cpp |
|
b/src/internfile/mh_text.cpp |
|
... |
|
... |
37 |
|
37 |
|
38 |
const int MB = 1024*1024;
|
38 |
const int MB = 1024*1024;
|
39 |
const int KB = 1024;
|
39 |
const int KB = 1024;
|
40 |
|
40 |
|
41 |
// Process a plain text file
|
41 |
// Process a plain text file
|
42 |
bool MimeHandlerText::set_document_file(const string &fn)
|
42 |
bool MimeHandlerText::set_document_file(const string& mt, const string &fn)
|
43 |
{
|
43 |
{
|
44 |
LOGDEB(("MimeHandlerText::set_document_file: [%s]\n", fn.c_str()));
|
44 |
LOGDEB(("MimeHandlerText::set_document_file: [%s]\n", fn.c_str()));
|
45 |
|
45 |
|
46 |
RecollFilter::set_document_file(fn);
|
46 |
RecollFilter::set_document_file(mt, fn);
|
47 |
m_fn = fn;
|
47 |
m_fn = fn;
|
48 |
|
48 |
|
49 |
// file size for oversize check
|
49 |
// file size for oversize check
|
50 |
struct stat st;
|
50 |
struct stat st;
|
51 |
if (stat(m_fn.c_str(), &st) < 0) {
|
51 |
if (stat(m_fn.c_str(), &st) < 0) {
|
|
... |
|
... |
89 |
}
|
89 |
}
|
90 |
m_havedoc = true;
|
90 |
m_havedoc = true;
|
91 |
return true;
|
91 |
return true;
|
92 |
}
|
92 |
}
|
93 |
|
93 |
|
94 |
bool MimeHandlerText::set_document_string(const string& otext)
|
94 |
bool MimeHandlerText::set_document_string(const string& mt, const string& otext)
|
95 |
{
|
95 |
{
|
|
|
96 |
RecollFilter::set_document_string(mt, otext);
|
96 |
m_text = otext;
|
97 |
m_text = otext;
|
97 |
if (!m_forPreview) {
|
98 |
if (!m_forPreview) {
|
98 |
string md5, xmd5;
|
99 |
string md5, xmd5;
|
99 |
MD5String(m_text, md5);
|
100 |
MD5String(m_text, md5);
|
100 |
m_metaData[cstr_dj_keymd5] = MD5HexPrint(md5, xmd5);
|
101 |
m_metaData[cstr_dj_keymd5] = MD5HexPrint(md5, xmd5);
|