diff --git a/packaging/FreeBSD/recoll/Makefile b/packaging/FreeBSD/recoll/Makefile index 7435e7dc..54b0cd16 100644 --- a/packaging/FreeBSD/recoll/Makefile +++ b/packaging/FreeBSD/recoll/Makefile @@ -2,11 +2,11 @@ # Date created: 5 December 2005 # Whom: J.F. Dockes # -# $FreeBSD: ports/deskutils/recoll/Makefile,v 1.8 2006/07/26 08:14:38 lbr Exp $ +# $FreeBSD: ports/deskutils/recoll/Makefile,v 1.10 2006/11/21 19:45:14 miwi Exp $ # PORTNAME= recoll -PORTVERSION= 1.5.2 +PORTVERSION= 1.6.1 CATEGORIES= deskutils MASTER_SITES= http://www.lesbonscomptes.com/recoll/ diff --git a/packaging/FreeBSD/recoll/distinfo b/packaging/FreeBSD/recoll/distinfo index dc92701b..6ca8c66a 100644 --- a/packaging/FreeBSD/recoll/distinfo +++ b/packaging/FreeBSD/recoll/distinfo @@ -1,3 +1,3 @@ -MD5 (recoll-1.5.2.tar.gz) = 0081c3a91e236edbe01b77ccf12199ba -SHA256 (recoll-1.5.2.tar.gz) = 40eb29970d3eb0afd63366ef76e33c7151557f9b0ed27156530f2f1ce4813289 -SIZE (recoll-1.5.2.tar.gz) = 581167 +MD5 (recoll-1.5.11.tar.gz) = 72702251bd97fce2ab73dc36430e81ac +SHA256 (recoll-1.5.11.tar.gz) = fa4408c9d761f6901907b10eb64d1b1615d9dcddfae67f1878a70ddb92dd22d2 +SIZE (recoll-1.5.11.tar.gz) = 584067 diff --git a/packaging/FreeBSD/recoll/pkg-plist b/packaging/FreeBSD/recoll/pkg-plist index 13cf9977..ca6dbb0d 100644 --- a/packaging/FreeBSD/recoll/pkg-plist +++ b/packaging/FreeBSD/recoll/pkg-plist @@ -1,12 +1,11 @@ bin/recoll bin/recollindex share/applications/recoll.desktop -share/icons/recoll.png +share/icons/hicolor/48x48/apps/recoll.png %%DATADIR%%/doc/docbook.css %%DATADIR%%/doc/usermanual.html %%DATADIR%%/examples/mimeconf %%DATADIR%%/examples/mimemap -%%DATADIR%%/examples/rclmon.sh %%DATADIR%%/examples/recoll.conf %%DATADIR%%/filters/rcldjvu %%DATADIR%%/filters/rcldoc @@ -45,3 +44,4 @@ share/icons/recoll.png @dirrm %%DATADIR%%/translations @dirrm %%DATADIR%% @dirrmtry share/applications +@dirrmtry share/icons diff --git a/packaging/rpm/recoll.spec b/packaging/rpm/recoll.spec index 6bf36480..b0999137 100644 --- a/packaging/rpm/recoll.spec +++ b/packaging/rpm/recoll.spec @@ -1,5 +1,5 @@ %define name recoll -%define version 1.6.0 +%define version 1.6.1 %define release 0 Name: %{name} @@ -54,13 +54,15 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/* %{_datadir}/%{name} %{_datadir}/applications/recoll.desktop -%{_datadir}/icons/recoll.png +%{_datadir}/icons/hicolor/48x48/apps/recoll.png %{_mandir}/man1/recoll* %{_mandir}/man5/recoll* # --------------------------------------------------------------------------- %changelog +* Tue Nov 28 2006 Jean-Francois Dockes 1.6.1-1 +- Update to release 1.6.1 * Mon Oct 2 2006 Jean-Francois Dockes 1.4.3-1 - Update to release 1.5.3 * Sun May 7 2006 Jean-Francois Dockes 1.4.3-1 @@ -71,4 +73,3 @@ rm -rf $RPM_BUILD_ROOT - Update to release 1.2.2 * Thu Jan 10 2006 Jean-Francois Dockes 1.1.0-1 - Initial packaging - diff --git a/packaging/rpm/recollmdk.spec b/packaging/rpm/recollmdk.spec index 8d9339e4..2f156e42 100644 --- a/packaging/rpm/recollmdk.spec +++ b/packaging/rpm/recollmdk.spec @@ -1,5 +1,5 @@ %define name recoll -%define version 1.6.0 +%define version 1.6.1 %define release %mkrel 1 Name: %{name} @@ -51,7 +51,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root,-) %{_bindir}/* %{_datadir}/applications/recoll.desktop -%{_datadir}/icons/recoll.png +%{_datadir}/icons/hicolor/48x48/apps/recoll.png %{_datadir}/%{name} %{_mandir}/man1/recoll* %{_mandir}/man5/recoll* @@ -60,6 +60,8 @@ rm -rf $RPM_BUILD_ROOT # --------------------------------------------------------------------------- %changelog +* Tue Nov 28 2006 Jean-Francois Dockes 1.6.1-1 +- Update to release 1.6.1 * Mon Nov 20 2006 Jean-Francois Dockes 1.5.11-1 - Update to release 1.5.11 * Mon Oct 2 2006 Jean-Francois Dockes 1.5.2-1 diff --git a/src/README b/src/README index 8a5b541a..1d2c4b1b 100644 --- a/src/README +++ b/src/README @@ -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: - %T
+ %T
%A%U - %S - %L + The format of the Preview and Edit links is and 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 diff --git a/src/aspell/rclaspell.cpp b/src/aspell/rclaspell.cpp index bb529207..20016ada 100644 --- a/src/aspell/rclaspell.cpp +++ b/src/aspell/rclaspell.cpp @@ -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 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()); diff --git a/src/doc/user/usermanual.sgml b/src/doc/user/usermanual.sgml index 7e0b1b22..3dc408f9 100644 --- a/src/doc/user/usermanual.sgml +++ b/src/doc/user/usermanual.sgml @@ -24,7 +24,7 @@ Dockes - $Id: usermanual.sgml,v 1.27 2006-11-21 09:18:21 dockes Exp $ + $Id: usermanual.sgml,v 1.28 2006-11-30 13:38:43 dockes Exp $ This document introduces full text search notions @@ -441,8 +441,9 @@ recoll 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: + out of fashion xdm-based session has a + .xsession script with the following lines + at the end: 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. + 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 @@ -1049,10 +1061,16 @@ RECOLL_CONFDIR=$recollconf $recolldata/examples/rclmon.sh stop %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): - <u><b><font size=+1 color=#1111cf>%T</font></b></u><br> + experience: + <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. diff --git a/src/index/indexer.cpp b/src/index/indexer.cpp index 81a5b437..a3034c87 100644 --- a/src/index/indexer.cpp +++ b/src/index/indexer.cpp @@ -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; diff --git a/src/index/indexer.h b/src/index/indexer.h index 9cda62fa..01f7eb80 100644 --- a/src/index/indexer.h +++ b/src/index/indexer.h @@ -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 #include @@ -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 diff --git a/src/makesrcdist.sh b/src/makesrcdist.sh index 1d65bb34..0436b2b8 100644 --- a/src/makesrcdist.sh +++ b/src/makesrcdist.sh @@ -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 diff --git a/src/makestaticdist.sh b/src/makestaticdist.sh index c3913347..ecc0ce5b 100644 --- a/src/makestaticdist.sh +++ b/src/makestaticdist.sh @@ -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 -) diff --git a/src/mk/SunOS b/src/mk/SunOS index 2f7bf968..71f143bf 100644 --- a/src/mk/SunOS +++ b/src/mk/SunOS @@ -7,4 +7,4 @@ ALL_CXXFLAGS = $(CXXFLAGS) $(COMMONCXXFLAGS) $(LOCALCXXFLAGS) \ CC = gcc CXX = g++ -LIBSYS = -lpthread -lnsl -lsocket +LIBSYS = -lpthread -lnsl -lsocket -ldl diff --git a/src/qtgui/advsearch.ui b/src/qtgui/advsearch.ui index 898fc746..7dc92166 100644 --- a/src/qtgui/advsearch.ui +++ b/src/qtgui/advsearch.ui @@ -19,6 +19,9 @@ unnamed + + 4 + layout18 @@ -43,23 +46,9 @@ unnamed - - - spacer1 - - - Vertical - - - Expanding - - - - 20 - 40 - - - + + 2 + textLabel2 @@ -79,7 +68,7 @@ Plain - 7 + 4 Search for <br>documents<br>satisfying: @@ -113,8 +102,8 @@ - 20 - 16 + 0 + 0 @@ -166,6 +155,9 @@ unnamed + + 2 + clauseline @@ -229,6 +221,9 @@ Save as default + + false + false @@ -237,7 +232,7 @@ - layout12 + filTypHB @@ -251,6 +246,9 @@ unnamed + + 0 + textLabel2_2 @@ -269,7 +267,7 @@ 200 - 80 + 20 @@ -286,6 +284,9 @@ unnamed + + 2 + delAFiltypPB @@ -352,6 +353,9 @@ unnamed + + 0 + textLabel3 @@ -370,7 +374,7 @@ 200 - 80 + 20 diff --git a/src/qtgui/advsearch_w.cpp b/src/qtgui/advsearch_w.cpp index bba87091..826b7eca 100644 --- a/src/qtgui/advsearch_w.cpp +++ b/src/qtgui/advsearch_w.cpp @@ -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; diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index 2a78f920..176dfd3d 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -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::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   %T
" "%M %D   %U
" diff --git a/src/qtgui/guiutils.h b/src/qtgui/guiutils.h index 38bc627e..121b07ef 100644 --- a/src/qtgui/guiutils.h +++ b/src/qtgui/guiutils.h @@ -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; diff --git a/src/qtgui/i18n/recoll_fr.ts b/src/qtgui/i18n/recoll_fr.ts index a08f1c8b..254550e4 100644 --- a/src/qtgui/i18n/recoll_fr.ts +++ b/src/qtgui/i18n/recoll_fr.ts @@ -223,6 +223,10 @@ Click Cancel if you want to edit the configuration file before indexation starts Cancel Annuler + + Close Tab + Fermer l'onglet + PreviewBase diff --git a/src/qtgui/i18n/recoll_ru.ts b/src/qtgui/i18n/recoll_ru.ts index 531ad698..3ad801c7 100644 --- a/src/qtgui/i18n/recoll_ru.ts +++ b/src/qtgui/i18n/recoll_ru.ts @@ -224,6 +224,10 @@ Click Cancel if you want to edit the configuration file before indexation starts Cancel Отмена + + Close Tab + + PreviewBase diff --git a/src/qtgui/i18n/recoll_uk.ts b/src/qtgui/i18n/recoll_uk.ts index 9fcb572d..38f6ba1c 100644 --- a/src/qtgui/i18n/recoll_uk.ts +++ b/src/qtgui/i18n/recoll_uk.ts @@ -221,6 +221,10 @@ Click Cancel if you want to edit the configuration file before indexation starts Loading preview text into editor Завантажую текст перегляду в редактор + + Close Tab + + PreviewBase diff --git a/src/qtgui/images/cancel.png b/src/qtgui/images/cancel.png new file mode 100755 index 00000000..96919575 Binary files /dev/null and b/src/qtgui/images/cancel.png differ diff --git a/src/qtgui/images/close.png b/src/qtgui/images/close.png new file mode 100755 index 00000000..7cb98593 Binary files /dev/null and b/src/qtgui/images/close.png differ diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index 868b4252..8fac5f4c 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -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(); diff --git a/src/qtgui/plaintorich.cpp b/src/qtgui/plaintorich.cpp index 61f4d84b..8720e52d 100644 --- a/src/qtgui/plaintorich.cpp +++ b/src/qtgui/plaintorich.cpp @@ -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 > 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& terms, int dist); int m_wcount; - int m_firstTermPos; // In: user query terms set m_terms; @@ -239,6 +241,20 @@ bool myTextSplitCB::matchGroup(const vector& 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 >::iterator i1 = m_gpostobytes.find(sta); + map >::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(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& 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 >::iterator i1 = m_gpostobytes.find(sta); - map >::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(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 a, pairb) { - 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 >::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 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("
" +#ifdef QT_SCROLL_TO_ANCHOR_BUG + + " " + firstTermBeacon + " " +#endif + + ""; + } + if (ibyteidx == tPosIt->first) { out += ""; } 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 += ""; + 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); } diff --git a/src/qtgui/plaintorich.h b/src/qtgui/plaintorich.h index c3891c86..3f7fbdd9 100644 --- a/src/qtgui/plaintorich.h +++ b/src/qtgui/plaintorich.h @@ -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 @@ -38,7 +38,16 @@ */ extern bool plaintorich(const string &in, string &out, RefCntr 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_ */ diff --git a/src/qtgui/preview.ui b/src/qtgui/preview.ui index ba1e85bb..4bc391b6 100644 --- a/src/qtgui/preview.ui +++ b/src/qtgui/preview.ui @@ -8,8 +8,8 @@ 0 0 - 751 - 727 + 640 + 480 @@ -20,12 +20,6 @@ 0 - - - 130 - 30 - - Preview @@ -33,6 +27,9 @@ unnamed + + 4 + layout4 @@ -56,6 +53,9 @@ unnamed + + 0 + pvEdit diff --git a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp index b3f6b6f4..ac8a8e98 100644 --- a/src/qtgui/preview_w.cpp +++ b/src/qtgui/preview_w.cpp @@ -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 ∈ RefCntr m_searchData; - string& firstTerm; - int& firstTermOcc; QString &out; int loglevel; public: - ToRichThread(string &i, RefCntr searchData, - string& ft, int& fto, QString &o) - : in(i), m_searchData(searchData), firstTerm(ft), firstTermOcc(fto), - out(o) + ToRichThread(string &i, RefCntr 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("Cancelled !"); @@ -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; diff --git a/src/qtgui/rclmain.ui b/src/qtgui/rclmain.ui index 44d3c1bc..763ca27a 100644 --- a/src/qtgui/rclmain.ui +++ b/src/qtgui/rclmain.ui @@ -8,8 +8,8 @@ 0 0 - 681 - 244 + 800 + 600 @@ -20,12 +20,6 @@ 0 - - - 25 - 244 - - Recoll @@ -33,6 +27,12 @@ unnamed + + 4 + + + 2 + unnamed diff --git a/src/qtgui/recoll.pro.in b/src/qtgui/recoll.pro.in index d8b0b3d6..cd5e20fc 100644 --- a/src/qtgui/recoll.pro.in +++ b/src/qtgui/recoll.pro.in @@ -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 diff --git a/src/qtgui/reslist.cpp b/src/qtgui/reslist.cpp index 95f1f5b6..4f6381fd 100644 --- a/src/qtgui/reslist.cpp +++ b/src/qtgui/reslist.cpp @@ -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 @@ -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, " %Y-%m-%d %H:%M:%S %z", tm); +#else + strftime(datebuf, 99, " %Y-%m-%d %H:%M:%S %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("" + "Preview" + "" + "  "; } if (!rclconfig->getMimeViewerDef(doc.mimetype).empty()) { - sprintf(vlbuf, "E%d", m_winfirst+i); + sprintf(vlbuf, "E%d", docnumforlinks); linksbuf += string("" + "Edit" + ""; } @@ -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': diff --git a/src/qtgui/searchclause_w.cpp b/src/qtgui/searchclause_w.cpp index 4576a4b5..43b98f96 100644 --- a/src/qtgui/searchclause_w.cpp +++ b/src/qtgui/searchclause_w.cpp @@ -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()); diff --git a/src/qtgui/spell_w.cpp b/src/qtgui/spell_w.cpp index 4855cd9c..e63703c5 100644 --- a/src/qtgui/spell_w.cpp +++ b/src/qtgui/spell_w.cpp @@ -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; diff --git a/src/qtgui/ssearch_w.cpp b/src/qtgui/ssearch_w.cpp index ade73c17..96037c2f 100644 --- a/src/qtgui/ssearch_w.cpp +++ b/src/qtgui/ssearch_w.cpp @@ -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 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; } diff --git a/src/qtgui/ssearchb.ui b/src/qtgui/ssearchb.ui index 7547b83f..7e8721cb 100644 --- a/src/qtgui/ssearchb.ui +++ b/src/qtgui/ssearchb.ui @@ -19,6 +19,12 @@ unnamed + + 4 + + + 2 + layout2 diff --git a/src/rcldb/searchdata.cpp b/src/rcldb/searchdata.cpp index 1a56138a..360a09d7 100644 --- a/src/rcldb/searchdata.cpp +++ b/src/rcldb/searchdata.cpp @@ -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& 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(); diff --git a/src/recoll.desktop b/src/recoll.desktop index 205080b7..2de01905 100644 --- a/src/recoll.desktop +++ b/src/recoll.desktop @@ -6,4 +6,4 @@ Exec=recoll Icon=recoll Type=Application Terminal=false -Categories=Qt;Utility; +Categories=Utility;Filesystem;Database; diff --git a/src/recollinstall.in b/src/recollinstall.in index aa5b206d..fc8b8527 100755 --- a/src/recollinstall.in +++ b/src/recollinstall.in @@ -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 diff --git a/src/sampleconf/recoll.conf.in b/src/sampleconf/recoll.conf.in index d6f84a50..80a435d0 100644 --- a/src/sampleconf/recoll.conf.in +++ b/src/sampleconf/recoll.conf.in @@ -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 diff --git a/src/utils/execmd.cpp b/src/utils/execmd.cpp index 59a78fde..f690602b 100644 --- a/src/utils/execmd.cpp +++ b/src/utils/execmd.cpp @@ -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& 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& args, out: int status = -1; + signal(SIGPIPE, osig); if (!m_cancelRequest) { (void)waitpid(e.pid, &status, 0); e.pid = -1; diff --git a/src/utils/mimeparse.cpp b/src/utils/mimeparse.cpp index fe62a16c..8abd2878 100644 --- a/src/utils/mimeparse.cpp +++ b/src/utils/mimeparse.cpp @@ -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; } diff --git a/src/utils/smallut.cpp b/src/utils/smallut.cpp index f367e66d..2b15991f 100644 --- a/src/utils/smallut.cpp +++ b/src/utils/smallut.cpp @@ -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; } diff --git a/website/BUGS.txt b/website/BUGS.txt index dff4ff6d..3938183e 100644 --- a/website/BUGS.txt +++ b/website/BUGS.txt @@ -4,15 +4,14 @@ Bugs that are listed in an older version section are supposedly fixed in later versions. Bugs listed in the topmost section may also exist in older versions. -Latest: +Latest (1.6.2): - 1.6 NEAR crashes: 1.6 has added NEAR searches. Unlike what recoll did with PHRASES, stemming expansion is performed on terms inside NEAR clauses (except if prevented by a capitalized entry of course). There is a bug in Xapian at least up to 0.9.9, where NEAR does not support multiple OR subclauses, as would result from a multiple expansion. This - manifests itself by a 'not implemented' Xapian exception and a recoll - crash. Workarounds: + manifests itself by a 'not implemented' Xapian exception. Workarounds: - Prevent expansion of NEAR terms (possibly except one) by capitalizing them. @@ -48,6 +47,13 @@ Latest: probably a Kwin bug, possibly related to http://bugs.kde.org/show_bug.cgi?id=79183 or a correction thereof. +- Under Solaris, it is necessary to perform initial indexing with the + recollindex program (the recoll index thread doesn't work for creating + the database). Don't know the reason. Only idea I have is problem with + exception handling (recoll catches an exception while trying the + yest inexistant db). + +*************************************************************************** 1.5.10 - If a defaultcharset was set in the configuration file for a subdirectory, it would stay in effect for all subsequent files/directories (except if diff --git a/website/CHANGES.txt b/website/CHANGES.txt index 48738a58..1c00c650 100644 --- a/website/CHANGES.txt +++ b/website/CHANGES.txt @@ -11,8 +11,9 @@ values, and the user ones only for overrides. Your old configuration files will still work, but, you may want to remove them if they are unmodified, or keep only the modified parameters. - -1.6.0 +1.6.2 + - Minor solaris compilation glitches only. +1.6.1 - Term explorer: a multimode wildcard-regexp-spell/phonetic tool to search the index for terms. This uses aspell for the orthographic/phonetic part. - A more dynamic advanced search window. You now have a choice of the top diff --git a/website/download.html b/website/download.html index 56e282dc..ec9d4194 100644 --- a/website/download.html +++ b/website/download.html @@ -54,24 +54,22 @@ decide what you may want to install.

Source

- -

Recoll 1.6.0 is out ! This - version has quite a few improvements (see changes). As a .0 version, it - may not be for everybody, which is why the binary packages - stay with 1.5 for now.
Download the - source: recoll-1.6.0.tar.gz. The new documentation is here too. Some - NEAR searches can crash recoll. Have a look at the - errata for a workaround. -

-

Current version: 1.5.11: - recoll-1.5.11.tar.gz. +

Current version: + 1.6.1: recoll-1.6.1.tar.gz See the known bugs and issues and changes.

+ +

recoll 1.6 has the capacity to perform proximity searches (a + bit like phrases, but unordered). There is a still unpatched + problem in Xapian 0.9.9 which will make NEAR searches fail. + If you intend to perform proximity searches, have a look at the + errata for a workaround and Xapian + patch. All the statically linked binary packages below use a + patched Xapian-core library in order for NEAR searches to work.

+

Older recoll releases: + 1.5.11. 1.5.6. 1.4.3. 1.3.3. @@ -83,36 +81,42 @@

RPMS

The executables inside the binary rpms have a static link to xapian, there is no dependency except Qt 3.3. Of course you need - xapian-core installed to use the source rpm.

+ xapian-core installed to use the source rpm.

Fedora Core 5 - RPM: recoll-1.5.11-1.i386.rpm. + RPM: + + recoll-1.6.1-1.i386.rpm. Source: - recoll-1.5.11-1.src.rpm

+ + recoll-1.6.1-1.src.rpm +

Mandriva 2006 (also works on 2005 and 2007) - RPM: recoll-1.5.11-0.1.20060mdk.i586.rpm. - Source: recoll-1.5.11-0.1.20060mdk.src.rpm

+ RPM: + + recoll-1.6.1-0.1.20060mdk.i586.rpm. + Source: + + recoll-1.6.1-0.1.20060mdk.src.rpm +

-

Suse 10.1 It seems that the binaries in previous set of - rpms, which were built with the xapian packages from opensuse had a - serious tendancy to segfault on exceptions. I hope that the - current ones, with a local xapian build will work better. If - there are still problems, please compile from source. +

Suse 10.1 - RPM: recoll-1.5.11-0.i586.rpm. - Source: recoll-1.5.11-0.src.rpm

+ RPM: + + recoll-1.6.1-0.i586.rpm. + Source: + + recoll-1.6.1-0.src.rpm

Binary bundles

These are just prebuilt trees (without the source files). - The executables were built with xapian 0.9.[6-9] and libiconv + The executables were built with xapian 0.9.9 (patched for the + NEAR bug) and libiconv 1.9.2 (where relevant) as static libraries. They depend on qt 3.3. For Solaris, you should be able to find a qt package here.

@@ -120,24 +124,30 @@

The installation instructions are there.

-

FreeBSD 5.5 i386: - recoll-1.5.11-FreeBSD-5.5-RELEASE.tgz

+

FreeBSD 5.5 i386: + + recoll-1.6.1-FreeBSD-5.5-RELEASE.tgz +

-

Solaris 8 sparc. - - recoll-1.5.4-SunOS-5.8.tgz.

+

Solaris 8 sparc. + Note to Solaris users: you need to perform the initial + indexing pass with "recollindex", not the recoll GUI indexing + thread. See errata. + + recoll-1.6.2-SunOS-5.8.tgz. +

FreeBSD ports

There are ports for both xapian-core and recoll in the standard tree, you may just need to update your ports (cvsup), or you can get the ports from the FreeBSD - site: xapian - port recoll - port.

+ site. The ports are not yet updated for recoll 1.6 or the + xapian NEAR problem though. + + xapian port + + recoll port.

diff --git a/website/features.html b/website/features.html index 13f0374d..41c932c5 100644 --- a/website/features.html +++ b/website/features.html @@ -38,10 +38,10 @@
Supported systems
Recoll has been compiled and tested on FreeBSD, Linux, Darwin and Solaris (versions - FreeBSD 5.3, Redhat 7.3, Fedora Core 4, Gentoo, Debian 3.1, - Solaris 8/9, but other not too distant releases should be ok - too). You can download the source code and some precompiled - packages here.
+ FreeBSD 5.5, Redhat 7.3, Fedora Core 5, Suse 10.1, Gentoo, + Debian 3.1, Solaris 8/9, but other not too distant releases + should be ok too). You can download the source code and some + precompiled packages here.
Qt versions from 3.1
diff --git a/website/index.html b/website/index.html index d146a213..a84fe393 100644 --- a/website/index.html +++ b/website/index.html @@ -47,7 +47,7 @@

Recoll is free, open source, and GPL-licensed. The current version is - 1.5.11

+ 1.6.1

We borrow a lot of code from other packages, and welcome code and ideas from contributors, see the