From 7dee82154f81dd6e65f1455629649c4e50fac7dd Mon Sep 17 00:00:00 2001
From: Jean-Francois Dockes
Date: Sun, 12 May 2013 22:33:37 +0200
Subject: [PATCH 1/8] Using a file name clause in advanced search crashed the
GUI because of a bad dynamic cast in the history management code
---
src/rcldb/searchdata.h | 13 ++++++----
src/rcldb/searchdataxml.cpp | 52 +++++++++++++++++++++++--------------
website/BUGS.html | 2 ++
website/release-1.19.html | 5 +++-
4 files changed, 47 insertions(+), 25 deletions(-)
diff --git a/src/rcldb/searchdata.h b/src/rcldb/searchdata.h
index 4c10f3d0..f9d3154b 100644
--- a/src/rcldb/searchdata.h
+++ b/src/rcldb/searchdata.h
@@ -315,6 +315,12 @@ public:
m_haveWildCards =
(txt.find_first_of(cstr_minwilds) != std::string::npos);
}
+ SearchDataClauseSimple(const std::string& txt, SClType tp)
+ : SearchDataClause(tp), m_text(txt), m_curcl(0)
+ {
+ m_haveWildCards =
+ (txt.find_first_of(cstr_minwilds) != std::string::npos);
+ }
virtual ~SearchDataClauseSimple()
{
@@ -365,10 +371,10 @@ protected:
* field, especially for file names, because this makes searches for
* "*xx" much faster (no need to scan the whole main index).
*/
-class SearchDataClauseFilename : public SearchDataClause {
+class SearchDataClauseFilename : public SearchDataClauseSimple {
public:
SearchDataClauseFilename(const std::string& txt)
- : SearchDataClause(SCLT_FILENAME), m_text(txt)
+ : SearchDataClauseSimple(txt, SCLT_FILENAME)
{
// File name searches don't count when looking for wild cards.
m_haveWildCards = false;
@@ -383,9 +389,6 @@ public:
}
virtual bool toNativeQuery(Rcl::Db &, void *);
-
-protected:
- std::string m_text;
};
diff --git a/src/rcldb/searchdataxml.cpp b/src/rcldb/searchdataxml.cpp
index f2d90641..72b3b9e5 100644
--- a/src/rcldb/searchdataxml.cpp
+++ b/src/rcldb/searchdataxml.cpp
@@ -56,18 +56,20 @@ string SearchData::asXML()
// Clause list
os << "" << endl;
+
+ // List conjunction: default is AND, else print it.
if (m_tp != SCLT_AND)
os << "" << tpToString(m_tp) << "" << endl;
+
for (unsigned int i = 0; i < m_query.size(); i++) {
SearchDataClause *c = m_query[i];
if (c->getTp() == SCLT_SUB) {
LOGERR(("SearchData::asXML: can't do subclauses !\n"));
continue;
}
- if (c->getexclude())
- os << "" << endl;
if (c->getTp() == SCLT_PATH) {
- // Keep these apart, for compat with the older history format
+ // Keep these apart, for compat with the older history format. NEG
+ // is ignored here, we have 2 different tags instead.
SearchDataClausePath *cl =
dynamic_cast(c);
if (cl->getexclude()) {
@@ -76,24 +78,36 @@ string SearchData::asXML()
os << "" << base64_encode(cl->gettext()) << "" << endl;
}
continue;
- }
+ } else {
- SearchDataClauseSimple *cl =
- dynamic_cast(c);
- os << "" << endl;
- if (cl->getTp() != SCLT_AND) {
- os << "" << tpToString(cl->getTp()) << "" << endl;
+ os << "" << endl;
+
+ if (c->getexclude())
+ os << "" << endl;
+
+ if (c->getTp() != SCLT_AND) {
+ os << "" << tpToString(c->getTp()) << "" << endl;
+ }
+ if (c->getTp() == SCLT_FILENAME) {
+ SearchDataClauseFilename *cl =
+ dynamic_cast(c);
+ os << "" << base64_encode(cl->gettext()) << "" << endl;
+ } else {
+ SearchDataClauseSimple *cl =
+ dynamic_cast(c);
+ if (!cl->getfield().empty()) {
+ os << "" << base64_encode(cl->getfield()) << "" <<
+ endl;
+ }
+ os << "" << base64_encode(cl->gettext()) << "" << endl;
+ if (cl->getTp() == SCLT_NEAR || cl->getTp() == SCLT_PHRASE) {
+ SearchDataClauseDist *cld =
+ dynamic_cast(cl);
+ os << "" << cld->getslack() << "" << endl;
+ }
+ }
+ os << "" << endl;
}
- if (cl->getTp() != SCLT_FILENAME && !cl->getfield().empty()) {
- os << "" << base64_encode(cl->getfield()) << "" << endl;
- }
- os << "" << base64_encode(cl->gettext()) << "" << endl;
- if (cl->getTp() == SCLT_NEAR || cl->getTp() == SCLT_PHRASE) {
- SearchDataClauseDist *cld =
- dynamic_cast(cl);
- os << "" << cld->getslack() << "" << endl;
- }
- os << "" << endl;
}
os << "" << endl;
diff --git a/website/BUGS.html b/website/BUGS.html
index 14bd7e40..15d1a36a 100644
--- a/website/BUGS.html
+++ b/website/BUGS.html
@@ -31,6 +31,8 @@ versions.
+ - Using a "file name" clause inside advanced search crashes the
+ GUI because of a bug in the search history feature.
- On systems such as Debian Stable which use Evince version 2.x (not 3.x)
as PDF viewer, the default "Open" command for PDF files will not work. You
need to use the GUI preferences tool to change the --page-index option to
diff --git a/website/release-1.19.html b/website/release-1.19.html
index f008269a..3f20070f 100644
--- a/website/release-1.19.html
+++ b/website/release-1.19.html
@@ -79,7 +79,10 @@ Configuration menu.
- It is now possible to use OR with "dir:" clauses, and wildcards have been
enabled.
- When the option to follow symbolic links is not set -which is the
- default- symbolic links are now indexed as such (name and content).
+ default- symbolic links are now indexed as such (name and
+ content).
+ - The advanced search panel now has a history feature. Use the
+ up/down arrows to walk the search history list.
- There are new GUI configuration options to run in "search as you type"
mode (which I don't find useful at all...), and to disable the Qt
auto-completion inside the simple search string. The completion was often
From 579fea006eb3053397a25edc9f43a4ebc924bc4d Mon Sep 17 00:00:00 2001
From: Jean-Francois Dockes
Date: Sun, 12 May 2013 22:36:18 +0200
Subject: [PATCH 2/8] 1.19.1?
---
src/VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/VERSION b/src/VERSION
index 815d5ca0..66e2ae6c 100644
--- a/src/VERSION
+++ b/src/VERSION
@@ -1 +1 @@
-1.19.0
+1.19.1
From b3339056c97644032ccc9420885a8a94625dd6fb Mon Sep 17 00:00:00 2001
From: Jean-Francois Dockes
Date: Sun, 12 May 2013 22:36:33 +0200
Subject: [PATCH 3/8] Release 1.19.1 tagged
---
.hgtags | 1 +
1 file changed, 1 insertion(+)
diff --git a/.hgtags b/.hgtags
index 8488d400..15278583 100644
--- a/.hgtags
+++ b/.hgtags
@@ -126,3 +126,4 @@ e44205c256063d6388682c1dfc62b4db6184db0d help
0000000000000000000000000000000000000000 RECOLL_1_19_0
0000000000000000000000000000000000000000 RECOLL_1_19_0
3207b030989d19bdec25fdd2b500c3bbec3ebe97 RECOLL_1_19_0
+599179076d53eb87604c97e0adf391e304bcf377 RECOLL_1_19_1
From 72ee1682ce72cd72fc0f5dc27fab2a951ec6e32e Mon Sep 17 00:00:00 2001
From: Jean-Francois Dockes
Date: Mon, 13 May 2013 10:50:06 +0200
Subject: [PATCH 4/8] doc
---
website/download.html | 6 +++---
website/index.html.en | 4 ++--
website/index.html.fr | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/website/download.html b/website/download.html
index eae4c023..89175bbe 100644
--- a/website/download.html
+++ b/website/download.html
@@ -45,7 +45,7 @@
-
The current version is 1.19.0. Release
+The current version is 1.19.1. Release
notes.
The download page for Recoll 1.18 is still
@@ -87,12 +87,12 @@ is probably no necessity to upgrade anyway.
-Current release distribution: 1.19.0:
+Current release distribution: 1.19.1:
-recoll-1.19.0.tar.gz.
+recoll-1.19.1.tar.gz.