From 5aad9d50e1f4c9c97060cceb11795f6fd8ca2e8f Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 10 Jan 2013 09:30:05 +0100 Subject: [PATCH] make sure we only show the automatic missing helpers dialog once --- src/common/rclconfig.cpp | 12 +++++++----- src/common/rclconfig.h | 10 +++------- src/qtgui/rclmain_w.cpp | 16 +++++++++++----- src/query/docseqdb.cpp | 3 +++ src/query/docseqhist.cpp | 3 +++ website/BUGS.html | 4 ++++ 6 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index 22317580..53f52c28 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -24,8 +24,9 @@ #include #include -#include #include +#include +using std::list; #include #include @@ -642,12 +643,13 @@ bool RclConfig::valueSplitAttributes(const string& whole, string& value, } -string RclConfig::getMissingHelperDesc() const +bool RclConfig::getMissingHelperDesc(string& out) const { string fmiss = path_cat(getConfDir(), "missing"); - string out; - file_to_string(fmiss, out); - return out; + out.clear(); + if (!file_to_string(fmiss, out)) + return false; + return true; } void RclConfig::storeMissingHelperDesc(const string &s) diff --git a/src/common/rclconfig.h b/src/common/rclconfig.h index 78b42dee..cc5a2a82 100644 --- a/src/common/rclconfig.h +++ b/src/common/rclconfig.h @@ -17,22 +17,18 @@ #ifndef _RCLCONFIG_H_INCLUDED_ #define _RCLCONFIG_H_INCLUDED_ -#include #include #include #include #include #include -#include -#ifndef NO_NAMESPACES -using std::list; + using std::string; using std::vector; using std::pair; using std::set; using std::map; -using std::set; -#endif + #include "conftree.h" #include "smallut.h" @@ -247,7 +243,7 @@ class RclConfig { bool mimeViewerNeedsUncomp(const string &mimetype) const; /** Store/retrieve missing helpers description string */ - string getMissingHelperDesc() const; + bool getMissingHelperDesc(string&) const; void storeMissingHelperDesc(const string &s); /** Find exec file for external filter. cmd is the command name from the diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 0b5510ba..5e98e312 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -720,7 +720,8 @@ void RclMain::toggleIndexing() // 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) - m_firstIndexing = theconfig->getMissingHelperDesc().empty(); + string mhd; + m_firstIndexing = !theconfig->getMissingHelperDesc(mhd); vector args; args.push_back("-c"); @@ -751,7 +752,8 @@ void RclMain::rebuildIndex() // 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) - m_firstIndexing = theconfig->getMissingHelperDesc().empty(); + string mhd; + m_firstIndexing = !theconfig->getMissingHelperDesc(mhd); vector args; args.push_back("-c"); args.push_back(theconfig->getConfDir()); @@ -1069,7 +1071,11 @@ void RclMain::showAboutDialog() void RclMain::showMissingHelpers() { - string miss = theconfig->getMissingHelperDesc(); + string miss; + if (!theconfig->getMissingHelperDesc(miss)) { + QMessageBox::information(this, "", tr("Indexing did not run yet")); + return; + } QString msg = QString::fromAscii("

") + tr("External applications/commands needed and not found " "for indexing your file types:\n\n"); @@ -1128,8 +1134,8 @@ void RclMain::showActiveTypes() // Substract the types for missing helpers (the docs are indexed // by name only): - string miss = theconfig->getMissingHelperDesc(); - if (!miss.empty()) { + string miss; + if (theconfig->getMissingHelperDesc(miss) && !miss.empty()) { FIMissingStore st(miss); map >::const_iterator it; for (it = st.m_typesForMissing.begin(); diff --git a/src/query/docseqdb.cpp b/src/query/docseqdb.cpp index c403c378..e583dc17 100644 --- a/src/query/docseqdb.cpp +++ b/src/query/docseqdb.cpp @@ -17,6 +17,9 @@ #include #include +#include +using std::list; + #include "docseqdb.h" #include "rcldb.h" #include "debuglog.h" diff --git a/src/query/docseqhist.cpp b/src/query/docseqhist.cpp index 4ae0ab6e..f8d453e4 100644 --- a/src/query/docseqhist.cpp +++ b/src/query/docseqhist.cpp @@ -17,7 +17,10 @@ #include #include #include + #include +#include +using std::list; #include "docseqhist.h" #include "rcldb.h" diff --git a/website/BUGS.html b/website/BUGS.html index 8132114a..abb73e35 100644 --- a/website/BUGS.html +++ b/website/BUGS.html @@ -39,6 +39,10 @@

recoll 1.18.1

    +
  • When no indexing helper applications are actually missing, + an ennoying popup is shown in the GUI at each end of a batch + indexing run (it's supposed to be shown only once).
  • +
  • Weird data in filter output text (e.g.: produced by some versions of pdftotext) can cause an error which will halt the processing of the document, which becomes