merged 1.6 maint branch modifs up to MERGED_TO_TRUNK_20061130

This commit is contained in:
dockes
2006-11-30 13:38:44 +00:00
parent 03b6f05f23
commit 72fd14f208
46 changed files with 417 additions and 245 deletions
+17 -4
View File
@@ -396,7 +396,7 @@ More documentation can be found in the doc/ directory or at http://www.recoll.or
Starting and stopping the daemon could be performed, for example, as part
of the user session script. For example, my out of fashion xdm-based
session has an .xsession script with the following lines at the end:
session has a .xsession script with the following lines at the end:
recollconf=$HOME/.recoll-home
recolldata=/usr/local/share/recoll
@@ -412,6 +412,15 @@ More documentation can be found in the doc/ directory or at http://www.recoll.or
for your flavour of session management, and of course, there are other
possibilities.
Under KDE, you can place a small script to start recollindex -m under
$HOME/.kde/Autostart. This will be executed when the session begins, and
the process seems to get a SIGHUP signal and be terminated when the
session ends.
There is a similar mechanism under Gnome (find the session control tool in
the menus and use the "Startup programs" tab). I could find an easy way to
stop recollindex at the end of the session though.
By default, the indexing daemon will write its messages to a file inside
the configuration directory (this is controlled by the daemlogfilename and
daemloglevel configuration parameters). You may want to change this. Also
@@ -852,13 +861,17 @@ More documentation can be found in the doc/ directory or at http://www.recoll.or
%A %K
You may, for example, try the following for a more web-like experience
(but the document title will not act as a link):
You may, for example, try the following for a more web-like
experience:
<u><b><font size=+1 color=#1111cf>%T</font></b></u><br>
<u><b><a href="P%N">%T</a></b></u><br>
%A<font color=#008000>%U - %S</font> - %L
The format of the Preview and Edit links is <a href="Pdocnum"> and <a
href="Edocnum"> where docnum is what %N would print. This makes the
title a preview link in the above format.
* HTML help browser: this will let you chose your preferred browser
which will be started from the Help menu to read the user manual. You
can enter a simple name if the command is in your PATH, or browse for
+11 -9
View File
@@ -1,6 +1,6 @@
#ifndef TEST_RCLASPELL
#ifndef lint
static char rcsid[] = "@(#$Id: rclaspell.cpp,v 1.5 2006-11-21 13:05:16 dockes Exp $ (C) 2006 J.F.Dockes";
static char rcsid[] = "@(#$Id: rclaspell.cpp,v 1.6 2006-11-30 13:38:43 dockes Exp $ (C) 2006 J.F.Dockes";
#endif
#ifdef HAVE_CONFIG_H
#include "autoconfig.h"
@@ -101,11 +101,6 @@ bool Aspell::init(string &reason)
if (!lang.compare("C"))
lang = "en";
m_lang = lang.substr(0, lang.find_first_of("_"));
} else {
if (!m_lang.compare("disable")) {
reason = "Aspell disabled in recoll configuration file";
return false;
}
}
m_data = new AspellData;
@@ -192,6 +187,11 @@ string Aspell::dicPath()
}
// The data source for the create dictionary aspell command. We walk
// the term list, filtering out things that are probably not words.
// Note that the manual for the current version (0.60) of aspell
// states that utf-8 is not well supported, so that we should maybe
// also filter all 8bit chars.
class AspExecPv : public ExecCmdProvide {
public:
string *m_input; // pointer to string used as input buffer to command
@@ -203,12 +203,13 @@ public:
void newData() {
while (m_db.termWalkNext(m_tit, *m_input)) {
// Filter out terms beginning with upper case (special stuff) and
// containing numbers
if (m_input->empty())
// containing numbers, or too long. Note that the 50 limit is a
// byte count, so not so high if there are multibyte chars.
if (m_input->empty() || m_input->length() > 50)
continue;
if ('A' <= m_input->at(0) && m_input->at(0) <= 'Z')
continue;
if (m_input->find_first_of("0123456789+-._@") != string::npos)
if (m_input->find_first_of("0123456789.@+-,#_") != string::npos)
continue;
// Got a non-empty sort-of appropriate term, let's send it to
// aspell
@@ -231,6 +232,7 @@ bool Aspell::buildDict(Rcl::Db &db, string &reason)
ExecCmd aspell;
list<string> args;
args.push_back(string("--lang=")+ m_lang);
args.push_back("--encoding=utf-8");
args.push_back("create");
args.push_back("master");
args.push_back(dicPath());
+23 -5
View File
@@ -24,7 +24,7 @@
Dockes</holder>
</copyright>
<releaseinfo>$Id: usermanual.sgml,v 1.27 2006-11-21 09:18:21 dockes Exp $</releaseinfo>
<releaseinfo>$Id: usermanual.sgml,v 1.28 2006-11-30 13:38:43 dockes Exp $</releaseinfo>
<abstract>
<para>This document introduces full text search notions
@@ -441,8 +441,9 @@ recoll
<para>Starting and stopping the daemon could be performed, for
example, as part of the user session script. For example, my
out of fashion xdm-based session has an .xsession script with
the following lines at the end:</para>
out of fashion xdm-based session has a
<filename>.xsession</filename> script with the following lines
at the end:</para>
<programlisting>recollconf=$HOME/.recoll-home
recolldata=/usr/local/share/recoll
@@ -459,6 +460,17 @@ RECOLL_CONFDIR=$recollconf $recolldata/examples/rclmon.sh stop
exit). This should be adjusted for your flavour of session
management, and of course, there are other possibilities.</para>
<para>Under KDE, you can place a small script to start
<command>recollindex -m</command> under
<filename>$HOME/.kde/Autostart</filename>. This will be executed
when the session begins, and the process seems to get a SIGHUP
signal and be terminated when the session ends.</para>
<para>There is a similar mechanism under Gnome (find the session
control tool in the menus and use the "Startup programs" tab). I
could find an easy way to stop <command>recollindex</command> at
the end of the session though.</para>
<para>By default, the indexing daemon will write its messages to
a file inside the configuration directory (this is controlled by
the <literal>daemlogfilename</literal> and
@@ -1049,10 +1061,16 @@ RECOLL_CONFDIR=$recollconf $recolldata/examples/rclmon.sh stop
%A %K
</programlisting>
You may, for example, try the following for a more web-like
experience (but the document title will not act as a link):
<programlisting>&lt;u>&lt;b>&lt;font size=+1 color=#1111cf>%T&lt;/font>&lt;/b>&lt;/u>&lt;br>
experience:
<programlisting>&lt;u>&lt;b>&lt;a href="P%N"&gt;%T&lt;/a&gt;&lt;/b>&lt;/u>&lt;br>
%A&lt;font color=#008000>%U - %S&lt;/font> - %L
</programlisting>
The format of the Preview and Edit links is
<literal>&lt;a href="P<replaceable>docnum</replaceable>"&gt;</literal>
and
<literal>&lt;a href="E<replaceable>docnum</replaceable>"&gt;</literal>
where <replaceable>docnum</replaceable> is what %N would
print. This makes the title a preview link in the above format.
</para>
</listitem>
+12 -5
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.44 2006-11-07 06:41:44 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.45 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -161,14 +161,16 @@ bool DbIndexer::createStemmingDatabases()
return true;
}
bool DbIndexer::init(bool resetbefore)
bool DbIndexer::init(bool resetbefore, bool rdonly)
{
if (m_tmpdir.empty() || access(m_tmpdir.c_str(), 0) < 0)
if (!maketmpdir(m_tmpdir)) {
LOGERR(("DbIndexer: cannot create temporary directory\n"));
return false;
}
if (!m_db.open(m_dbdir, resetbefore ? Rcl::Db::DbTrunc : Rcl::Db::DbUpd)) {
Rcl::Db::OpenMode mode = rdonly ? Rcl::Db::DbRO :
resetbefore ? Rcl::Db::DbTrunc : Rcl::Db::DbUpd;
if (!m_db.open(m_dbdir, mode)) {
LOGERR(("DbIndexer: error opening database in %s\n", m_dbdir.c_str()));
return false;
}
@@ -177,7 +179,7 @@ bool DbIndexer::init(bool resetbefore)
bool DbIndexer::createStemDb(const string &lang)
{
if (!init())
if (!init(false, true))
return false;
return m_db.createStemDb(lang);
}
@@ -188,7 +190,12 @@ bool DbIndexer::createAspellDict()
{
LOGDEB2(("DbIndexer::createAspellDict()\n"));
#ifdef RCL_USE_ASPELL
if (!init())
bool noaspell = false;
m_config->getConfParam("noaspell", &noaspell);
if (noaspell)
return true;
if (!init(false, true))
return false;
Aspell aspell(m_config);
string reason;
+2 -2
View File
@@ -16,7 +16,7 @@
*/
#ifndef _INDEXER_H_INCLUDED_
#define _INDEXER_H_INCLUDED_
/* @(#$Id: indexer.h,v 1.21 2006-10-24 14:28:38 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: indexer.h,v 1.22 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
@@ -144,7 +144,7 @@ class DbIndexer : public FsTreeWalkerCB {
string m_tmpdir;
DbIxStatusUpdater *m_updater;
bool init(bool rst = false);
bool init(bool rst = false, bool rdonly = false);
};
/** Helper methods in recollindex.cpp for initial checks/setup to index
+2 -1
View File
@@ -1,5 +1,5 @@
#!/bin/sh
# @(#$Id: makesrcdist.sh,v 1.11 2006-10-09 16:37:08 dockes Exp $ (C) 2005 J.F.Dockes
# @(#$Id: makesrcdist.sh,v 1.12 2006-11-30 13:38:43 dockes Exp $ (C) 2005 J.F.Dockes
# A shell-script to make a recoll source distribution
#set -x
@@ -61,6 +61,7 @@ cvs commit -m '' README INSTALL
# Clean up this dir and copy the dist-specific files
make clean
yes | clean.O
rm -f lib/*.dep
$TAR chfX - excludefile . | (cd $topdir;$TAR xf -)
# Fix the single/multiple page link in the header (we dont deliver the
+2 -1
View File
@@ -37,7 +37,8 @@ strip index/recollindex qtgui/recoll
files="COPYING README INSTALL VERSION Makefile recoll.desktop recollinstall
filters sampleconf doc/user doc/man
index/recollindex qtgui/recoll qtgui/i18n/*.qm qtgui/mtpics/*.png recoll.png"
index/recollindex index/rclmon.sh qtgui/recoll qtgui/i18n/*.qm
qtgui/mtpics/*.png recoll.png"
$TAR chf - $files | (cd $topdir; $TAR xf -)
+1 -1
View File
@@ -7,4 +7,4 @@ ALL_CXXFLAGS = $(CXXFLAGS) $(COMMONCXXFLAGS) $(LOCALCXXFLAGS) \
CC = gcc
CXX = g++
LIBSYS = -lpthread -lnsl -lsocket
LIBSYS = -lpthread -lnsl -lsocket -ldl
+27 -23
View File
@@ -19,6 +19,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>4</number>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout18</cstring>
@@ -43,23 +46,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
<property name="spacing">
<number>2</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2</cstring>
@@ -79,7 +68,7 @@
<enum>Plain</enum>
</property>
<property name="margin">
<number>7</number>
<number>4</number>
</property>
<property name="text">
<string>Search for &lt;br&gt;documents&lt;br&gt;satisfying:</string>
@@ -113,8 +102,8 @@
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>16</height>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
@@ -166,6 +155,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="spacing">
<number>2</number>
</property>
<widget class="Line">
<property name="name">
<cstring>clauseline</cstring>
@@ -229,6 +221,9 @@
<property name="text">
<string>Save as default</string>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
@@ -237,7 +232,7 @@
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout12</cstring>
<cstring>filTypHB</cstring>
</property>
<hbox>
<property name="name">
@@ -251,6 +246,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="spacing">
<number>0</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2_2</cstring>
@@ -269,7 +267,7 @@
<property name="minimumSize">
<size>
<width>200</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="selectionMode">
@@ -286,6 +284,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="spacing">
<number>2</number>
</property>
<widget class="QPushButton">
<property name="name">
<cstring>delAFiltypPB</cstring>
@@ -352,6 +353,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="spacing">
<number>0</number>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel3</cstring>
@@ -370,7 +374,7 @@
<property name="minimumSize">
<size>
<width>200</width>
<height>80</height>
<height>20</height>
</size>
</property>
<property name="selectionMode">
+11 -6
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.12 2006-11-17 15:26:40 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.13 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -49,7 +49,7 @@ using std::string;
extern RclConfig *rclconfig;
static const int initclausetypes[] = {1, 3, 0, 0, 2, 5};
static const int initclausetypes[] = {1, 3, 0, 2, 5};
static const unsigned int iclausescnt = sizeof(initclausetypes) / sizeof(int);
void AdvSearch::init()
@@ -176,6 +176,10 @@ void AdvSearch::addClause()
{
addClause(0);
}
#define HORADJ 50
#define VERTADJ 30
void AdvSearch::addClause(int tp)
{
SearchClauseW *w = new SearchClauseW(this);
@@ -192,7 +196,7 @@ void AdvSearch::addClause(int tp)
}
// Have to adjust the size else we lose the bottom buttons! Why?
QSize sz = AdvSearchBaseLayout->sizeHint();
resize(QSize(sz.width()+40, sz.height()+80));
resize(QSize(sz.width()+HORADJ, sz.height()+VERTADJ));
}
void AdvSearch::delClause()
@@ -207,14 +211,14 @@ void AdvSearch::delClause()
delClausePB->setEnabled(false);
}
QSize sz = AdvSearchBaseLayout->sizeHint();
resize(QSize(sz.width()+40, sz.height()+80));
resize(QSize(sz.width()+HORADJ, sz.height()+VERTADJ));
}
void AdvSearch::polish()
{
QSize sz = AdvSearchBaseLayout->sizeHint();
resize(QSize(sz.width()+40, sz.height()+80));
AdvSearchBase::polish();
QSize sz = sizeHint();
resize(QSize(sz.width()+HORADJ+10, sz.height()+VERTADJ-20));
}
// Move selected file types from the ignored to the searched box
@@ -255,6 +259,7 @@ void AdvSearch::restrictFtCB_toggled(bool on)
delAFiltypPB->setEnabled(on);
addAFiltypPB->setEnabled(on);
noFiltypsLB->setEnabled(on);
saveFileTypesPB->setEnabled(on);
}
using namespace Rcl;
+8 -6
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.25 2006-11-21 08:47:51 dockes Exp $ (C) 2005 Jean-Francois Dockes";
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.26 2006-11-30 13:38:44 dockes Exp $ (C) 2005 Jean-Francois Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -149,8 +149,10 @@ void rwSettings(bool writing)
QSettings settings;
settings.setPath("Recoll.org", "Recoll", QSettings::User);
#endif
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Num, 500);
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Num, 400);
SETTING_RW(prefs.mainwidth, "/Recoll/geometry/width", Num, 0);
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Num, 0);
SETTING_RW(prefs.pvwidth, "/Recoll/geometry/pvwidth", Num, 0);
SETTING_RW(prefs.pvheight, "/Recoll/geometry/pvheight", Num, 0);
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Num, 0);
SETTING_RW(prefs.htmlBrowser, "/Recoll/prefs/htmlBrowser", , "");
SETTING_RW(prefs.startWithAdvSearchOpen,
@@ -159,7 +161,7 @@ void rwSettings(bool writing)
"/Recoll/prefs/startWithSortToolOpen", Bool, false);
QString advSearchClauses;
QString ascdflt = QString::fromAscii("1 3 0 0 2 5 ");
QString ascdflt;
if (writing) {
for (vector<int>::iterator it = prefs.advSearchClauses.begin();
it != prefs.advSearchClauses.end(); it++) {
@@ -185,9 +187,9 @@ void rwSettings(bool writing)
"/Recoll/prefs/ssearchAutoPhrase", Bool, false);
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily", ,
"");
"Helvetica");
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Num,
0);
10);
QString rlfDflt =
QString::fromAscii("%R %S %L &nbsp;&nbsp;<b>%T</b><br>"
"%M&nbsp;%D&nbsp;&nbsp;&nbsp;<i>%U</i><br>"
+3 -1
View File
@@ -17,7 +17,7 @@
#ifndef _GUIUTILS_H_INCLUDED_
#define _GUIUTILS_H_INCLUDED_
/*
* @(#$Id: guiutils.h,v 1.17 2006-11-21 08:47:51 dockes Exp $ (C) 2005 Jean-Francois Dockes
* @(#$Id: guiutils.h,v 1.18 2006-11-30 13:38:44 dockes Exp $ (C) 2005 Jean-Francois Dockes
* jean-francois.dockes@wanadoo.fr
*
* This program is free software; you can redistribute it and/or modify
@@ -71,6 +71,8 @@ class PrefsPack {
QString queryStemLang;
int mainwidth;
int mainheight;
int pvwidth; // Preview window geom
int pvheight;
int ssearchTyp;
QString htmlBrowser;
bool queryBuildAbstract;
+4
View File
@@ -223,6 +223,10 @@ Click Cancel if you want to edit the configuration file before indexation starts
<source>Cancel</source>
<translation>Annuler</translation>
</message>
<message>
<source>Close Tab</source>
<translation>Fermer l&apos;onglet</translation>
</message>
</context>
<context>
<name>PreviewBase</name>
+4
View File
@@ -224,6 +224,10 @@ Click Cancel if you want to edit the configuration file before indexation starts
<source>Cancel</source>
<translation>Отмена</translation>
</message>
<message>
<source>Close Tab</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreviewBase</name>
+4
View File
@@ -221,6 +221,10 @@ Click Cancel if you want to edit the configuration file before indexation starts
<source>Loading preview text into editor</source>
<translation>Завантажую текст перегляду в редактор</translation>
</message>
<message>
<source>Close Tab</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PreviewBase</name>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 883 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+5 -4
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: main.cpp,v 1.52 2006-10-11 14:16:26 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: main.cpp,v 1.53 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -270,10 +270,11 @@ int main(int argc, char **argv)
RclMain w;
mainWindow = &w;
#endif
QSize s(prefs.mainwidth, prefs.mainheight);
mainWindow->resize(s);
// fprintf(stderr, "Main win created\n");
if (prefs.mainwidth > 100) {
QSize s(prefs.mainwidth, prefs.mainheight);
mainWindow->resize(s);
}
mainWindow->sSearch->searchTypCMB->setCurrentItem(prefs.ssearchTyp);
dbdir = rclconfig->getDbDir();
+49 -27
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.17 2006-11-18 12:56:16 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: plaintorich.cpp,v 1.18 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -62,6 +62,8 @@ class myTextSplitCB : public TextSplitCB {
// Out: first query term found in text
string firstTerm;
int firstTermOcc;
int m_firstTermPos;
int m_firstTermBPos;
// Out: begin and end byte positions of query terms/groups in text
vector<pair<int, int> > tboffs;
@@ -96,6 +98,7 @@ class myTextSplitCB : public TextSplitCB {
if (firstTerm.empty()) {
firstTerm = term;
m_firstTermPos = pos;
m_firstTermBPos = bts;
}
}
@@ -117,7 +120,6 @@ private:
virtual bool matchGroup(const vector<string>& terms, int dist);
int m_wcount;
int m_firstTermPos;
// In: user query terms
set<string> m_terms;
@@ -239,6 +241,20 @@ bool myTextSplitCB::matchGroup(const vector<string>& terms, int window)
LOGDEB0(("myTextSplitCB::matchGroup: MATCH [%d,%d]\n", sta, sto));
// Translate the position window into a byte offset window
int bs = 0;
map<int, pair<int, int> >::iterator i1 = m_gpostobytes.find(sta);
map<int, pair<int, int> >::iterator i2 = m_gpostobytes.find(sto);
if (i1 != m_gpostobytes.end() && i2 != m_gpostobytes.end()) {
LOGDEB1(("myTextSplitCB::matchGroup: pushing %d %d\n",
i1->second.first, i2->second.second));
tboffs.push_back(pair<int, int>(i1->second.first, i2->second.second));
bs = i1->second.first;
} else {
LOGDEB(("myTextSplitCB::matchGroup: no bpos found for %d or %d\n",
sta, sto));
}
if (firstTerm.empty() || m_firstTermPos > sta) {
// firsTerm is used to try an position the preview window over
// the match. As it's difficult to divine byte/word positions
@@ -252,31 +268,24 @@ bool myTextSplitCB::matchGroup(const vector<string>& terms, int window)
firstTerm = it->second;
LOGDEB(("myTextSplitCB:: best group term %s, firstTermOcc %d\n",
firstTerm.c_str(), firstTermOcc));
}
// Translate the position window into a byte offset window
map<int, pair<int, int> >::iterator i1 = m_gpostobytes.find(sta);
map<int, pair<int, int> >::iterator i2 = m_gpostobytes.find(sto);
if (i1 != m_gpostobytes.end() && i2 != m_gpostobytes.end()) {
LOGDEB1(("myTextSplitCB::matchGroup: pushing %d %d\n",
i1->second.first, i2->second.second));
tboffs.push_back(pair<int, int>(i1->second.first, i2->second.second));
} else {
LOGDEB(("myTextSplitCB::matchGroup: no bpos found for %d or %d\n",
sta, sto));
m_firstTermPos = sta;
m_firstTermBPos = bs;
}
return true;
}
/** Sort integer pairs by their first value */
/** Sort integer pairs by increasing first value and decreasing width */
class PairIntCmpFirst {
public:
bool operator()(pair<int,int> a, pair<int, int>b) {
return a.first < b.first;
if (a.first != b.first)
return a.first < b.first;
return a.second > b.second;
}
};
// Do the phrase match thing, then merge the highlight lists
bool myTextSplitCB::matchGroups()
{
vector<vector<string> >::const_iterator vit = m_groups.begin();
@@ -285,10 +294,18 @@ bool myTextSplitCB::matchGroups()
matchGroup(*vit, *sit + (*vit).size());
}
// Sort by start and end offsets. The merging of overlapping entries
// will be handled during output.
std::sort(tboffs.begin(), tboffs.end(), PairIntCmpFirst());
return true;
}
const char *firstTermAnchorName = "FIRSTTERM";
#ifdef QT_SCROLL_TO_ANCHOR_BUG
const char *firstTermBeacon = "\xe2\xa0\x91\xe2\x96\x9f\x20\x01\x9a";
#endif
// Fix result text for display inside the gui text window.
//
// To compute the term character positions in the output text, we used
@@ -300,9 +317,7 @@ bool myTextSplitCB::matchGroups()
// editor's find() function to position on it
bool plaintorich(const string& in, string& out,
RefCntr<Rcl::SearchData> sdata,
string *firstTerm,
int *firstTermOcc,
bool noHeader)
bool noHeader, bool fft)
{
Chrono chron;
out.erase();
@@ -338,11 +353,6 @@ bool plaintorich(const string& in, string& out,
cb.matchGroups();
if (firstTerm)
*firstTerm = cb.firstTerm;
if (firstTermOcc)
*firstTermOcc = cb.firstTermOcc;
// Rich text output
if (noHeader)
out = "";
@@ -376,12 +386,24 @@ bool plaintorich(const string& in, string& out,
// If we still have terms positions, check (byte) position
if (tPosIt != tboffsend) {
int ibyteidx = chariter.getBpos();
if (fft && ibyteidx == cb.m_firstTermBPos) {
out += string("<a name=\"") + firstTermAnchorName + "\"> "
#ifdef QT_SCROLL_TO_ANCHOR_BUG
+ "<font color=\"white\"> " + firstTermBeacon + " </font> "
#endif
+ "</a>";
}
if (ibyteidx == tPosIt->first) {
out += "<termtag>";
} else if (ibyteidx == tPosIt->second) {
if (tPosIt != cb.tboffs.end())
tPosIt++;
// Output end tag, then skip all highlight areas that
// would overlap this one
out += "</termtag>";
int crend = tPosIt->second;
while (tPosIt != cb.tboffs.end() && tPosIt->first < crend)
tPosIt++;
}
}
switch(*chariter) {
@@ -414,7 +436,7 @@ bool plaintorich(const string& in, string& out,
}
#if 0
{
FILE *fp = fopen("/tmp/debugplaintorich", "w");
FILE *fp = fopen("/tmp/debugplaintorich", "a");
fprintf(fp, "%s\n", out.c_str());
fclose(fp);
}
+12 -3
View File
@@ -16,7 +16,7 @@
*/
#ifndef _PLAINTORICH_H_INCLUDED_
#define _PLAINTORICH_H_INCLUDED_
/* @(#$Id: plaintorich.h,v 1.10 2006-11-18 12:31:16 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: plaintorich.h,v 1.11 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
@@ -38,7 +38,16 @@
*/
extern bool plaintorich(const string &in, string &out,
RefCntr<Rcl::SearchData> sdata,
string* firstTerm, int *frsttocc,
bool noHeader = false);
bool noHeader = false,
bool fft = false);
extern const char *firstTermAnchorName;
#define QT_SCROLL_TO_ANCHOR_BUG
#ifdef QT_SCROLL_TO_ANCHOR_BUG
// For some reason, can't get scrollToAnchor() to work. We use a string made
// of a few rare utf8 chars as a beacon for the match area.
extern const char *firstTermBeacon;
#endif
#endif /* _PLAINTORICH_H_INCLUDED_ */
+8 -8
View File
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>751</width>
<height>727</height>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="sizePolicy">
@@ -20,12 +20,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>30</height>
</size>
</property>
<property name="caption">
<string>Preview</string>
</property>
@@ -33,6 +27,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>4</number>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout4</cstring>
@@ -56,6 +53,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<widget class="QTextEdit">
<property name="name">
<cstring>pvEdit</cstring>
+34 -21
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.7 2006-11-18 12:31:16 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.8 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -58,6 +58,18 @@ using std::pair;
void Preview::init()
{
#if 0
// Couldn't get a small button really in the corner. stays on the left of
// the button area and looks ugly
QPixmap px = QPixmap::fromMimeSource("cancel.png");
QPushButton * bt = new QPushButton(px, "", this);
bt->setFixedSize(px.size());
#else
QPushButton * bt = new QPushButton(tr("Close Tab"), this);
#endif
pvTab->setCornerWidget(bt);
// signals and slots connections
connect(searchTextLine, SIGNAL(textChanged(const QString&)),
this, SLOT(searchTextLine_textChanged(const QString&)));
@@ -66,12 +78,16 @@ void Preview::init()
connect(clearPB, SIGNAL(clicked()), searchTextLine, SLOT(clear()));
connect(pvTab, SIGNAL(currentChanged(QWidget *)),
this, SLOT(currentChanged(QWidget *)));
connect(bt, SIGNAL(clicked()), this, SLOT(closeCurrentTab()));
searchTextLine->installEventFilter(this);
dynSearchActive = false;
canBeep = true;
tabData.push_back(TabData(pvTab->currentPage()));
currentW = 0;
if (prefs.pvwidth > 100) {
resize(prefs.pvwidth, prefs.pvheight);
}
}
void Preview::destroy()
@@ -80,6 +96,8 @@ void Preview::destroy()
void Preview::closeEvent(QCloseEvent *e)
{
prefs.pvwidth = width();
prefs.pvheight = height();
emit previewExposed(m_searchId, -1);
emit previewClosed((QWidget *)this);
QWidget::closeEvent(e);
@@ -450,15 +468,11 @@ class LoadThread : public QThread {
class ToRichThread : public QThread {
string &in;
RefCntr<Rcl::SearchData> m_searchData;
string& firstTerm;
int& firstTermOcc;
QString &out;
int loglevel;
public:
ToRichThread(string &i, RefCntr<Rcl::SearchData> searchData,
string& ft, int& fto, QString &o)
: in(i), m_searchData(searchData), firstTerm(ft), firstTermOcc(fto),
out(o)
ToRichThread(string &i, RefCntr<Rcl::SearchData> searchData, QString &o)
: in(i), m_searchData(searchData), out(o)
{
loglevel = DebugLog::getdbl()->getlevel();
}
@@ -467,7 +481,7 @@ class ToRichThread : public QThread {
DebugLog::getdbl()->setloglevel(loglevel);
string rich;
try {
plaintorich(in, rich, m_searchData, &firstTerm, &firstTermOcc);
plaintorich(in, rich, m_searchData, false, true);
} catch (CancelExcept) {
}
out = QString::fromUtf8(rich.c_str(), rich.length());
@@ -548,12 +562,9 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
// Create preview text: highlight search terms (if not too big):
QString richTxt;
bool highlightTerms = fdoc.text.length() < 1000 *1024;
string firstTerm;
int firstTermOcc;
if (highlightTerms) {
progress.setLabelText(tr("Creating preview text"));
ToRichThread rthr(fdoc.text, m_searchData, firstTerm, firstTermOcc,
richTxt);
ToRichThread rthr(fdoc.text, m_searchData, richTxt);
rthr.start();
for (;;prog++) {
@@ -618,6 +629,7 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
editor->setCursorPosition(0,0);
editor->ensureCursorVisible();
}
if (progress.wasCanceled()) {
cancel = true;
editor->append("<b>Cancelled !</b>");
@@ -630,15 +642,16 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
canBeep = true;
doSearch(searchTextLine->text(), true, false);
} else {
if (!firstTerm.empty()) {
bool wasC = matchCheck->isChecked();
matchCheck->setChecked(false);
for (int i = 0; i < firstTermOcc; i++) {
doSearch(QString::fromUtf8(firstTerm.c_str()), i,
false, true);
}
matchCheck->setChecked(wasC);
}
QString aname = QString::fromUtf8(firstTermAnchorName);
LOGDEB2(("Calling scrolltoanchor [%s]\n", (const char *)aname.utf8()));
editor->scrollToAnchor(aname);
#ifdef QT_SCROLL_TO_ANCHOR_BUG
bool wasC = matchCheck->isChecked();
matchCheck->setChecked(false);
doSearch(QString::fromUtf8(firstTermBeacon), 0, false, false);
editor->del();
matchCheck->setChecked(wasC);
#endif
}
emit(previewExposed(m_searchId, docnum));
return true;
+8 -8
View File
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>681</width>
<height>244</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="sizePolicy">
@@ -20,12 +20,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>25</width>
<height>244</height>
</size>
</property>
<property name="caption">
<string>Recoll</string>
</property>
@@ -33,6 +27,12 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>4</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>unnamed</cstring>
+3
View File
@@ -68,5 +68,8 @@ UNAME = $$system(uname -s)
contains( UNAME, [lL]inux ) {
LIBS -= -liconv
}
contains( UNAME, SunOS ) {
LIBS += -ldl
}
TRANSLATIONS = i18n/recoll_fr.ts i18n/recoll_ru.ts i18n/recoll_uk.ts
+12 -6
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.12 2006-11-18 12:31:16 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.13 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
#include <time.h>
@@ -352,7 +352,8 @@ void ResList::resultPageNext()
// Result number
char numbuf[20];
sprintf(numbuf, "%.2d", m_winfirst+1+i);
int docnumforlinks = m_winfirst+1+i;
sprintf(numbuf, "%d", docnumforlinks);
// Document date: either doc or file modification time
char datebuf[100];
@@ -361,7 +362,11 @@ void ResList::resultPageNext()
time_t mtime = doc.dmtime.empty() ?
atol(doc.fmtime.c_str()) : atol(doc.dmtime.c_str());
struct tm *tm = localtime(&mtime);
#ifndef sun
strftime(datebuf, 99, "&nbsp;%Y-%m-%d&nbsp;%H:%M:%S&nbsp;%z", tm);
#else
strftime(datebuf, 99, "&nbsp;%Y-%m-%d&nbsp;%H:%M:%S&nbsp;%Z", tm);
#endif
}
// Size information. We print both doc and file if they differ a lot
@@ -381,18 +386,18 @@ void ResList::resultPageNext()
// Abstract
string abst;
plaintorich(doc.abstract, abst, m_searchData, 0, 0, true);
plaintorich(doc.abstract, abst, m_searchData, true);
// Links;
string linksbuf;
char vlbuf[100];
if (canIntern(doc.mimetype, rclconfig)) {
sprintf(vlbuf, "\"P%d\"", m_winfirst+i);
sprintf(vlbuf, "\"P%d\"", docnumforlinks);
linksbuf += string("<a href=") + vlbuf + ">" + "Preview" + "</a>"
+ "&nbsp;&nbsp;";
}
if (!rclconfig->getMimeViewerDef(doc.mimetype).empty()) {
sprintf(vlbuf, "E%d", m_winfirst+i);
sprintf(vlbuf, "E%d", docnumforlinks);
linksbuf += string("<a href=") + vlbuf + ">" + "Edit" + "</a>";
}
@@ -432,6 +437,7 @@ void ResList::resultPageNext()
QString str = QString::fromUtf8(result.c_str(), result.length());
append(str);
setCursorPosition(0,0);
ensureCursorVisible();
m_pageParaToReldocnums[paragraphs()-1] = i;
m_curDocs.push_back(doc);
@@ -535,7 +541,7 @@ void ResList::doubleClicked(int, int)
void ResList::linkWasClicked(const QString &s, int clkmod)
{
LOGDEB(("ResList::linkClicked: [%s]\n", s.ascii()));
int i = atoi(s.ascii()+1);
int i = atoi(s.ascii()+1) -1;
int what = s.ascii()[0];
switch (what) {
case 'H':
+3 -5
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: searchclause_w.cpp,v 1.2 2006-11-14 17:41:12 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: searchclause_w.cpp,v 1.3 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -40,7 +40,7 @@ SearchClauseW::SearchClauseW(QWidget* parent, const char* name, WFlags fl)
setName("SearchClauseW");
searchClauseLayout = new QVBoxLayout(this);
hLayout = new QHBoxLayout(0, 0, 6, "hLayout");
hLayout = new QHBoxLayout(0, 0, 3, "hLayout");
sTpCMB = new QComboBox(FALSE, this, "sTpCMB");
hLayout->addWidget(sTpCMB);
@@ -56,8 +56,7 @@ SearchClauseW::SearchClauseW(QWidget* parent, const char* name, WFlags fl)
resize(QSize(0, 0).expandedTo(minimumSizeHint()));
clearWState(WState_Polished);
connect(sTpCMB, SIGNAL(activated(int)),
this, SLOT(tpChange(int)));
connect(sTpCMB, SIGNAL(activated(int)), this, SLOT(tpChange(int)));
}
/*
@@ -115,7 +114,6 @@ SearchClauseW::getClause()
(const char *)wordsLE->text().utf8(),
proxSlackSB->value());
case 4:
fprintf(stderr, "NEAR\n");
return new SearchDataClauseDist(SCLT_NEAR,
(const char *)wordsLE->text().utf8(),
proxSlackSB->value());
+5 -2
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.6 2006-11-21 08:47:51 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: spell_w.cpp,v 1.7 2006-11-30 13:38:44 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -48,7 +48,10 @@ void SpellW::init()
/*1*/expTypeCMB->insertItem(tr("Regexp"));
/*2*/expTypeCMB->insertItem(tr("Stem expansion"));
#ifdef RCL_USE_ASPELL
/*3*/expTypeCMB->insertItem(tr("Spelling/Phonetic"));
bool noaspell = false;
rclconfig->getConfParam("noaspell", &noaspell);
if (!noaspell)
/*3*/expTypeCMB->insertItem(tr("Spelling/Phonetic"));
#endif
int typ = prefs.termMatchType;
+13 -18
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.11 2006-11-13 08:58:47 dockes Exp $ (C) 2006 J.F.Dockes";
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.12 2006-11-30 13:38:44 dockes Exp $ (C) 2006 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -69,34 +69,29 @@ void SSearch::searchTextChanged( const QString & text )
void SSearch::startSimpleSearch()
{
LOGDEB(("SSearch::startSimpleSearch\n"));
if (queryText->currentText().length() == 0)
return;
RefCntr<Rcl::SearchData> sdata(new Rcl::SearchData(Rcl::SCLT_AND));
QCString u8 = queryText->currentText().utf8();
string u8 = (const char *)queryText->currentText().utf8();
LOGDEB(("SSearch::startSimpleSearch: [%s]\n", u8.c_str()));
switch (searchTypCMB->currentItem()) {
case 0:
default:
{
QString comp = queryText->currentText();
// If this is an or and we're set for autophrase and there are
// no quotes in the query, add a phrase search
if (prefs.ssearchAutoPhrase && comp.find('"', 0) == -1) {
comp += QString::fromAscii(" \"") + comp +
QString::fromAscii("\"");
u8 = comp.utf8();
}
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_OR,
(const char *)u8));
// If this is an or and we're set for autophrase and there are
// no quotes in the query, add a phrase search
if (prefs.ssearchAutoPhrase &&
u8.find_first_of("\"") == string::npos) {
u8 += string(" \"") + u8 + "\"";
}
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_OR, u8));
break;
case 1:
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND,
(const char *)u8));
sdata->addClause(new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND, u8));
break;
case 2:
sdata->addClause(new Rcl::SearchDataClauseFilename((const char *)u8));
sdata->addClause(new Rcl::SearchDataClauseFilename(u8));
break;
}
+6
View File
@@ -19,6 +19,12 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>4</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout2</cstring>
+8 -3
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.5 2006-11-18 12:30:14 dockes Exp $ (C) 2006 J.F.Dockes";
static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.6 2006-11-30 13:38:44 dockes Exp $ (C) 2006 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -182,7 +182,8 @@ void StringToXapianQ::maybeStemExp(bool nostemexp,
const string& term,
list<string>& exp)
{
LOGDEB2(("maybeStemExp: [%s]\n", term.c_str()));
LOGDEB2(("maybeStemExp: term [%s] stemlang [%s] nostemexp %d\n",
term.c_str(), m_stemlang.c_str(), nostemexp));
if (term.empty()) {
exp.clear();
return;
@@ -191,7 +192,10 @@ void StringToXapianQ::maybeStemExp(bool nostemexp,
string term1;
dumb_string(term, term1);
if (!m_stemlang.empty() && !nostemexp) {
if (m_stemlang.empty())
nostemexp = true;
if (!nostemexp) {
// Check if the first letter is a majuscule in which
// case we do not want to do stem expansion. Note that
// the test is convoluted and possibly problematic
@@ -267,6 +271,7 @@ bool StringToXapianQ::translate(const string &iq,
int slack, bool useNear)
{
string qstring = iq;
LOGDEB2(("StringToXapianQ:: query string: [%s]\n", iq.c_str()));
ermsg.erase();
m_terms.clear();
m_groups.clear();
+1 -1
View File
@@ -6,4 +6,4 @@ Exec=recoll
Icon=recoll
Type=Application
Terminal=false
Categories=Qt;Utility;
Categories=Utility;Filesystem;Database;
+6 -5
View File
@@ -57,13 +57,14 @@ for d in \
${datadir}/recoll/examples \
${datadir}/recoll/filters \
${datadir}/recoll/images \
${datadir}/recoll/translations
${datadir}/recoll/translations \
${datadir}/icons/hicolor/48x48/apps
do
test -d $d || mkdir -p $d || exit 1
done
${INSTALL} -m 0444 recoll.desktop ${datadir}/applications
${INSTALL} -m 0444 recoll.png ${datadir}/icons
${INSTALL} -m 0444 recoll.png ${datadir}/icons/hicolor/48x48/apps
${INSTALL} -m 0444 doc/user/usermanual.html doc/user/docbook.css \
${datadir}/recoll/doc
@@ -75,13 +76,13 @@ ${STRIP} ${bindir}/recoll ${bindir}/recollindex
${INSTALL} -m 0755 filters/rcl* ${datadir}/recoll/filters/ || exit 1
${INSTALL} -m 0755 index/rclmon.sh ${datadir}/recoll/examples/ || exit 1
# Clean up possible old filters in examples
rm -f ${datadir}/recoll/examples/rcl*
${INSTALL} -m 0444 sampleconf/recoll.conf sampleconf/mimeconf \
sampleconf/mimemap ${datadir}/recoll/examples/ || exit 1
${INSTALL} -m 0755 index/rclmon.sh ${datadir}/recoll/examples/ || exit 1
${INSTALL} -m 0444 ${QTGUI}/mtpics/*.png ${datadir}/recoll/images || exit 1
${INSTALL} -m 0444 ${I18N}/recoll*.qm ${datadir}/recoll/translations || exit 1
+2 -2
View File
@@ -1,4 +1,4 @@
# @(#$Id: recoll.conf.in,v 1.12 2006-10-11 14:16:26 dockes Exp $ (C) 2004 J.F.Dockes
# @(#$Id: recoll.conf.in,v 1.13 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes
#
# Recoll default configuration file. This should be copied to
# ~/.recoll/recoll.conf
@@ -9,7 +9,7 @@ topdirs = ~
# Wildcard expressions for names of files and directories that we should
# ignore. If you need index mozilla/thunderbird mail folders, don't put
# ".*" in there (as was the case with an older sample config)
skippedNames = *~ #* bin CVS Cache cache* caughtspam tmp .thumbnails
skippedNames = *~ #* bin CVS Cache cache* caughtspam tmp .thumbnails .svn
# Debug messages. 3 is errors/warnings only. 4 would be quite verbose.
loglevel = 3
+5 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.19 2006-10-11 16:09:45 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.20 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -126,6 +126,9 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
}
if (e.pid) {
// Ignore SIGPIPE in here.
void (*osig)(int);
osig = signal(SIGPIPE, SIG_IGN);
// Father process
if (input) {
close(e.pipein[0]);
@@ -219,6 +222,7 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
out:
int status = -1;
signal(SIGPIPE, osig);
if (!m_cancelRequest) {
(void)waitpid(e.pid, &status, 0);
e.pid = -1;
+20 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.16 2006-11-09 08:59:40 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: mimeparse.cpp,v 1.17 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -723,8 +723,27 @@ time_t rfc2822DateToUxTime(const string& dt)
DATEDEB((stderr, "Tz: [%s] -> %d\n", it->c_str(), zonesecs));
nozone:
// Compute the UTC Unix time value
#ifndef sun
time_t tim = timegm(&tm);
#else
// No timegm on Sun. Use mktime, then correct for local timezone
time_t tim = mktime(&tm);
// altzone and timezone hold the difference in seconds between UTC
// and local. They are negative for places east of greenwich
//
// mktime takes our buffer to be local time, so it adds timezone
// to the conversion result (if timezone is < 0 it's currently
// earlier in greenwhich).
//
// We have to substract it back (hey! hopefully! maybe we have to
// add it). Who can really know?
tim -= timezone;
#endif
// And add in the correction from the email's Tz
tim += zonesecs;
DATEDEB((stderr, "Date: %s uxtime %ld \n", ctime(&tim), tim));
return tim;
}
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.18 2006-11-10 13:30:03 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.19 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -313,7 +313,7 @@ bool stringToBool(const string &s)
int val = atoi(s.c_str());
return val ? true : false;
}
if (strchr("yYoOtT", s[0]))
if (s.find_first_of("yYtT") == 0)
return true;
return false;
}