checkpoint after long pause
This commit is contained in:
parent
670d7c2630
commit
6f66d9cb37
@ -1,7 +1,9 @@
|
||||
include ../mk/sysconf
|
||||
|
||||
LIBS = libmime.a
|
||||
all: $(LIBS)
|
||||
PROGS = trbinc
|
||||
|
||||
all: $(LIBS) $(PROGS)
|
||||
|
||||
SRCS = mime-getpart.cc mime-parsefull.cc mime-parseonlyheader.cc \
|
||||
mime-printbody.cc mime-printdoc.cc mime-printheader.cc mime.cc \
|
||||
@ -18,6 +20,9 @@ libmime.a : $(OBJS)
|
||||
.cc .o :
|
||||
$(CXX) $(CXXFLAGS) -c $<
|
||||
|
||||
TRBINCOBJS = trbinc.o
|
||||
trbinc: trbinc.o
|
||||
$(CXX) -o trbinc trbinc.o libmime.a
|
||||
|
||||
clean:
|
||||
rm -f *.o $(LIBS)
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
*/
|
||||
#include "iodevice.h"
|
||||
#include "convert.h" // BincStream
|
||||
#include "session.h" // getEnv/hasEnv
|
||||
//#include "session.h" // getEnv/hasEnv
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@ -306,6 +306,7 @@ unsigned int IODevice::getWriteCount(void) const
|
||||
//------------------------------------------------------------------------
|
||||
void IODevice::enableProtocolDumping(void)
|
||||
{
|
||||
#if 0
|
||||
BincStream ss;
|
||||
ss << "/tmp/bincimap-dump-" << (int) time(0) << "-"
|
||||
<< Session::getInstance().getIP() << "-XXXXXX";
|
||||
@ -314,4 +315,5 @@ void IODevice::enableProtocolDumping(void)
|
||||
if (dumpfd == -1)
|
||||
dumpfd = 0;
|
||||
delete safename;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.6 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.7 2005-03-17 14:02:05 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
@ -139,7 +139,7 @@ DbIndexer::processone(const std::string &fn, const struct stat *stp,
|
||||
|
||||
// Set up common fields:
|
||||
char ascdate[20];
|
||||
sprintf(ascdate, "%ld", long(stp->st_mtime));
|
||||
sprintf(ascdate, "%ld", long(stp->st_ctime));
|
||||
doc.mtime = ascdate;
|
||||
|
||||
// Do database-specific work to update document data
|
||||
|
||||
@ -31,6 +31,7 @@ using std::pair;
|
||||
#include "internfile.h"
|
||||
#include "textsplit.h"
|
||||
#include "smallut.h"
|
||||
#include "utf8iter.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(A,B) ((A) < (B) ? (A) : (B))
|
||||
@ -49,7 +50,7 @@ void RecollMain::checkExit()
|
||||
if (indexingstatus) {
|
||||
indexingstatus = false;
|
||||
// Make sure we reopen the db to get the results.
|
||||
fprintf(stderr, "Indexing done: closing query database\n");
|
||||
LOGINFO(("Indexing done: closing query database\n"));
|
||||
rcldb->close();
|
||||
}
|
||||
if (recollNeedsExit)
|
||||
@ -91,6 +92,7 @@ static string plaintorich(const string &in, const list<string>& terms,
|
||||
myTextSplitCB cb(terms);
|
||||
TextSplit splitter(&cb, true);
|
||||
splitter.text_to_words(in);
|
||||
bool ateol = false;
|
||||
string out = "<qt><head><title></title></head><body><p>";
|
||||
list<pair<int, int> >::iterator it = cb.tboffs.begin();
|
||||
for (unsigned int i = 0; i < in.length(); i++) {
|
||||
@ -104,8 +106,11 @@ static string plaintorich(const string &in, const list<string>& terms,
|
||||
}
|
||||
}
|
||||
if (in[i] == '\n') {
|
||||
out += "<br>\n";
|
||||
if (!ateol)
|
||||
out += "<br>";
|
||||
ateol = true;
|
||||
} else {
|
||||
ateol = false;
|
||||
out += in[i];
|
||||
}
|
||||
}
|
||||
@ -149,9 +154,9 @@ void RecollMain::reslistTE_doubleClicked(int par, int)
|
||||
if (*it1 == '%')
|
||||
ncmd += '%';
|
||||
if (*it1 == 'u')
|
||||
ncmd += doc.url;
|
||||
ncmd += "'" + doc.url + "'";
|
||||
if (*it1 == 'f')
|
||||
ncmd += fn;
|
||||
ncmd += "'" + fn + "'";
|
||||
} else {
|
||||
ncmd += *it1;
|
||||
}
|
||||
@ -170,10 +175,6 @@ void RecollMain::reslistTE_clicked(int par, int car)
|
||||
if (reslist_winfirst == -1)
|
||||
return;
|
||||
|
||||
// If same doc, don't bother redisplaying
|
||||
if (reslist_current == par - 1)
|
||||
return;
|
||||
|
||||
Rcl::Doc doc;
|
||||
if (reslist_current != -1) {
|
||||
QColor color("white");
|
||||
@ -217,13 +218,23 @@ void RecollMain::reslistTE_clicked(int par, int car)
|
||||
int para = 0, index = 1;
|
||||
if (!termoffsets.empty()) {
|
||||
index = (termoffsets.begin())->first;
|
||||
LOGDEB1(("Setting cursor position to para %d, index %d\n",para,index));
|
||||
LOGDEB(("Byte index: %d\n", index));
|
||||
// Translate byte to character offset
|
||||
string::size_type pos = 0;
|
||||
Utf8Iter it(rich);
|
||||
for (; pos != string::npos && (int)pos < index; it++) {
|
||||
pos = it.getBpos();
|
||||
}
|
||||
index = pos == string::npos ? 0 : it.getCpos();
|
||||
LOGDEB(("Setting cursor position to para %d, charindex %d\n",
|
||||
para,index));
|
||||
previewTextEdit->setCursorPosition(0, index);
|
||||
}
|
||||
previewTextEdit->ensureCursorVisible();
|
||||
previewTextEdit->getCursorPosition(¶, &index);
|
||||
LOGDEB1(("PREVIEW Paragraphs: %d. Cpos: %d %d\n",
|
||||
previewTextEdit->paragraphs(), para, index));
|
||||
LOGDEB(("PREVIEW len %d paragraphs: %d. Cpos: %d %d\n",
|
||||
previewTextEdit->length(), previewTextEdit->paragraphs(),
|
||||
para, index));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# @(#$Id: mimeconf,v 1.3 2005-02-09 12:07:30 dockes Exp $ (C) 2004 J.F.Dockes
|
||||
# @(#$Id: mimeconf,v 1.4 2005-03-17 14:02:05 dockes Exp $ (C) 2004 J.F.Dockes
|
||||
|
||||
# Recoll : associations of mime types to processing filters.
|
||||
# There are different sections for decompression, 'interning' for indexing
|
||||
@ -49,8 +49,7 @@ text/plain = xemacs %f
|
||||
text/html = firefox -a firefox -remote "openFile(%u)"
|
||||
application/pdf = xpdf %f
|
||||
application/postscript = gv %f
|
||||
application/msword = openoffice-1.1.3-swriter
|
||||
|
||||
application/msword = openoffice-1.1.3-swriter %f
|
||||
application/vnd.sun.xml.calc = openoffice-1.1.3 %f
|
||||
application/vnd.sun.xml.calc.template = openoffice-1.1.3 %f
|
||||
application/vnd.sun.xml.draw = openoffice-1.1.3 %f
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.5 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.6 2005-03-17 14:02:05 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
#ifndef TEST_EXECMD
|
||||
#include <unistd.h>
|
||||
@ -22,7 +22,7 @@ using namespace std;
|
||||
#define MAX(A,B) (A>B?A:B)
|
||||
|
||||
int
|
||||
ExecCmd::doexec(const string &cmd, const list<string> args,
|
||||
ExecCmd::doexec(const string &cmd, const list<string>& args,
|
||||
const string *input, string *output)
|
||||
{
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#ifndef _EXECMD_H_INCLUDED_
|
||||
#define _EXECMD_H_INCLUDED_
|
||||
/* @(#$Id: execmd.h,v 1.1 2004-12-12 08:58:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: execmd.h,v 1.2 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@ -9,7 +9,7 @@ class ExecCmd {
|
||||
public:
|
||||
// ExecCmd() : argv(0) {};
|
||||
// ~ExeCmd() {delete [] argv;}
|
||||
int doexec(const std::string &cmd, const std::list<std::string> a,
|
||||
int doexec(const std::string &cmd, const std::list<std::string>& a,
|
||||
const std::string *input = 0,
|
||||
std::string *output = 0);
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.1 2005-01-26 11:45:55 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.2 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#ifndef TEST_MIMEPARSE
|
||||
@ -36,7 +36,7 @@ MimeHeaderValue parseMimeHeaderValue(const string &ein)
|
||||
{
|
||||
string in = ein;
|
||||
MimeHeaderValue out;
|
||||
string::size_type pos, pos1;
|
||||
string::size_type pos;
|
||||
|
||||
pos = in.find_first_not_of(WHITE);
|
||||
if (pos == string::npos)
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.4 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.5 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
#ifndef TEST_SMALLUT
|
||||
#include <string>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@ -12,6 +14,8 @@ static char rcsid[] = "@(#$Id: smallut.cpp,v 1.4 2005-02-10 15:21:12 dockes Exp
|
||||
#include "debuglog.h"
|
||||
#include "pathut.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define MIN(A,B) ((A)<(B)?(A):(B))
|
||||
|
||||
bool maketmpdir(string& tdir)
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
#ifndef _SMALLUT_H_INCLUDED_
|
||||
#define _SMALLUT_H_INCLUDED_
|
||||
/* @(#$Id: smallut.h,v 1.4 2005-02-10 15:21:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: smallut.h,v 1.5 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <ostream>
|
||||
using std::string;
|
||||
using std::list;
|
||||
|
||||
using std::ostream;
|
||||
extern int stringicmp(const string& s1, const string& s2);
|
||||
extern int stringlowercmp(const string& alreadylower, const string& s2);
|
||||
extern int stringuppercmp(const string& alreadyupper, const string& s2);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#ifndef _UTF8ITER_H_INCLUDED_
|
||||
#define _UTF8ITER_H_INCLUDED_
|
||||
/* @(#$Id: utf8iter.h,v 1.2 2005-02-11 11:20:02 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: utf8iter.h,v 1.3 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
/**
|
||||
* A small helper class to iterate over utf8 strings. This is not an
|
||||
@ -117,9 +117,10 @@ class Utf8Iter {
|
||||
return (unsigned int)-1;
|
||||
}
|
||||
|
||||
/** Set current position before next utf-8 character */
|
||||
string::size_type operator++(int) {
|
||||
if (bad || (!cl && compute_cl() < 0)) {
|
||||
return string::npos;
|
||||
return pos = string::npos;
|
||||
}
|
||||
pos += cl;
|
||||
m_charpos++;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user