From 2d8e57ee4fd0d2c88d7fdaed20bcb8c398ed1904 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 26 Apr 2011 08:26:09 +0200 Subject: [PATCH] Gui preview, internfile: handle case where target doc of a compound ipath still needs further translation (is not text or html) --- src/internfile/internfile.cpp | 19 ++++++++++++++----- src/internfile/mh_exec.cpp | 7 +++++++ src/internfile/mh_exec.h | 5 +---- src/makesrcdist.sh | 3 ++- website/download.html | 4 ++-- website/release-1.16.html | 3 +++ 6 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/internfile/internfile.cpp b/src/internfile/internfile.cpp index 53af0f7a..bb9c2029 100644 --- a/src/internfile/internfile.cpp +++ b/src/internfile/internfile.cpp @@ -768,7 +768,7 @@ FileInterner::Status FileInterner::internfile(Rcl::Doc& doc, const string& ipath // over the last significant one are "" // We set the ipath for the first handler here, others are set // when they're pushed on the stack - vector vipath(MAXHANDLERS); + vector vipath; int vipathidx = 0; if (!ipath.empty()) { vector lipath; @@ -851,10 +851,19 @@ FileInterner::Status FileInterner::internfile(Rcl::Doc& doc, const string& ipath return FIError; } - if (!ipath.empty() && - !m_handlers.back()->skip_to_document(vipath[m_handlers.size()-1])){ - LOGERR(("FileInterner::internfile: can't skip\n")); - return FIError; + // If we have an ipath, meaning that we are seeking a specific + // document (ie: previewing a search result), we may have to + // seek to the correct entry of a compound doc (ie: archive or + // mail). When we are out of ipath entries, we stop seeking, + // the handlers stack may still grow for translation (ie: if + // the target doc is msword, we'll still stack the + // word-to-text translator). + if (!ipath.empty()) { + if (m_handlers.size() <= vipath.size() && + !m_handlers.back()->skip_to_document(vipath[m_handlers.size()-1])) { + LOGERR(("FileInterner::internfile: can't skip\n")); + return FIError; + } } } breakloop: diff --git a/src/internfile/mh_exec.cpp b/src/internfile/mh_exec.cpp index 529602fa..13c966d2 100644 --- a/src/internfile/mh_exec.cpp +++ b/src/internfile/mh_exec.cpp @@ -59,6 +59,13 @@ public: }; +bool MimeHandlerExec::skip_to_document(const string& ipath) +{ + LOGDEB(("MimeHandlerExec:skip_to_document: [%s]\n", ipath.c_str())); + m_ipath = ipath; + return true; +} + // Execute an external program to translate a file from its native // format to text or html. bool MimeHandlerExec::next_document() diff --git a/src/internfile/mh_exec.h b/src/internfile/mh_exec.h index 1a6b9bf0..8261a910 100644 --- a/src/internfile/mh_exec.h +++ b/src/internfile/mh_exec.h @@ -68,10 +68,7 @@ class MimeHandlerExec : public RecollFilter { return true; } virtual bool next_document(); - virtual bool skip_to_document(const string& ipath) { - m_ipath = ipath; - return true; - } + virtual bool skip_to_document(const string& ipath); virtual void clear() { m_fn.erase(); m_ipath.erase(); diff --git a/src/makesrcdist.sh b/src/makesrcdist.sh index d54cbd5b..26162520 100644 --- a/src/makesrcdist.sh +++ b/src/makesrcdist.sh @@ -60,7 +60,8 @@ test $# -eq 1 || usage echo dotag $dotag snap $snap if test $snap = yes ; then - version=`hg id | awk '{print $1}'` +# version=`hg id | awk '{print $1}'` + version=`hg summary | head -1 | awk -F: '{print $2}' | sed -e 's/ //g'` versionforcvs=$version TAG="" else diff --git a/website/download.html b/website/download.html index 01794375..92efd7ff 100644 --- a/website/download.html +++ b/website/download.html @@ -110,11 +110,11 @@

Snapshot

I sometimes release a source tarfile when I consider that the current development version is stable enough. The current - snapshot contains commits up to 2237 (see + snapshot contains commits up to 2240 (see the changelog, and a synthetic abstract in the current 1.16 release notes). -

betarecoll-6fb3a7b06269.tar.gz.

+

betarecoll-2240.tar.gz.

Prerequisites for building from source:

    diff --git a/website/release-1.16.html b/website/release-1.16.html index 8de2e752..7fcd466b 100644 --- a/website/release-1.16.html +++ b/website/release-1.16.html @@ -88,6 +88,9 @@ paths.
  • Fixed GUI result list doc parent operations (open/preview) which were broken in 1.15.
  • +
  • Fixed case where indexing could hang or crash after an + error occured while indexing an archive member (which + should have affected only the relevant document).