merged branch 1.25 fixes

This commit is contained in:
Jean-Francois Dockes 2019-08-09 11:54:39 +02:00
commit d4c099ab59
31 changed files with 1583 additions and 1145 deletions

View File

@ -112,10 +112,10 @@ overriden in the c++ code by ifdefs _WIN32 anyway */
#define PACKAGE_NAME "Recoll"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Recoll 1.25.19"
#define PACKAGE_STRING "Recoll 1.25.21"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.25.19"
#define PACKAGE_VERSION "1.25.21"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "recoll"

View File

@ -1559,6 +1559,9 @@ vector<string> RclConfig::getSkippedPaths() const
// don't do this.
skpl.push_back(getDbDir());
skpl.push_back(getConfDir());
#ifdef _WIN32
skpl.push_back(TempFile::rcltmpdir());
#endif
if (getCacheDir().compare(getConfDir())) {
skpl.push_back(getCacheDir());
}

View File

@ -92,11 +92,11 @@ alink="#0000FF">
"#RCL.INDEXING.INTRODUCTION.CONFIG">Configurations,
multiple indexes</a></span></dt>
<dt><span class="sect2">2.1.3. <a href=
"#idm218">Document types</a></span></dt>
"#idm233">Document types</a></span></dt>
<dt><span class="sect2">2.1.4. <a href=
"#idm259">Indexing failures</a></span></dt>
"#idm274">Indexing failures</a></span></dt>
<dt><span class="sect2">2.1.5. <a href=
"#idm271">Recovery</a></span></dt>
"#idm286">Recovery</a></span></dt>
</dl>
</dd>
<dt><span class="sect1">2.2. <a href=
@ -851,10 +851,10 @@ alink="#0000FF">
</div>
<p><span class="application">Recoll</span> supports
defining multiple indexes, each defined by its own
<a class="link" href="#RCL.INDEXING.CONFIG" title=
"2.3.&nbsp;Index configuration">configuration
directory</a>, in which several configuration files
describe what should be indexed and how.</p>
configuration directory. A configuration directory
contains <a class="link" href="#RCL.INDEXING.CONFIG"
title="2.3.&nbsp;Index configuration">several files</a>
which describe what should be indexed and how.</p>
<p>When <span class=
"command"><strong>recoll</strong></span> or <span class=
"command"><strong>recollindex</strong></span> is first
@ -864,14 +864,14 @@ alink="#0000FF">
is located in <code class=
"filename">$HOME/.recoll/</code> for <span class=
"application">Unix</span>-like systems and <code class=
"filename">%LOCALAPPDATA%</code> on <span class=
"filename">%LOCALAPPDATA%\Recoll</code> on <span class=
"application">Windows</span> (typically <code class=
"filename">C:\Users\[me]\Appdata\Local</code>).</p>
"filename">C:\Users\[me]\Appdata\Local\Recoll</code>).</p>
<p>All configuration parameters have defaults, defined in
system-wide files. Without further customisation, the
default configuration will process your complete home
directory, with a reasonable set of defaults. It can be
changed to process a different area of the file system,
adjusted to process a different area of the file system,
select files in different ways, and many other
things.</p>
<p>In some cases, it may be useful to create additional
@ -879,6 +879,35 @@ alink="#0000FF">
personal and shared indexes, or to take advantage of the
organization of your data to improve search
precision.</p>
<p>In order to do this, you would create an empty
directory in a location of your choice, and then instruct
<span class="command"><strong>recoll</strong></span> or
<span class="command"><strong>recollindex</strong></span>
to use it by setting either a command line option
(<code class="literal">-c</code> <em class=
"replaceable"><code>/some/directory</code></em>), or an
environment variable (<code class=
"envar">RECOLL_CONFDIR</code>=<em class=
"replaceable"><code>/some/directory</code></em>). Any
modification performed by the commands (e.g.
configuration customisation or searches by <span class=
"command"><strong>recoll</strong></span> or index
creation by <span class=
"command"><strong>recollindex</strong></span>) would then
apply to the new directory and not to the default
one.</p>
<p>Once multiple indexes are created, you can use each of
them separately by setting the <code class=
"literal">-c</code> option or the <code class=
"envar">RECOLL_CONFDIR</code> environment variable when
starting a command, to select the desired index.</p>
<p>It is also possible to instruct one configuration to
query one or several other indexes in addition to its
own, by using the <span class="guimenuitem">External
index</span> function in the <span class=
"command"><strong>recoll</strong></span> GUI, or some
other functions in the command line and programming
tools.</p>
<p>A plausible usage scenario for the multiple index
feature would be for a system administrator to set up a
central index for shared data, that you choose to search
@ -904,8 +933,8 @@ alink="#0000FF">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="idm218" id=
"idm218"></a>2.1.3.&nbsp;Document types</h3>
<h3 class="title"><a name="idm233" id=
"idm233"></a>2.1.3.&nbsp;Document types</h3>
</div>
</div>
</div>
@ -1002,8 +1031,8 @@ alink="#0000FF">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="idm259" id=
"idm259"></a>2.1.4.&nbsp;Indexing failures</h3>
<h3 class="title"><a name="idm274" id=
"idm274"></a>2.1.4.&nbsp;Indexing failures</h3>
</div>
</div>
</div>
@ -1038,8 +1067,8 @@ alink="#0000FF">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="idm271" id=
"idm271"></a>2.1.5.&nbsp;Recovery</h3>
<h3 class="title"><a name="idm286" id=
"idm286"></a>2.1.5.&nbsp;Recovery</h3>
</div>
</div>
</div>
@ -1390,8 +1419,8 @@ alink="#0000FF">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="idm392" id=
"idm392"></a>In practise: creating and using an
<h4 class="title"><a name="idm407" id=
"idm407"></a>In practise: creating and using an
additional index</h4>
</div>
</div>

View File

@ -377,22 +377,23 @@
<title>Configurations, multiple indexes</title>
<para>&RCL; supports defining multiple indexes, each defined by its
own <link linkend="RCL.INDEXING.CONFIG">configuration directory</link>,
in which several configuration files describe
what should be indexed and how.</para>
own configuration directory. A configuration directory contains
<link linkend="RCL.INDEXING.CONFIG">several files</link> which
describe what should be indexed and how.</para>
<para>When <command>recoll</command> or
<command>recollindex</command> is first executed, it creates a
default configuration directory. This configuration is the one used
for indexing and querying when no specific configuration is
specified. It is located in <filename>$HOME/.recoll/</filename> for
&LIN; and <filename>%LOCALAPPDATA%</filename> on &WIN;
(typically <filename>C:\Users\[me]\Appdata\Local</filename>).</para>
&LIN; and <filename>%LOCALAPPDATA%\Recoll</filename> on &WIN;
(typically
<filename>C:\Users\[me]\Appdata\Local\Recoll</filename>).</para>
<para>All configuration parameters have defaults, defined in
system-wide files. Without further customisation, the default
configuration will process your complete home directory, with a
reasonable set of defaults. It can be changed to process a
reasonable set of defaults. It can be adjusted to process a
different area of the file system, select files in different ways,
and many other things.</para>
@ -401,6 +402,29 @@
shared indexes, or to take advantage of the organization of your
data to improve search precision.</para>
<para>In order to do this, you would create an empty directory in a
location of your choice, and then instruct
<command>recoll</command> or <command>recollindex</command> to use
it by setting either a command line option (<literal>-c</literal>
<replaceable>/some/directory</replaceable>), or an environment
variable
(<envar>RECOLL_CONFDIR</envar>=<replaceable>/some/directory</replaceable>).
Any modification performed by the commands (e.g. configuration
customisation or searches by <command>recoll</command> or index
creation by <command>recollindex</command>) would then apply to the
new directory and not to the default one.</para>
<para>Once multiple indexes are created, you can use each of them
separately by setting the <literal>-c</literal> option or the
<envar>RECOLL_CONFDIR</envar> environment variable when starting a
command, to select the desired index.</para>
<para>It is also possible to instruct one configuration to
query one or several other indexes in addition to its own, by using
the <guimenuitem>External index</guimenuitem> function in the
<command>recoll</command> GUI, or some other functions in the
command line and programming tools.</para>
<para>A plausible usage scenario for the multiple index feature
would be for a system administrator to set up a central index for
shared data, that you choose to search or not in addition to your

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@
#include <string>
#include <vector>
#include <inttypes.h>
#include "mimehandler.h"
@ -29,33 +30,19 @@
*/
class MimeHandlerMbox : public RecollFilter {
public:
MimeHandlerMbox(RclConfig *cnf, const std::string& id)
: RecollFilter(cnf, id), m_vfp(0), m_msgnum(0),
m_lineno(0), m_fsize(0) {
}
MimeHandlerMbox(RclConfig *cnf, const std::string& id);
virtual ~MimeHandlerMbox();
virtual bool next_document() override;
virtual bool skip_to_document(const std::string& ipath) override{
m_ipath = ipath;
return true;
}
virtual bool skip_to_document(const std::string& ipath) override;
virtual void clear_impl() override;
typedef long long mbhoff_type;
protected:
virtual bool set_document_file_impl(const std::string&,
const std::string&) override;
class Internal;
private:
std::string m_fn; // File name
void *m_vfp; // File pointer for folder
int m_msgnum; // Current message number in folder. Starts at 1
std::string m_ipath;
int m_lineno; // debug
mbhoff_type m_fsize;
std::vector<mbhoff_type> m_offsets;
enum Quirks {MBOXQUIRK_TBIRD=1};
int m_quirks;
Internal *m{nullptr};
};
#endif /* _MBOX_H_INCLUDED_ */

View File

@ -56,9 +56,12 @@ static const int margin = 2;
void ConfParamW::setValue(const QString& value)
{
#ifndef _WIN32
// On Windows all paths are unicode.
if (m_fsencoding)
m_cflink->set(string((const char *)value.toLocal8Bit()));
else
#endif
m_cflink->set(string((const char *)value.toUtf8()));
}
@ -76,8 +79,8 @@ void ConfParamW::setValue(bool value)
}
void setSzPol(QWidget *w, QSizePolicy::Policy hpol,
QSizePolicy::Policy vpol,
int hstretch, int vstretch)
QSizePolicy::Policy vpol,
int hstretch, int vstretch)
{
QSizePolicy policy(hpol, vpol);
policy.setHorizontalStretch(hstretch);
@ -102,15 +105,15 @@ bool ConfParamW::createCommon(const QString& lbltxt, const QString& tltptxt)
}
ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
const QString& lbltxt,
const QString& tltptxt,
int minvalue,
int maxvalue,
const QString& lbltxt,
const QString& tltptxt,
int minvalue,
int maxvalue,
int defaultvalue)
: ConfParamW(parent, cflink), m_defaultvalue(defaultvalue)
{
if (!createCommon(lbltxt, tltptxt))
return;
return;
m_sb = new QSpinBox(this);
m_sb->setMinimum(minvalue);
@ -124,7 +127,7 @@ ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
loadValue();
QObject::connect(m_sb, SIGNAL(valueChanged(int)),
this, SLOT(setValue(int)));
this, SLOT(setValue(int)));
}
void ConfParamIntW::loadValue()
@ -137,12 +140,12 @@ void ConfParamIntW::loadValue()
}
ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink cflink,
const QString& lbltxt,
const QString& tltptxt)
const QString& lbltxt,
const QString& tltptxt)
: ConfParamW(parent, cflink)
{
if (!createCommon(lbltxt, tltptxt))
return;
return;
m_le = new QLineEdit(this);
setSzPol(m_le, QSizePolicy::Preferred, QSizePolicy::Fixed, 1, 0);
@ -151,28 +154,31 @@ ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink cflink,
loadValue();
QObject::connect(m_le, SIGNAL(textChanged(const QString&)),
this, SLOT(setValue(const QString&)));
this, SLOT(setValue(const QString&)));
}
void ConfParamStrW::loadValue()
{
string s;
m_cflink->get(s);
#ifndef _WIN32
// On Windows all paths are unicode.
if (m_fsencoding)
m_le->setText(QString::fromLocal8Bit(s.c_str()));
else
#endif
m_le->setText(QString::fromUtf8(s.c_str()));
}
ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink cflink,
const QString& lbltxt,
const QString& tltptxt,
const QStringList &sl
)
const QString& lbltxt,
const QString& tltptxt,
const QStringList &sl
)
: ConfParamW(parent, cflink)
{
if (!createCommon(lbltxt, tltptxt))
return;
return;
m_cmb = new QComboBox(this);
m_cmb->setEditable(false);
m_cmb->insertItems(0, sl);
@ -183,7 +189,7 @@ ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink cflink,
loadValue();
QObject::connect(m_cmb, SIGNAL(activated(const QString&)),
this, SLOT(setValue(const QString&)));
this, SLOT(setValue(const QString&)));
}
void ConfParamCStrW::loadValue()
@ -191,22 +197,25 @@ void ConfParamCStrW::loadValue()
string s;
m_cflink->get(s);
QString cs;
#ifndef _WIN32
// On Windows all paths are unicode.
if (m_fsencoding)
cs = QString::fromLocal8Bit(s.c_str());
else
#endif
cs = QString::fromUtf8(s.c_str());
for (int i = 0; i < m_cmb->count(); i++) {
if (!cs.compare(m_cmb->itemText(i))) {
m_cmb->setCurrentIndex(i);
break;
}
if (!cs.compare(m_cmb->itemText(i))) {
m_cmb->setCurrentIndex(i);
break;
}
}
}
ConfParamBoolW::ConfParamBoolW(QWidget *parent, ConfLink cflink,
const QString& lbltxt,
const QString& tltptxt)
const QString& lbltxt,
const QString& tltptxt)
: ConfParamW(parent, cflink)
{
// No createCommon because the checkbox has a label
@ -234,17 +243,17 @@ void ConfParamBoolW::loadValue()
}
ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink cflink,
const QString& lbltxt,
const QString& tltptxt,
bool isdir,
const QString& lbltxt,
const QString& tltptxt,
bool isdir,
QString dirloc,
QString dfltnm
)
)
: ConfParamW(parent, cflink), m_isdir(isdir), m_dirloc(dirloc),
m_dfltnm(dfltnm)
{
if (!createCommon(lbltxt, tltptxt))
return;
return;
m_fsencoding = true;
@ -265,14 +274,19 @@ ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink cflink,
loadValue();
QObject::connect(m_pb, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
QObject::connect(m_le, SIGNAL(textChanged(const QString&)),
this, SLOT(setValue(const QString&)));
this, SLOT(setValue(const QString&)));
}
void ConfParamFNW::loadValue()
{
string s;
m_cflink->get(s);
#ifndef _WIN32
// On Windows all paths are unicode.
m_le->setText(QString::fromLocal8Bit(s.c_str()));
#else
m_le->setText(QString::fromUtf8(s.c_str()));
#endif
}
void ConfParamFNW::showBrowserDialog()
@ -286,13 +300,13 @@ class SmallerListWidget: public QListWidget
{
public:
SmallerListWidget(QWidget *parent)
: QListWidget(parent) {}
: QListWidget(parent) {}
virtual QSize sizeHint() const {return QSize(150, 40);}
};
ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink,
const QString& lbltxt,
const QString& tltptxt)
const QString& lbltxt,
const QString& tltptxt)
: ConfParamW(parent, cflink)
{
// Can't use createCommon here cause we want the buttons below the label
@ -346,9 +360,12 @@ void ConfParamSLW::loadValue()
stringToStrings(s, ls);
QStringList qls;
for (list<string>::const_iterator it = ls.begin(); it != ls.end(); it++) {
// On Windows all paths are unicode.
#ifndef _WIN32
if (m_fsencoding)
qls.push_back(QString::fromLocal8Bit(it->c_str()));
else
#endif
qls.push_back(QString::fromUtf8(it->c_str()));
}
m_lb->clear();
@ -359,27 +376,27 @@ void ConfParamSLW::showInputDialog()
{
bool ok;
QString s = QInputDialog::getText (this,
"", // title
"", // label,
QLineEdit::Normal, // EchoMode mode
"", // const QString & text
&ok);
"", // title
"", // label,
QLineEdit::Normal, // EchoMode mode
"", // const QString & text
&ok);
if (ok && !s.isEmpty()) {
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (items.empty()) {
m_lb->insertItem(0, s);
m_lb->sortItems();
listToConf();
}
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (items.empty()) {
m_lb->insertItem(0, s);
m_lb->sortItems();
listToConf();
}
}
}
void ConfParamSLW::listToConf()
{
list<string> ls;
LOGDEB2("ConfParamSLW::listToConf. m_fsencoding " << (int(m_fsencoding)) << "\n" );
LOGDEB2("ConfParamSLW::listToConf. m_fsencoding " << m_fsencoding << "\n");
for (int i = 0; i < m_lb->count(); i++) {
// General parameters are encoded as utf-8. File names as
// local8bit There is no hope for 8bit file names anyway
@ -388,10 +405,11 @@ void ConfParamSLW::listToConf()
// backslashes to slashes. This is an awful hack because
// fsencoding does not necessarily imply that the values are
// paths, and it will come back to haunt us one day.
QString text = m_lb->item(i)->text();
QString text = m_lb->item(i)->text();
if (m_fsencoding) {
// On Windows all paths are unicode.
#ifdef _WIN32
string pth((const char *)(text.toLocal8Bit()));
string pth((const char *)(text.toUtf8()));
path_slashize(pth);
ls.push_back(pth);
#else
@ -420,16 +438,16 @@ void ConfParamSLW::deleteSelected()
vector<int> idxes;
for (int i = 0; i < m_lb->count(); i++) {
if (m_lb->item(i)->isSelected()) {
idxes.push_back(i);
}
if (m_lb->item(i)->isSelected()) {
idxes.push_back(i);
}
}
for (vector<int>::reverse_iterator it = idxes.rbegin();
it != idxes.rend(); it++) {
LOGDEB0("deleteSelected: " << (*it) << " was selected\n" );
QListWidgetItem *item = m_lb->takeItem(*it);
emit entryDeleted(item->text());
delete item;
it != idxes.rend(); it++) {
LOGDEB0("deleteSelected: " << *it << " was selected\n");
QListWidgetItem *item = m_lb->takeItem(*it);
emit entryDeleted(item->text());
delete item;
}
listToConf();
@ -440,18 +458,18 @@ void ConfParamDNLW::showInputDialog()
{
QString s = myGetFileName(true);
if (!s.isEmpty()) {
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (items.empty()) {
m_lb->insertItem(0, s);
m_lb->sortItems();
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (m_lb->selectionMode() == QAbstractItemView::SingleSelection &&
!items.empty())
m_lb->setCurrentItem(*items.begin());
listToConf();
}
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (items.empty()) {
m_lb->insertItem(0, s);
m_lb->sortItems();
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (m_lb->selectionMode() == QAbstractItemView::SingleSelection &&
!items.empty())
m_lb->setCurrentItem(*items.begin());
listToConf();
}
}
}
@ -460,23 +478,22 @@ void ConfParamCSLW::showInputDialog()
{
bool ok;
QString s = QInputDialog::getItem (this, // parent
"", // title
"", // label,
m_sl, // items,
0, // current = 0
false, // editable = true,
&ok);
"", // title
"", // label,
m_sl, // items,
0, // current = 0
false, // editable = true,
&ok);
if (ok && !s.isEmpty()) {
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (items.empty()) {
m_lb->insertItem(0, s);
m_lb->sortItems();
listToConf();
}
QList<QListWidgetItem *>items =
m_lb->findItems(s, Qt::MatchFixedString|Qt::MatchCaseSensitive);
if (items.empty()) {
m_lb->insertItem(0, s);
m_lb->sortItems();
listToConf();
}
}
}
} // Namespace confgui

View File

@ -57,30 +57,27 @@ static const int margin = 3;
class ConfLinkRclRep : public ConfLinkRep {
public:
ConfLinkRclRep(ConfNull *conf, const string& nm,
string *sk = 0)
: m_conf(conf), m_nm(nm), m_sk(sk) /* KEEP THE POINTER, shared data */
{
}
string *sk = 0)
: m_conf(conf), m_nm(nm), m_sk(sk) /* KEEP THE POINTER, shared data */
{ }
virtual ~ConfLinkRclRep() {}
virtual bool set(const string& val)
{
if (!m_conf)
return false;
LOGDEB1("Setting [" << m_nm << "] value to [" << val << "]\n");
bool ret = m_conf->set(m_nm, val, getSk());
if (!ret)
LOGERR("Value set failed\n" );
return ret;
virtual bool set(const string& val) {
if (!m_conf)
return false;
LOGDEB1("Setting [" << m_nm << "] value to [" << val << "]\n");
bool ret = m_conf->set(m_nm, val, getSk());
if (!ret)
LOGERR("Value set failed\n" );
return ret;
}
virtual bool get(string& val)
{
if (!m_conf)
return false;
bool ret = m_conf->get(m_nm, val, getSk());
LOGDEB1("ConfLinkRcl::get: [" << m_nm << "] sk [" <<
virtual bool get(string& val) {
if (!m_conf)
return false;
bool ret = m_conf->get(m_nm, val, getSk());
LOGDEB1("ConfLinkRcl::get: [" << m_nm << "] sk [" <<
getSk() << "] -> [" << (ret ? val : "no value") << "]\n" );
return ret;
return ret;
}
private:
string getSk() {
@ -99,18 +96,18 @@ typedef std::function<vector<string>()> RclConfVecValueGetter;
class ConfLinkPlusMinus : public ConfLinkRep {
public:
ConfLinkPlusMinus(RclConfig *rclconf, ConfNull *conf,
const string& basename, RclConfVecValueGetter getter,
string *sk = 0)
: m_rclconf(rclconf), m_conf(conf),
const string& basename, RclConfVecValueGetter getter,
string *sk = 0)
: m_rclconf(rclconf), m_conf(conf),
m_basename(basename), m_getter(getter),
m_sk(sk) /* KEEP THE POINTER, shared data */
{
}
{
}
virtual ~ConfLinkPlusMinus() {}
virtual bool set(const string& snval) {
if (!m_conf || !m_rclconf)
return false;
if (!m_conf || !m_rclconf)
return false;
string sbase;
m_conf->get(m_basename, sbase, getSk());
@ -130,14 +127,14 @@ public:
}
virtual bool get(string& val) {
if (!m_conf || !m_rclconf)
return false;
if (!m_conf || !m_rclconf)
return false;
m_rclconf->setKeyDir(getSk());
vector<string> vval = m_getter();
val = stringsToString(vval);
LOGDEB1("ConfLinkPlusMinus: "<<m_basename<<" -> " << val <<std::endl);
return true;
return true;
}
private:
@ -163,7 +160,7 @@ ConfIndexW::ConfIndexW(QWidget *parent, RclConfig *config)
reloadPanels();
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
| QDialogButtonBox::Cancel);
| QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(tabWidget);
@ -180,13 +177,13 @@ void ConfIndexW::acceptChanges()
{
LOGDEB("ConfIndexW::acceptChanges()\n" );
if (!m_conf) {
LOGERR("ConfIndexW::acceptChanges: no config\n" );
return;
LOGERR("ConfIndexW::acceptChanges: no config\n" );
return;
}
// Let the changes to disk
if (!m_conf->holdWrites(false)) {
QMessageBox::critical(0, "Recoll",
tr("Can't write configuration file"));
QMessageBox::critical(0, "Recoll",
tr("Can't write configuration file"));
}
// Delete local copy and update the main one from the file
delete m_conf;
@ -208,7 +205,7 @@ void ConfIndexW::rejectChanges()
void ConfIndexW::reloadPanels()
{
if ((m_conf = m_rclconf->cloneMainConfig()) == 0)
return;
return;
m_conf->holdWrites(true);
tabWidget->clear();
m_widgets.clear();
@ -216,7 +213,7 @@ void ConfIndexW::reloadPanels()
QWidget *w = new ConfTopPanelW(this, m_conf);
m_widgets.push_back(w);
tabWidget->addTab(w, QObject::tr("Global parameters"));
w = new ConfSubPanelW(this, m_conf, m_rclconf);
m_widgets.push_back(w);
tabWidget->addTab(w, QObject::tr("Local parameters"));
@ -242,17 +239,17 @@ ConfBeaglePanelW::ConfBeaglePanelW(QWidget *parent, ConfNull *config)
ConfParamBoolW* cp1 =
new ConfParamBoolW(this, lnk1, tr("Process the WEB history queue"),
tr("Enables indexing Firefox visited pages.<br>"
"(you need also install the Firefox Recoll plugin)"
));
"(you need also install the Firefox Recoll plugin)"
));
vboxLayout->addWidget(cp1);
ConfLink lnk2(new ConfLinkRclRep(config, "webcachedir"));
ConfParamFNW* cp2 =
new ConfParamFNW(this, lnk2, tr("Web page store directory name"),
tr("The name for a directory where to store the copies "
"of visited web pages.<br>"
"A non-absolute path is taken relative to the "
"configuration directory."), true);
tr("The name for a directory where to store the copies "
"of visited web pages.<br>"
"A non-absolute path is taken relative to the "
"configuration directory."), true);
cp2->setEnabled(cp1->m_cb->isChecked());
connect(cp1->m_cb, SIGNAL(toggled(bool)), cp2, SLOT(setEnabled(bool)));
vboxLayout->addWidget(cp2);
@ -260,12 +257,12 @@ ConfBeaglePanelW::ConfBeaglePanelW(QWidget *parent, ConfNull *config)
ConfLink lnk3(new ConfLinkRclRep(config, "webcachemaxmbs"));
ConfParamIntW *cp3 =
new ConfParamIntW(this, lnk3, tr("Max. size for the web store (MB)"),
tr("Entries will be recycled once the size is reached."
"<br>"
"Only increasing the size really makes sense because "
"reducing the value will not truncate an existing "
"file (only waste space at the end)."
),
tr("Entries will be recycled once the size is reached."
"<br>"
"Only increasing the size really makes sense because "
"reducing the value will not truncate an existing "
"file (only waste space at the end)."
),
-1, 1000*1000); // Max 1TB...
cp3->setEnabled(cp1->m_cb->isChecked());
connect(cp1->m_cb, SIGNAL(toggled(bool)), cp3, SLOT(setEnabled(bool)));
@ -281,58 +278,58 @@ ConfSearchPanelW::ConfSearchPanelW(QWidget *parent, ConfNull *config)
vboxLayout->setMargin(margin);
if (!o_index_stripchars) {
ConfLink lnk1(new ConfLinkRclRep(config, "autodiacsens"));
ConfParamBoolW* cp1 =
new ConfParamBoolW(this, lnk1, tr("Automatic diacritics sensitivity"),
tr("<p>Automatically trigger diacritics sensitivity "
"if the search term has accented characters "
"(not in unac_except_trans). Else you need to "
"use the query language and the <i>D</i> "
"modifier to specify "
"diacritics sensitivity."
));
vboxLayout->addWidget(cp1);
ConfLink lnk1(new ConfLinkRclRep(config, "autodiacsens"));
ConfParamBoolW* cp1 =
new ConfParamBoolW(this, lnk1, tr("Automatic diacritics sensitivity"),
tr("<p>Automatically trigger diacritics sensitivity "
"if the search term has accented characters "
"(not in unac_except_trans). Else you need to "
"use the query language and the <i>D</i> "
"modifier to specify "
"diacritics sensitivity."
));
vboxLayout->addWidget(cp1);
ConfLink lnk2(new ConfLinkRclRep(config, "autocasesens"));
ConfParamBoolW* cp2 =
new ConfParamBoolW(this, lnk2,
tr("Automatic character case sensitivity"),
tr("<p>Automatically trigger character case "
"sensitivity if the entry has upper-case "
"characters in any but the first position. "
"Else you need to use the query language and "
"the <i>C</i> modifier to specify character-case "
"sensitivity."
));
vboxLayout->addWidget(cp2);
ConfLink lnk2(new ConfLinkRclRep(config, "autocasesens"));
ConfParamBoolW* cp2 =
new ConfParamBoolW(this, lnk2,
tr("Automatic character case sensitivity"),
tr("<p>Automatically trigger character case "
"sensitivity if the entry has upper-case "
"characters in any but the first position. "
"Else you need to use the query language and "
"the <i>C</i> modifier to specify character-case "
"sensitivity."
));
vboxLayout->addWidget(cp2);
}
ConfLink lnk3(new ConfLinkRclRep(config, "maxTermExpand"));
ConfParamIntW* cp3 =
new ConfParamIntW(this, lnk3,
tr("Maximum term expansion count"),
tr("<p>Maximum expansion count for a single term "
"(e.g.: when using wildcards). The default "
"of 10 000 is reasonable and will avoid "
"queries that appear frozen while the engine is "
"walking the term list."
));
tr("Maximum term expansion count"),
tr("<p>Maximum expansion count for a single term "
"(e.g.: when using wildcards). The default "
"of 10 000 is reasonable and will avoid "
"queries that appear frozen while the engine is "
"walking the term list."
));
vboxLayout->addWidget(cp3);
ConfLink lnk4(new ConfLinkRclRep(config, "maxXapianClauses"));
ConfParamIntW* cp4 =
new ConfParamIntW(this, lnk4,
tr("Maximum Xapian clauses count"),
tr("<p>Maximum number of elementary clauses we "
"add to a single Xapian query. In some cases, "
"the result of term expansion can be "
"multiplicative, and we want to avoid using "
"excessive memory. The default of 100 000 "
"should be both high enough in most cases "
"and compatible with current typical hardware "
"configurations."
));
tr("Maximum Xapian clauses count"),
tr("<p>Maximum number of elementary clauses we "
"add to a single Xapian query. In some cases, "
"the result of term expansion can be "
"multiplicative, and we want to avoid using "
"excessive memory. The default of 100 000 "
"should be both high enough in most cases "
"and compatible with current typical hardware "
"configurations."
));
vboxLayout->addWidget(cp4);
vboxLayout->insertStretch(-1);
@ -358,17 +355,17 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, ConfNull *config)
gl1->addWidget(w, gridrow++, 0, 1, 2);
ConfParamSLW *eskp = new
ConfParamSLW(this,
ConfParamSLW(this,
ConfLink(new ConfLinkRclRep(config, "skippedPaths")),
tr("Skipped paths"),
tr("These are pathnames of directories which indexing "
"will not enter.<br>"
tr("These are pathnames of directories which indexing "
"will not enter.<br>"
"Path elements may contain wildcards. "
"The entries must match the paths seen by the indexer "
"The entries must match the paths seen by the indexer "
"(e.g.: if topdirs includes '/home/me' and '/home' is "
"actually a link "
"to '/usr/home', a correct skippedPath entry "
"would be '/home/me/tmp*', not '/usr/home/me/tmp*')"));
"to '/usr/home', a correct skippedPath entry "
"would be '/home/me/tmp*', not '/usr/home/me/tmp*')"));
eskp->setFsEncoding(true);
setSzPol(eskp, QSizePolicy::Preferred, QSizePolicy::Preferred, 1, 3);
gl1->addWidget(eskp, gridrow++, 0, 1, 2);
@ -376,16 +373,16 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, ConfNull *config)
vector<string> cstemlangs = Rcl::Db::getStemmerNames();
QStringList stemlangs;
for (vector<string>::const_iterator it = cstemlangs.begin();
it != cstemlangs.end(); it++) {
stemlangs.push_back(QString::fromUtf8(it->c_str()));
it != cstemlangs.end(); it++) {
stemlangs.push_back(QString::fromUtf8(it->c_str()));
}
w = new
ConfParamCSLW(this,
ConfParamCSLW(this,
ConfLink(new ConfLinkRclRep(config,
"indexstemminglanguages")),
tr("Stemming languages"),
tr("The languages for which stemming expansion<br>"
"dictionaries will be built."), stemlangs);
tr("The languages for which stemming expansion<br>"
"dictionaries will be built."), stemlangs);
setSzPol(w, QSizePolicy::Preferred, QSizePolicy::Preferred, 1, 1);
gl1->addWidget(w, gridrow, 0);
@ -412,9 +409,9 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, ConfNull *config)
ConfLink(new ConfLinkRclRep(config, "idxflushmb")),
tr("Index flush megabytes interval"),
tr("This value adjust the amount of "
"data which is indexed between flushes to disk.<br>"
"This helps control the indexer memory usage. "
"Default 10MB "), 0, 1000);
"data which is indexed between flushes to disk.<br>"
"This helps control the indexer memory usage. "
"Default 10MB "), 0, 1000);
gl1->addWidget(w, gridrow++, 1);
w = new ConfParamIntW(this,
@ -443,10 +440,10 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, ConfNull *config)
tr("The language for the aspell dictionary. "
"This should look like 'en' or 'fr' ...<br>"
"If this value is not set, the NLS environment "
"will be used to compute it, which usually works. "
"To get an idea of what is installed on your system, "
"type 'aspell config' and look for .dat files inside "
"the 'data-dir' directory. "));
"will be used to compute it, which usually works. "
"To get an idea of what is installed on your system, "
"type 'aspell config' and look for .dat files inside "
"the 'data-dir' directory. "));
cpaspl->setEnabled(!cpasp->m_cb->isChecked());
connect(cpasp->m_cb, SIGNAL(toggled(bool)), cpaspl,SLOT(setDisabled(bool)));
gl1->addWidget(cpaspl, gridrow++, 1);
@ -456,13 +453,13 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, ConfNull *config)
ConfLink(new ConfLinkRclRep(config, "dbdir")),
tr("Database directory name"),
tr("The name for a directory where to store the index<br>"
"A non-absolute path is taken relative to the "
"configuration directory. The default is 'xapiandb'."
), true);
"A non-absolute path is taken relative to the "
"configuration directory. The default is 'xapiandb'."
), true);
gl1->addWidget(w, gridrow++, 0, 1, 2);
w = new
ConfParamStrW(this,
ConfParamStrW(this,
ConfLink(new ConfLinkRclRep(config, "unac_except_trans")),
tr("Unac exceptions"),
tr("<p>These are exceptions to the unac mechanism "
@ -486,19 +483,19 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
vboxLayout->setMargin(margin);
m_subdirs = new
ConfParamDNLW(this,
ConfParamDNLW(this,
ConfLink(new ConfLinkNullRep()),
QObject::tr("<b>Customised subtrees"),
QObject::tr("The list of subdirectories in the indexed "
"hierarchy <br>where some parameters need "
"to be redefined. Default: empty."));
QObject::tr("<b>Customised subtrees"),
QObject::tr("The list of subdirectories in the indexed "
"hierarchy <br>where some parameters need "
"to be redefined. Default: empty."));
m_subdirs->getListBox()->setSelectionMode(QAbstractItemView::SingleSelection);
connect(m_subdirs->getListBox(),
SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
this,
SLOT(subDirChanged(QListWidgetItem *, QListWidgetItem *)));
SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
this,
SLOT(subDirChanged(QListWidgetItem *, QListWidgetItem *)));
connect(m_subdirs, SIGNAL(entryDeleted(QString)),
this, SLOT(subDirDeleted(QString)));
this, SLOT(subDirDeleted(QString)));
// We only retrieve the subkeys from the user's config (shallow),
// no use to confuse the user by showing the subtrees which are
@ -509,8 +506,8 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
QStringList qls;
for (vector<string>::const_iterator it = allkeydirs.begin();
it != allkeydirs.end(); it++) {
qls.push_back(QString::fromUtf8(it->c_str()));
it != allkeydirs.end(); it++) {
qls.push_back(QString::fromUtf8(it->c_str()));
}
m_subdirs->getListBox()->insertItems(0, qls);
vboxLayout->addWidget(m_subdirs);
@ -523,13 +520,13 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
QLabel *explain = new QLabel(this);
explain->setWordWrap(true);
explain->setText(
QObject::
tr("<i>The parameters that follow are set either at the "
"top level, if nothing "
"or an empty line is selected in the listbox above, "
"or for the selected subdirectory. "
"You can add or remove directories by clicking "
"the +/- buttons."));
QObject::
tr("<i>The parameters that follow are set either at the "
"top level, if nothing "
"or an empty line is selected in the listbox above, "
"or for the selected subdirectory. "
"You can add or remove directories by clicking "
"the +/- buttons."));
vboxLayout->addWidget(explain);
@ -556,8 +553,8 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
vector<string> amimes = rclconf->getAllMimeTypes();
QStringList amimesq;
for (vector<string>::const_iterator it = amimes.begin();
it != amimes.end(); it++) {
amimesq.push_back(QString::fromUtf8(it->c_str()));
it != amimes.end(); it++) {
amimesq.push_back(QString::fromUtf8(it->c_str()));
}
ConfParamCSLW *eincm = new ConfParamCSLW(
@ -597,7 +594,7 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
string cmd = "iconv";
int status = ex.doexec(cmd, args, 0, &icout);
if (status) {
LOGERR("Can't get list of charsets from 'iconv -l'" );
LOGERR("Can't get list of charsets from 'iconv -l'" );
}
icout = neutchars(icout, ",");
list<string> ccsets;
@ -605,8 +602,8 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
QStringList charsets;
charsets.push_back("");
for (list<string>::const_iterator it = ccsets.begin();
it != ccsets.end(); it++) {
charsets.push_back(QString::fromUtf8(it->c_str()));
it != ccsets.end(); it++) {
charsets.push_back(QString::fromUtf8(it->c_str()));
}
ConfParamCStrW *e21 = new ConfParamCStrW(
@ -692,21 +689,21 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, ConfNull *config,
void ConfSubPanelW::reloadAll()
{
for (list<ConfParamW*>::iterator it = m_widgets.begin();
it != m_widgets.end(); it++) {
(*it)->loadValue();
it != m_widgets.end(); it++) {
(*it)->loadValue();
}
}
void ConfSubPanelW::subDirChanged(QListWidgetItem *current, QListWidgetItem *)
{
LOGDEB("ConfSubPanelW::subDirChanged\n" );
if (current == 0 || current->text() == "") {
m_sk = "";
m_groupbox->setTitle(tr("Global"));
m_sk = "";
m_groupbox->setTitle(tr("Global"));
} else {
m_sk = (const char *) current->text().toUtf8();
m_groupbox->setTitle(current->text());
m_sk = (const char *) current->text().toUtf8();
m_groupbox->setTitle(current->text());
}
LOGDEB("ConfSubPanelW::subDirChanged: now [" << (m_sk) << "]\n" );
reloadAll();
@ -716,9 +713,9 @@ void ConfSubPanelW::subDirDeleted(QString sbd)
{
LOGDEB("ConfSubPanelW::subDirDeleted(" << ((const char *)sbd.toUtf8()) << ")\n" );
if (sbd == "") {
// Can't do this, have to reinsert it
QTimer::singleShot(0, this, SLOT(restoreEmpty()));
return;
// Can't do this, have to reinsert it
QTimer::singleShot(0, this, SLOT(restoreEmpty()));
return;
}
// Have to delete all entries for submap
m_config->eraseKey((const char *)sbd.toUtf8());
@ -731,4 +728,3 @@ void ConfSubPanelW::restoreEmpty()
}
} // Namespace confgui

View File

@ -1331,14 +1331,6 @@ Prověřte soubor pracovní plochy</translation>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1368,6 +1360,34 @@ Prověřte soubor pracovní plochy</translation>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2391,7 +2411,7 @@ Použijte odkaz &lt;b&gt;Ukázat hledání&lt;/b&gt;, když máte o výsledku po
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation>Začáteční adresář (jinak použít počáteční adresáře):</translation>
<translation type="vanished">Začáteční adresář (jinak použít počáteční adresáře):</translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
@ -2409,6 +2429,10 @@ Použijte odkaz &lt;b&gt;Ukázat hledání&lt;/b&gt;, když máte o výsledku po
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1239,14 +1239,6 @@ Tjek venligst desktopfilen</translation>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1276,6 +1268,34 @@ Tjek venligst desktopfilen</translation>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2056,7 +2076,7 @@ Brug &lt;b&gt;Vis Forespørgsel&lt;/b&gt; link når i tvivl om resultatet og se
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation>Startmappe (ellers brug de regulære øverste mapper):</translation>
<translation type="vanished">Startmappe (ellers brug de regulære øverste mapper):</translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
@ -2074,6 +2094,10 @@ Brug &lt;b&gt;Vis Forespørgsel&lt;/b&gt; link når i tvivl om resultatet og se
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1299,14 +1299,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1336,6 +1328,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2328,10 +2348,6 @@ Drücken Sie ESC+Leerzeichen für Vervollständigungen des aktuellen Begriffs.</
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2348,6 +2364,10 @@ Drücken Sie ESC+Leerzeichen für Vervollständigungen des aktuellen Begriffs.</
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1283,14 +1283,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1320,6 +1312,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2239,10 +2259,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished">Περιήγηση</translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2259,6 +2275,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1289,14 +1289,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1326,6 +1318,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2282,10 +2302,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished">Buscar</translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2302,6 +2318,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

Binary file not shown.

View File

@ -1347,11 +1347,11 @@ Merci de vérifier le fichier desktop </translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation>(%d documents/%d fichiers/%d erreurs/%d fichiers en tout) </translation>
<translation type="vanished">(%d documents/%d fichiers/%d erreurs/%d fichiers en tout) </translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation>(%d documents/%d fichiers/%d erreurs) </translation>
<translation type="vanished">(%d documents/%d fichiers/%d erreurs) </translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
@ -1382,6 +1382,34 @@ Merci de vérifier le fichier desktop </translation>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation>Cliquer Annuler pour retourner à la liste.&lt;br&gt;Cliquer Ignorer pour afficher la prévisualisation (et enregister l&apos;option pour cette session). Il y a un risque d&apos;afficher le mauvais document.&lt;br/&gt;</translation>
</message>
<message>
<source>documents</source>
<translation>documents</translation>
</message>
<message>
<source>document</source>
<translation>document</translation>
</message>
<message>
<source>files</source>
<translation>fichiers</translation>
</message>
<message>
<source>file</source>
<translation>fichier</translation>
</message>
<message>
<source>errors</source>
<translation>erreurs</translation>
</message>
<message>
<source>error</source>
<translation>erreur</translation>
</message>
<message>
<source>total files)</source>
<translation>fichiers totaux)</translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2421,7 +2449,7 @@ Utiliser le lien &lt;b&gt;Afficher la requête en détail&lt;/b&gt; en cas de do
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation>Répertoire de départ (sinon utiliser la variable normale topdirs) :</translation>
<translation type="vanished">Répertoire de départ (sinon utiliser la variable normale topdirs) :</translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
@ -2443,6 +2471,14 @@ Utiliser le lien &lt;b&gt;Afficher la requête en détail&lt;/b&gt; en cas de do
<source>Retry previously failed files.</source>
<translation>Ne pas réessayer les fichiers en erreur.</translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. We use topdirs if empty.</source>
<translation type="vanished">Répertoire de départ. Doit faire partie de la zone indexée. topdirs est utilisé si non renseigné.</translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation>Répertoire de départ. Doit faire partie de la zone indexée. Traite toute la zone si non renseigné.</translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1203,14 +1203,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1240,6 +1232,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2077,10 +2097,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished">Esplora</translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2097,6 +2113,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1223,14 +1223,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1260,6 +1252,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2161,10 +2181,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished">Naršyti</translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2181,6 +2197,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -748,7 +748,7 @@ Click Cancel if you want to edit the configuration file before indexing starts,
<context>
<name>QObject</name>
<message>
<location filename="../confgui/confguiindex.cpp" line="+218"/>
<location filename="../confgui/confguiindex.cpp" line="+215"/>
<source>Global parameters</source>
<translation>Общие параметры</translation>
</message>
@ -1064,8 +1064,8 @@ p, li { white-space: pre-wrap; }
<translation>Невозможно извлечь сведения о документе из БД</translation>
</message>
<message>
<location filename="../rclm_idx.cpp" line="+261"/>
<location line="+271"/>
<location filename="../rclm_idx.cpp" line="+263"/>
<location line="+273"/>
<location line="+19"/>
<location filename="../rclm_preview.cpp" line="-138"/>
<location line="+44"/>
@ -1101,7 +1101,7 @@ p, li { white-space: pre-wrap; }
<translation>История</translation>
</message>
<message>
<location filename="../rclm_idx.cpp" line="-507"/>
<location filename="../rclm_idx.cpp" line="-511"/>
<source>Indexing in progress: </source>
<translation>Идёт индексирование: </translation>
</message>
@ -1162,7 +1162,7 @@ Please check the mimeconf file</source>
<translation>ошибка получения списка языков</translation>
</message>
<message>
<location filename="../rclm_idx.cpp" line="+121"/>
<location filename="../rclm_idx.cpp" line="+123"/>
<source>Update &amp;Index</source>
<translation>Обновить &amp;индекс</translation>
</message>
@ -1172,7 +1172,42 @@ Please check the mimeconf file</source>
<translation>Индексирование прервано</translation>
</message>
<message>
<location line="+34"/>
<location line="-66"/>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+94"/>
<location line="+27"/>
<source>Stop &amp;Indexing</source>
<translation>О&amp;становить индексирование</translation>
@ -1309,7 +1344,7 @@ Do you want to start the preferences dialog ?</source>
<translation>Поиск не дал результатов</translation>
</message>
<message>
<location filename="../rclm_idx.cpp" line="-136"/>
<location filename="../rclm_idx.cpp" line="-138"/>
<source>None</source>
<translation>Отсутствует</translation>
</message>
@ -1329,17 +1364,7 @@ Do you want to start the preferences dialog ?</source>
<translation>Монитор</translation>
</message>
<message>
<location line="+8"/>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<location line="+74"/>
<source>Indexing failed</source>
<translation>Не удалось выполнить индексирование</translation>
</message>
@ -1370,7 +1395,7 @@ Do you want to start the preferences dialog ?</source>
<translation>Сбросить индекс и начать заново?</translation>
</message>
<message>
<location line="+193"/>
<location line="+195"/>
<source>Can&apos;t update index: internal error</source>
<translation type="unfinished"></translation>
</message>
@ -1501,7 +1526,7 @@ Please check the desktop file</source>
<translation type="vanished">Для запуска текущего процесса индексирования был использован другой интерфейс. Прекратить выполнение процесса невозможно</translation>
</message>
<message>
<location filename="../rclm_idx.cpp" line="-303"/>
<location filename="../rclm_idx.cpp" line="-305"/>
<source>Bad paths</source>
<translation>Неверные пути</translation>
</message>
@ -1512,7 +1537,7 @@ Please check the desktop file</source>
</translation>
</message>
<message>
<location line="+279"/>
<location line="+281"/>
<source>Selection patterns need topdir</source>
<translation>Для шаблонов отбора требуется topdir</translation>
</message>
@ -1622,7 +1647,7 @@ Please check the desktop file</source>
<translation>Больше не показывать (для восстановления значений используйте окно настройки интерфейса).</translation>
</message>
<message>
<location filename="../rclm_idx.cpp" line="-342"/>
<location filename="../rclm_idx.cpp" line="-344"/>
<source>Index locked</source>
<translation>Индекс заблокирован</translation>
</message>
@ -2138,12 +2163,12 @@ Please check the desktop file</source>
<translation>Дата и время</translation>
</message>
<message>
<location line="+193"/>
<location line="+189"/>
<source>Can&apos;t sort by inverse relevance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-202"/>
<location line="-198"/>
<source>Ipath</source>
<translation>Ipath</translation>
</message>
@ -2293,7 +2318,7 @@ Please check the desktop file</source>
<context>
<name>ResTable</name>
<message>
<location filename="../restable.cpp" line="+787"/>
<location filename="../restable.cpp" line="+783"/>
<source>&amp;Reset sort</source>
<translation>&amp;Сбросить сортировку</translation>
</message>
@ -2311,7 +2336,7 @@ Please check the desktop file</source>
<translation type="obsolete">&quot;</translation>
</message>
<message>
<location line="-313"/>
<location line="-312"/>
<source>Save table to CSV file</source>
<translation>Сохранить таблицу в CSV-файл</translation>
</message>
@ -2353,7 +2378,7 @@ Please check the desktop file</source>
<translation type="obsolete">&amp;Открыть родительский документ/каталог</translation>
</message>
<message>
<location line="+301"/>
<location line="+300"/>
<source>&amp;Save as CSV</source>
<translation>&amp;Сохранить как CSV</translation>
</message>
@ -2843,8 +2868,12 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
</message>
<message>
<location line="+10"/>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation>Корневой каталог (или использовать стандартный topdirs):</translation>
<translation type="vanished">Корневой каталог (или использовать стандартный topdirs):</translation>
</message>
<message>
<location line="+14"/>
@ -3609,7 +3638,7 @@ This should give higher precedence to the results where the search terms appear
<translation type="obsolete">Просмотр</translation>
</message>
<message>
<location filename="../confgui/confgui.cpp" line="+258"/>
<location filename="../confgui/confgui.cpp" line="+267"/>
<source>Choose</source>
<translation>Выбрать</translation>
</message>
@ -3617,7 +3646,7 @@ This should give higher precedence to the results where the search terms appear
<context>
<name>confgui::ConfParamSLW</name>
<message>
<location line="+54"/>
<location line="+59"/>
<source>+</source>
<translation>+</translation>
</message>

View File

@ -1204,14 +1204,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1241,6 +1233,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2078,10 +2098,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished">Gözat</translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2098,6 +2114,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1221,14 +1221,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1258,6 +1250,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2107,10 +2127,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished">Перегляд</translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2127,6 +2143,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1144,14 +1144,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1181,6 +1173,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -1842,10 +1862,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -1862,6 +1878,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1317,14 +1317,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1354,6 +1346,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2250,10 +2270,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2270,6 +2286,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -1330,14 +1330,6 @@ Please check the desktop file</source>
<source>Content has been indexed for these MIME types:</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors/%d total files) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>(%d documents/%d files/%d errors) </source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Empty or non-existant paths in configuration file. Click Ok to start indexing anyway (absent data will not be purged from the index):
</source>
@ -1367,6 +1359,34 @@ Please check the desktop file</source>
<source>Click Cancel to return to the list.&lt;br&gt;Click Ignore to show the preview anyway (and remember for this session). There is a risk of showing the wrong entry.&lt;br/&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>documents</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>document</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>files</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>file</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>errors</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>error</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>total files)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RclMainBase</name>
@ -2283,10 +2303,6 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Browse</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory (else use regular topdirs):</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Leave empty to select all files. You can use multiple space-separated shell-type patterns.&lt;br&gt;Patterns with embedded spaces should be quoted with double quotes.&lt;br&gt;Can only be used if the start target is set.</source>
<translation type="unfinished"></translation>
@ -2303,6 +2319,10 @@ Use &lt;b&gt;Show Query&lt;/b&gt; link when in doubt about result and see manual
<source>Retry previously failed files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellBase</name>

View File

@ -55,20 +55,22 @@ void RclMain::updateIdxStatus()
}
msg += phs + " ";
if (status.phase == DbIxStatus::DBIXS_FILES) {
char cnts[100];
if (status.dbtotdocs > 0) {
string format =
qs2utf8s(tr("(%d documents/%d files/%d errors/%d total files) "));
sprintf(cnts, format.c_str(),
status.docsdone, status.filesdone, status.fileerrors,
status.totfiles);
QString sdocs = status.docsdone > 1 ?tr("documents") : tr("document");
QString sfiles = status.filesdone > 1 ? tr("files") : tr("file");
QString serrors = status.fileerrors > 1 ? tr("errors") : tr("error");
QString stats;
if (status.dbtotdocs > 0) {
stats = QString("(%1 ") + sdocs + "/%2 " + sfiles +
"/%3 " + serrors + "/%4 " + tr("total files)");
stats = stats.arg(status.docsdone).arg(status.filesdone).
arg(status.fileerrors).arg(status.totfiles);
} else {
string format =
qs2utf8s(tr("(%d documents/%d files/%d errors) "));
sprintf(cnts, format.c_str(),
status.docsdone, status.filesdone, status.fileerrors);
stats = QString("(%1 ") + sdocs + "/%2 " + sfiles +
"/%3 " + serrors + ") ";
stats = stats.arg(status.docsdone).arg(status.filesdone).
arg(status.fileerrors);
}
msg += QString::fromUtf8(cnts) + " ";
msg += stats + " ";
}
string mf;int ecnt = 0;
string fcharset = theconfig->getDefCharset(true);
@ -95,10 +97,10 @@ void RclMain::periodic100()
}
if (m_idxproc) {
// An indexing process was launched. If its' done, see status.
int status;
bool exited = m_idxproc->maybereap(&status);
if (exited) {
// An indexing process was launched. If its' done, see status.
int status;
bool exited = m_idxproc->maybereap(&status);
if (exited) {
QString reasonmsg;
if (m_idxreasontmp && m_idxreasontmp->ok()) {
string reasons;
@ -115,8 +117,8 @@ void RclMain::periodic100()
}
}
}
deleteZ(m_idxproc);
if (status) {
deleteZ(m_idxproc);
if (status) {
if (m_idxkilled) {
QMessageBox::warning(0, "Recoll",
tr("Indexing interrupted"));
@ -129,58 +131,58 @@ void RclMain::periodic100()
}
QMessageBox::warning(0, "Recoll", msg);
}
} else {
// On the first run, show missing helpers. We only do this once
if (m_firstIndexing)
showMissingHelpers();
} else {
// On the first run, show missing helpers. We only do this once
if (m_firstIndexing)
showMissingHelpers();
if (!reasonmsg.isEmpty()) {
QString msg = tr("Non-fatal indexing message: ");
msg.append(reasonmsg);
QMessageBox::warning(0, "Recoll", msg);
}
}
string reason;
maybeOpenDb(reason, 1);
} else {
// update/show status even if the status file did not
// change (else the status line goes blank during
// lengthy operations).
updateIdxStatus();
}
}
string reason;
maybeOpenDb(reason, 1);
} else {
// update/show status even if the status file did not
// change (else the status line goes blank during
// lengthy operations).
updateIdxStatus();
}
}
// Update the "start/stop indexing" menu entry, can't be done from
// the "start/stop indexing" slot itself
IndexerState prevstate = m_indexerState;
if (m_idxproc) {
m_indexerState = IXST_RUNNINGMINE;
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(false);
m_indexerState = IXST_RUNNINGMINE;
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(false);
actionSpecial_Indexing->setEnabled(false);
periodictimer->setInterval(200);
periodictimer->setInterval(200);
} else {
Pidfile pidfile(theconfig->getPidfile());
Pidfile pidfile(theconfig->getPidfile());
pid_t pid = pidfile.open();
fileBumpIndexingAction->setEnabled(false);
if (pid == getpid()) {
// Locked by me
m_indexerState = IXST_NOTRUNNING;
fileToggleIndexingAction->setText(tr("Index locked"));
fileToggleIndexingAction->setEnabled(false);
fileRebuildIndexAction->setEnabled(false);
m_indexerState = IXST_NOTRUNNING;
fileToggleIndexingAction->setText(tr("Index locked"));
fileToggleIndexingAction->setEnabled(false);
fileRebuildIndexAction->setEnabled(false);
actionSpecial_Indexing->setEnabled(false);
periodictimer->setInterval(1000);
periodictimer->setInterval(1000);
} else if (pid == 0) {
m_indexerState = IXST_NOTRUNNING;
fileToggleIndexingAction->setText(tr("Update &Index"));
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(true);
m_indexerState = IXST_NOTRUNNING;
fileToggleIndexingAction->setText(tr("Update &Index"));
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(true);
actionSpecial_Indexing->setEnabled(true);
periodictimer->setInterval(1000);
} else {
// Real time or externally started batch indexer running
m_indexerState = IXST_RUNNINGNOTMINE;
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
periodictimer->setInterval(1000);
} else {
// Real time or externally started batch indexer running
m_indexerState = IXST_RUNNINGNOTMINE;
fileToggleIndexingAction->setText(tr("Stop &Indexing"));
DbIxStatus status;
readIdxStatus(theconfig, status);
if (status.hasmonitor) {
@ -188,11 +190,11 @@ void RclMain::periodic100()
// incremental pass
fileBumpIndexingAction->setEnabled(true);
}
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(false);
fileToggleIndexingAction->setEnabled(true);
fileRebuildIndexAction->setEnabled(false);
actionSpecial_Indexing->setEnabled(false);
periodictimer->setInterval(200);
}
periodictimer->setInterval(200);
}
}
if ((prevstate == IXST_RUNNINGMINE || prevstate == IXST_RUNNINGNOTMINE)
@ -202,22 +204,22 @@ void RclMain::periodic100()
// Possibly cleanup the dead viewers
for (vector<ExecCmd*>::iterator it = m_viewers.begin();
it != m_viewers.end(); it++) {
int status;
if ((*it)->maybereap(&status)) {
deleteZ(*it);
}
it != m_viewers.end(); it++) {
int status;
if ((*it)->maybereap(&status)) {
deleteZ(*it);
}
}
vector<ExecCmd*> v;
for (vector<ExecCmd*>::iterator it = m_viewers.begin();
it != m_viewers.end(); it++) {
if (*it)
v.push_back(*it);
it != m_viewers.end(); it++) {
if (*it)
v.push_back(*it);
}
m_viewers = v;
if (recollNeedsExit)
fileExit();
fileExit();
}
bool RclMain::checkIdxPaths()
@ -246,43 +248,43 @@ void RclMain::toggleIndexing()
{
switch (m_indexerState) {
case IXST_RUNNINGMINE:
if (m_idxproc) {
// Indexing was in progress, request stop. Let the periodic
// routine check for the results.
if (m_idxproc) {
// Indexing was in progress, request stop. Let the periodic
// routine check for the results.
if (m_idxproc->requestChildExit()) {
m_idxkilled = true;
}
}
break;
}
break;
case IXST_RUNNINGNOTMINE:
{
int rep =
QMessageBox::information(
int rep =
QMessageBox::information(
0, tr("Warning"),
tr("The current indexing process was not started from this "
"interface. Click Ok to kill it "
"anyway, or Cancel to leave it alone"),
QMessageBox::Ok, QMessageBox::Cancel, QMessageBox::NoButton);
if (rep == QMessageBox::Ok) {
if (rep == QMessageBox::Ok) {
#ifdef _WIN32
// No simple way to signal the process. Use the stop file
::close(::creat(theconfig->getIdxStopFile().c_str(), 0666));
#else
Pidfile pidfile(theconfig->getPidfile());
pid_t pid = pidfile.open();
if (pid > 0)
kill(pid, SIGTERM);
Pidfile pidfile(theconfig->getPidfile());
pid_t pid = pidfile.open();
if (pid > 0)
kill(pid, SIGTERM);
#endif // !_WIN32
}
}
}
break;
case IXST_NOTRUNNING:
{
// Could also mean that no helpers are missing, but then we
// won't try to show a message anyway (which is what
// firstIndexing is used for)
string mhd;
m_firstIndexing = !theconfig->getMissingHelperDesc(mhd);
// Could also mean that no helpers are missing, but then we
// won't try to show a message anyway (which is what
// firstIndexing is used for)
string mhd;
m_firstIndexing = !theconfig->getMissingHelperDesc(mhd);
if (!checkIdxPaths()) {
return;
@ -292,8 +294,8 @@ void RclMain::toggleIndexing()
args.push_back("-R");
args.push_back(m_idxreasontmp->filename());
}
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
}
break;
case IXST_UNKNOWN:
@ -347,21 +349,21 @@ void RclMain::rebuildIndex()
case IXST_UNKNOWN:
case IXST_RUNNINGMINE:
case IXST_RUNNINGNOTMINE:
return; //?? Should not have been called
return; //?? Should not have been called
case IXST_NOTRUNNING:
{
if (m_idxproc) {
LOGERR("RclMain::rebuildIndex: current indexer exec not null\n" );
return;
}
int rep =
QMessageBox::warning(0, tr("Erasing index"),
tr("Reset the index and start "
"from scratch ?"),
QMessageBox::Ok,
QMessageBox::Cancel,
QMessageBox::NoButton);
if (rep == QMessageBox::Ok) {
int rep =
QMessageBox::warning(0, tr("Erasing index"),
tr("Reset the index and start "
"from scratch ?"),
QMessageBox::Ok,
QMessageBox::Cancel,
QMessageBox::NoButton);
if (rep == QMessageBox::Ok) {
#ifdef _WIN32
// Under windows, it is necessary to close the db here,
// else Xapian won't be able to do what it wants with the
@ -382,24 +384,24 @@ void RclMain::rebuildIndex()
rcldb->close();
}
#endif // _WIN32
// Could also mean that no helpers are missing, but then we
// won't try to show a message anyway (which is what
// firstIndexing is used for)
string mhd;
m_firstIndexing = !theconfig->getMissingHelperDesc(mhd);
// Could also mean that no helpers are missing, but then we
// won't try to show a message anyway (which is what
// firstIndexing is used for)
string mhd;
m_firstIndexing = !theconfig->getMissingHelperDesc(mhd);
if (!checkIdxPaths()) {
return;
}
vector<string> args{"-c", theconfig->getConfDir(), "-z"};
vector<string> args{"-c", theconfig->getConfDir(), "-z"};
if (m_idxreasontmp && m_idxreasontmp->ok()) {
args.push_back("-R");
args.push_back(m_idxreasontmp->filename());
}
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
}
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
}
}
break;
}
@ -467,7 +469,7 @@ void RclMain::specialIndex()
case IXST_UNKNOWN:
case IXST_RUNNINGMINE:
case IXST_RUNNINGNOTMINE:
return; //?? Should not have been called
return; //?? Should not have been called
case IXST_NOTRUNNING:
default:
break;
@ -495,6 +497,8 @@ void RclMain::specialIndex()
args.push_back("-Z");
} else {
args.push_back("-e");
// -e also needs -i, else we don't reindex, just erase
args.push_back("-i");
}
}
@ -529,28 +533,28 @@ void RclMain::specialIndex()
void RclMain::updateIdxForDocs(vector<Rcl::Doc>& docs)
{
if (m_idxproc) {
QMessageBox::warning(0, tr("Warning"),
tr("Can't update index: indexer running"),
QMessageBox::Ok, QMessageBox::NoButton);
return;
QMessageBox::warning(0, tr("Warning"),
tr("Can't update index: indexer running"),
QMessageBox::Ok, QMessageBox::NoButton);
return;
}
vector<string> paths;
if (Rcl::docsToPaths(docs, paths)) {
vector<string> args{"-c", theconfig->getConfDir(), "-i",};
vector<string> args{"-c", theconfig->getConfDir(), "-i",};
if (m_idxreasontmp && m_idxreasontmp->ok()) {
args.push_back("-R");
args.push_back(m_idxreasontmp->filename());
}
args.insert(args.end(), paths.begin(), paths.end());
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
args.insert(args.end(), paths.begin(), paths.end());
m_idxproc = new ExecCmd;
m_idxproc->startExec("recollindex", args, false, false);
// Call periodic100 to update the menu entries states
periodic100();
} else {
QMessageBox::warning(0, tr("Warning"),
tr("Can't update index: internal error"),
QMessageBox::Ok, QMessageBox::NoButton);
return;
QMessageBox::warning(0, tr("Warning"),
tr("Can't update index: internal error"),
QMessageBox::Ok, QMessageBox::NoButton);
return;
}
}

View File

@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>413</width>
<height>191</height>
<width>610</width>
<height>192</height>
</rect>
</property>
<property name="windowTitle">
@ -70,7 +70,7 @@
<item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Start directory (else use regular topdirs):</string>
<string>Start directory. Must be part of the indexed tree. Use full indexed area if empty.</string>
</property>
<property name="wordWrap">
<bool>false</bool>

View File

@ -90,9 +90,6 @@
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Enter search terms here.</string>
</property>
</widget>
</item>
<item>

130
src/testmains/trmbox.cpp Normal file
View File

@ -0,0 +1,130 @@
/* Copyright (C) 2017-2019 J.F.Dockes
*
* License: GPL 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <iostream>
#include <string>
using namespace std;
#include "rclconfig.h"
#include "rclinit.h"
#include "cstr.h"
#include "mh_mbox.h"
static char *thisprog;
static char usage [] =
"Test driver for mbox walking function\n"
"mh_mbox [-m num] mboxfile\n"
" \n\n"
;
static void
Usage(void)
{
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
exit(1);
}
static RclConfig *config;
static int op_flags;
#define OPT_MOINS 0x1
#define OPT_m 0x2
//#define OPT_t 0x4
int main(int argc, char **argv)
{
string msgnum;
thisprog = argv[0];
argc--; argv++;
while (argc > 0 && **argv == '-') {
(*argv)++;
if (!(**argv))
/* Cas du "adb - core" */
Usage();
while (**argv)
switch (*(*argv)++) {
case 'm': op_flags |= OPT_m; if (argc < 2) Usage();
msgnum = *(++argv);
argc--;
goto b1;
// case 't': op_flags |= OPT_t;break;
default: Usage(); break;
}
b1: argc--; argv++;
}
if (argc != 1)
Usage();
string filename = *argv++;argc--;
string reason;
config = recollinit(RclInitFlags(0), 0, 0, reason, 0);
if (config == 0) {
cerr << "init failed " << reason << endl;
exit(1);
}
config->setKeyDir(path_getfather(filename));
MimeHandlerMbox mh(config, "some_id");
if (!mh.set_document_file("text/x-mail", filename)) {
cerr << "set_document_file failed" << endl;
exit(1);
}
if (!msgnum.empty()) {
mh.skip_to_document(msgnum);
if (!mh.next_document()) {
cerr << "next_document failed after skipping to " << msgnum << endl;
exit(1);
}
map<string, string>::const_iterator it =
mh.get_meta_data().find(cstr_dj_keycontent);
int size;
if (it == mh.get_meta_data().end()) {
size = -1;
cerr << "No content!!" << endl;
exit(1);
}
cout << "Doc " << msgnum << ":" << endl;
cout << it->second << endl;
exit(0);
}
int docnt = 0;
while (mh.has_documents()) {
if (!mh.next_document()) {
cerr << "next_document failed" << endl;
exit(1);
}
docnt++;
map<string, string>::const_iterator it =
mh.get_meta_data().find(cstr_dj_keycontent);
int size;
if (it == mh.get_meta_data().end()) {
size = -1;
} else {
size = it->second.length();
}
cout << "Doc " << docnt << " size " << size << endl;
}
cout << docnt << " documents found in " << filename << endl;
exit(0);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2004 J.F.Dockes
/* Copyright (C) 2004-2019 J.F.Dockes
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
@ -57,9 +57,9 @@
#include "safesysstat.h"
#include "transcode.h"
#define STAT _wstat
#define LSTAT _wstat
#define STATBUF _stat
#define STAT _wstati64
#define LSTAT _wstati64
#define STATBUF _stati64
#define ACCESS _waccess
#else // Not windows ->
@ -654,18 +654,18 @@ bool path_makepath(const string& ipath, int mode)
vector<string> elems;
stringToTokens(path, elems, "/");
path = "/";
for (vector<string>::const_iterator it = elems.begin();
it != elems.end(); it++) {
for (const auto& elem : elems) {
#ifdef _WIN32
if (it == elems.begin() && path_strlookslikedrive(*it)) {
if (path == "/" && path_strlookslikedrive(elem)) {
path = "";
}
#endif
path += *it;
path += elem;
// Not using path_isdir() here, because this cant grok symlinks
// If we hit an existing file, no worry, mkdir will just fail.
if (access(path.c_str(), 0) != 0) {
if (mkdir(path.c_str(), mode) != 0) {
//cerr << "mkdir " << path << " failed, errno " << errno << endl;
return false;
}
}

View File

@ -83,7 +83,7 @@ static bool path_isdriveabs(const string& s)
#include <Shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
string path_thisexecpath()
static string path_thisexecpath()
{
wchar_t text[MAX_PATH];
GetModuleFileNameW(NULL, text, MAX_PATH);
@ -100,25 +100,38 @@ string path_thisexecpath()
return path;
}
string path_wingettempfilename(wchar_t *pref)
// On Windows, we ese a subdirectory named "rcltmp" inside the windows
// temp location to create the temporary files in.
static const string& path_wingetrcltmpdir()
{
// Use a subdirectory named "rcltmp" inside the windows temp
// location.
wchar_t dbuf[MAX_PATH + 1];
GetTempPathW(MAX_PATH + 1, dbuf);
string tdir;
wchartoutf8(dbuf, tdir);
tdir = path_cat(tdir, "rcltmp");;
if (!path_exists(tdir)) {
if (path_makepath(tdir, 0700)) {
LOGSYSERR("path_wingettempfilename", "path_makepath", tdir);
// Constant: only need to compute once
static string tdir;
if (tdir.empty()) {
wchar_t dbuf[MAX_PATH + 1];
GetTempPathW(MAX_PATH + 1, dbuf);
wchartoutf8(dbuf, tdir);
tdir = path_cat(tdir, "rcltmp");;
if (!path_exists(tdir)) {
if (path_makepath(tdir, 0700)) {
LOGSYSERR("path_wingettempfilename", "path_makepath", tdir);
}
}
}
return tdir;
}
static bool path_gettempfilename(string& filename, string& reason)
{
string tdir = path_wingetrcltmpdir();
wchar_t dbuf[MAX_PATH + 1];
utf8towchar(tdir, dbuf, MAX_PATH);
wchar_t buf[MAX_PATH + 1];
GetTempFileNameW(dbuf, pref, 0, buf);
string filename;
static wchar_t prefix[]{L"rcl"};
GetTempFileNameW(dbuf, prefix, 0, buf);
wchartoutf8(buf, filename);
// Windows will have created a temp file, we delete it.
if (!DeleteFileW(buf)) {
LOGSYSERR("path_wingettempfilename", "DeleteFileW", filename);
@ -126,10 +139,35 @@ string path_wingettempfilename(wchar_t *pref)
LOGDEB1("path_wingettempfilename: DeleteFile " << filename << " Ok\n");
}
path_slashize(filename);
return filename;
return true;
}
#endif // _WIN32
#else // _WIN32 above
static bool path_gettempfilename(string& filename, string& reason)
{
filename = path_cat(tmplocation(), "rcltmpfXXXXXX");
char *cp = strdup(filename.c_str());
if (!cp) {
reason = "Out of memory (for file name !)\n";
return false;
}
// Using mkstemp this way is awful (bot the suffix adding and
// using mkstemp() instead of mktemp just to avoid the warnings)
int fd;
if ((fd = mkstemp(cp)) < 0) {
free(cp);
reason = "TempFileInternal: mkstemp failed\n";
return false;
}
close(fd);
unlink(cp);
filename = cp;
free(cp);
return true;
}
#endif // posix
// Check if path is either non-existing or an empty directory.
bool path_empty(const string& path)
@ -259,21 +297,21 @@ bool maketmpdir(string& tdir, string& reason)
// There is a race condition between name computation and
// mkdir. try to make sure that we at least don't shoot ourselves
// in the foot
#if !defined(HAVE_MKDTEMP) || defined(_WIN32)
#if !defined(HAVE_MKDTEMP)
static std::mutex mmutex;
std::unique_lock<std::mutex> lock(mmutex);
#endif
if (!
#ifdef HAVE_MKDTEMP
mkdtemp(cp)
mkdtemp(cp)
#else
mktemp(cp)
mktemp(cp)
#endif // HAVE_MKDTEMP
) {
) {
free(cp);
reason = "maketmpdir: mktemp failed for [" + tdir + "] : " +
strerror(errno);
strerror(errno);
tdir.erase();
return false;
}
@ -285,8 +323,9 @@ bool maketmpdir(string& tdir, string& reason)
// in the foot
static std::mutex mmutex;
std::unique_lock<std::mutex> lock(mmutex);
static wchar_t tmpbasename[]{L"rcltmp"};
tdir = path_wingettempfilename(tmpbasename);
if (!path_gettempfilename(tdir, reason)) {
return false;
}
#endif
// At this point the directory does not exist yet except if we used
@ -356,32 +395,10 @@ TempFile::Internal::Internal(const string& suffix)
static std::mutex mmutex;
std::unique_lock<std::mutex> lock(mmutex);
#ifndef _WIN32
string filename = path_cat(tmplocation(), "rcltmpfXXXXXX");
char *cp = strdup(filename.c_str());
if (!cp) {
m_reason = "Out of memory (for file name !)\n";
if (!path_gettempfilename(m_filename, m_reason)) {
return;
}
// Using mkstemp this way is awful (bot the suffix adding and
// using mkstemp() instead of mktemp just to avoid the warnings)
int fd;
if ((fd = mkstemp(cp)) < 0) {
free(cp);
m_reason = "TempFileInternal: mkstemp failed\n";
return;
}
close(fd);
unlink(cp);
filename = cp;
free(cp);
#else
static wchar_t tmpbasename[]{L"rcl"};
string filename = path_wingettempfilename(tmpbasename);
#endif
m_filename = filename + suffix;
m_filename += suffix;
LOGDEB1("TempFile: filename: " << m_filename << endl);
int fd1 = open(m_filename.c_str(), O_CREAT | O_EXCL, 0600);
if (fd1 < 0) {
@ -393,6 +410,15 @@ TempFile::Internal::Internal(const string& suffix)
}
}
const std::string& TempFile::rcltmpdir()
{
#ifdef _WIN32
return path_wingetrcltmpdir();
#else
return tmplocation();
#endif
}
#ifdef _WIN32
static list<string> remainingTempFileNames;
static std::mutex remTmpFNMutex;
@ -423,8 +449,8 @@ TempFile::Internal::~Internal()
void TempFile::tryRemoveAgain()
{
#ifdef _WIN32
LOGDEB1("TempFile::tryRemoveAgain. List size: " <<
remainingTempFileNames.size() << endl);
LOGDEB1("TempFile::tryRemoveAgain. List size: " <<
remainingTempFileNames.size() << endl);
std::unique_lock<std::mutex> lock(remTmpFNMutex);
std::list<string>::iterator pos = remainingTempFileNames.begin();
while (pos != remainingTempFileNames.end()) {

View File

@ -58,11 +58,15 @@ public:
const std::string& getreason() const;
void setnoremove(bool onoff);
bool ok() const;
// Attempt to delete all files which could not be deleted on the
// first try (typically on Windows: because they are open by some
// process). Called after clearing the mimeHandler cache. Does
// nothing if not _WIN32
static void tryRemoveAgain();
// Attempt to delete all files which could not be deleted on the
// first try (typically on Windows: because they are open by some
// process). Called after clearing the mimeHandler cache. Does
// nothing if not _WIN32
static void tryRemoveAgain();
// Also for Windows: for adding the temp files path to the default
// skippedPaths
static const std::string& rcltmpdir();
class Internal;
private:
std::shared_ptr<Internal> m;

View File

@ -1283,7 +1283,7 @@ bool SimpleRegexp::simpleMatch(const string& val) const
{
if (!ok())
return false;
return regex_match(val, m->res, m->expr);
return regex_search(val, m->res, m->expr);
}
string SimpleRegexp::getMatch(const string& val, int i) const