diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index 7a571c8b..1dd62eb5 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -175,7 +175,9 @@ RclConfig::RclConfig(const string *argcnf) m_reason = string("No/bad mimeconf in: ") + cnferrloc; return; } - mimeview = new ConfStack("mimeview", m_cdirs, true); + mimeview = new ConfStack("mimeview", m_cdirs, false); + if (mimeview == 0) + mimeview = new ConfStack("mimeview", m_cdirs, true); if (mimeview == 0 || !mimeview->ok()) { m_reason = string("No/bad mimeview in: ") + cnferrloc; return; @@ -789,14 +791,49 @@ bool RclConfig::getFieldConfParam(const string &name, const string &sk, return m_fields->get(name, value, sk); } +string RclConfig::getMimeViewerAllEx() +{ + string hs; + if (mimeview == 0) + return hs; + mimeview->get("xallexcepts", hs, ""); + return hs; +} -string RclConfig::getMimeViewerDef(const string &mtype, const string& apptag) +bool RclConfig::setMimeViewerAllEx(const string& allex) +{ + if (mimeview == 0) + return false; + if (!mimeview->set("xallexcepts", allex, "")) { + m_reason = string("RclConfig:: cant set value. Readonly?"); + return false; + } + + return true; +} + +string RclConfig::getMimeViewerDef(const string &mtype, const string& apptag, + bool useall) { LOGDEB2(("RclConfig::getMimeViewerDef: mtype [%s] apptag [%s]\n", mtype.c_str(), apptag.c_str())); string hs; if (mimeview == 0) return hs; + + if (useall) { + // Check for exception + string excepts = getMimeViewerAllEx(); + vector vex; + stringToTokens(excepts, vex); + vector::iterator it = find(vex.begin(), vex.end(), mtype); + if (it == vex.end()) { + mimeview->get("application/x-all", hs, "view"); + return hs; + } + // Fallthrough to normal case. + } + if (apptag.empty() || !mimeview->get(mtype + string("|") + apptag, hs, "view")) mimeview->get(mtype, hs, "view"); @@ -808,8 +845,9 @@ bool RclConfig::getMimeViewerDefs(vector >& defs) if (mimeview == 0) return false; vectortps = mimeview->getNames("view"); - for (vector::const_iterator it = tps.begin(); it != tps.end();it++) { - defs.push_back(pair(*it, getMimeViewerDef(*it, ""))); + for (vector::const_iterator it = tps.begin(); + it != tps.end();it++) { + defs.push_back(pair(*it, getMimeViewerDef(*it, "", 0))); } return true; } @@ -818,24 +856,8 @@ bool RclConfig::setMimeViewerDef(const string& mt, const string& def) { if (mimeview == 0) return false; - string pconfname = path_cat(getConfDir(), "mimeview"); - // Make sure this exists - close(open(pconfname.c_str(), O_CREAT|O_WRONLY, 0600)); - ConfTree tree(pconfname.c_str()); - if (!tree.set(mt, def, "view")) { - m_reason = string("RclConfig::setMimeViewerDef: cant set value in ") - + pconfname; - return false; - } - - vector cdirs; - cdirs.push_back(m_confdir); - cdirs.push_back(path_cat(m_datadir, "examples")); - - delete mimeview; - mimeview = new ConfStack("mimeview", cdirs, true); - if (mimeview == 0 || !mimeview->ok()) { - m_reason = string("No/bad mimeview in: ") + m_confdir; + if (!mimeview->set(mt, def, "view")) { + m_reason = string("RclConfig:: cant set value. Readonly?"); return false; } return true; diff --git a/src/common/rclconfig.h b/src/common/rclconfig.h index 3fd29a52..451ce331 100644 --- a/src/common/rclconfig.h +++ b/src/common/rclconfig.h @@ -226,7 +226,10 @@ class RclConfig { bool getFieldConfParam(const string &name, const string &sk, string &value); /** mimeview: get/set external viewer exec string(s) for mimetype(s) */ - string getMimeViewerDef(const string &mimetype, const string& apptag); + string getMimeViewerDef(const string &mimetype, const string& apptag, + bool useall); + string getMimeViewerAllEx(); + bool setMimeViewerAllEx(const string& allex); bool getMimeViewerDefs(vector >&); bool setMimeViewerDef(const string& mimetype, const string& cmd); /** Check if mime type is designated as needing no uncompress before view diff --git a/src/doc/user/usermanual.sgml b/src/doc/user/usermanual.sgml index 6b156363..756f988a 100644 --- a/src/doc/user/usermanual.sgml +++ b/src/doc/user/usermanual.sgml @@ -502,6 +502,20 @@ recoll described in the external packages section. + + + + Index case and diacritics sensitivity + + Index case sensitivity + is controlled by the indexStripChars configuration + variable which can only be changed by editing the + configuration file. Any change implies an index reset (not + automated by recoll), and all indexes in a search must be set + in the same way (again, not checked by recoll). + + + The indexing configuration GUI @@ -4040,6 +4054,17 @@ skippedPaths = ~/somedir/∗.txt + indexStripChars + Decide if we strip characters of diacritics and + convert them to lower-case before terms are indexed. If we + don't, searches sensitive to case and diacritics can be + performed, but the index will be bigger, and some marginal + weirdness may sometimes occur. The default is a stripped + index (indexStripChars = 1 for + now. + + + nonumbers If this set to true, no terms will be generated for numbers. For example "123", "1.5e6", 192.168.1.4, would not @@ -4228,6 +4253,26 @@ unac_except_trans = + autodiacsens + IF the index is not stripped, decide if we + 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 D modifier to + specify diacritics sensitivity. Default is no. + + + + autocasesens + IF the index is not stripped, decide if we + automatically trigger character case sensitivity if the + search term has upper-case characters in any but the first + position. Else you need to use the query language and the + C modifier to specify character-case + sensitivity. Default is yes. + + + loglevel,daemloglevel Verbosity level for recoll and recollindex. A value of 4 lists quite a lot of @@ -4246,7 +4291,6 @@ unac_except_trans = - mondelaypatterns This allows specify wildcard path patterns (processed with fnmatch(3) with 0 flag), to match files which diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 97a3ae31..04ee7b24 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -398,7 +398,7 @@ void RclMain::initDbOpen() } // Start native viewer or preview for input Doc. This is used allow -// the using Recoll result docs with an ipath in another app. We act +// using Recoll result docs with an ipath in another app. We act // as a proxy to extract the data and start a viewer. // The Url are encoded as file://path#ipath void RclMain::viewUrl() @@ -428,7 +428,8 @@ void RclMain::viewUrl() // preview. string apptag; doc.getmeta(Rcl::Doc::keyapptg, &apptag); - string viewer = theconfig->getMimeViewerDef(doc.mimetype, apptag); + string viewer = theconfig->getMimeViewerDef(doc.mimetype, apptag, + prefs.useDesktopOpen); if (viewer.empty()) { startPreview(doc); } else { @@ -1502,14 +1503,10 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term) { LOGDEB(("RclMain::startNativeViewer: page %d\n", pagenum)); // Look for appropriate viewer - string cmdplusattr; - if (prefs.useDesktopOpen) { - cmdplusattr = theconfig->getMimeViewerDef("application/x-all", ""); - } else { - string apptag; - doc.getmeta(Rcl::Doc::keyapptg, &apptag); - cmdplusattr = theconfig->getMimeViewerDef(doc.mimetype, apptag); - } + string apptag; + doc.getmeta(Rcl::Doc::keyapptg, &apptag); + string cmdplusattr = theconfig->getMimeViewerDef(doc.mimetype, apptag, + prefs.useDesktopOpen); if (cmdplusattr.empty()) { QMessageBox::warning(0, "Recoll", diff --git a/src/qtgui/reslist.cpp b/src/qtgui/reslist.cpp index 85c6564b..507a71fd 100644 --- a/src/qtgui/reslist.cpp +++ b/src/qtgui/reslist.cpp @@ -920,7 +920,7 @@ void ResList::createPopupMenu(const QPoint& pos) if (havedoc) doc.getmeta(Rcl::Doc::keyapptg, &apptag); - if (havedoc && !theconfig->getMimeViewerDef(doc.mimetype, apptag).empty()) { + if (havedoc && !theconfig->getMimeViewerDef(doc.mimetype, apptag, 0).empty()) { popup->addAction(tr("&Open"), this, SLOT(menuEdit())); } popup->addAction(tr("Copy &File Name"), this, SLOT(menuCopyFN())); diff --git a/src/qtgui/uiprefs.ui b/src/qtgui/uiprefs.ui index 7c71947f..45c5faaa 100644 --- a/src/qtgui/uiprefs.ui +++ b/src/qtgui/uiprefs.ui @@ -177,6 +177,27 @@ + + + + + + Exceptions + + + + + + + + 70 + 0 + + + + + + diff --git a/src/qtgui/uiprefs_w.cpp b/src/qtgui/uiprefs_w.cpp index f33275a1..4f8e5bba 100644 --- a/src/qtgui/uiprefs_w.cpp +++ b/src/qtgui/uiprefs_w.cpp @@ -81,6 +81,8 @@ void UIPrefsDialog::init() replAbsCB, SLOT(setEnabled(bool))); connect(useDesktopOpenCB, SIGNAL(toggled(bool)), viewActionPB, SLOT(setDisabled(bool))); + connect(useDesktopOpenCB, SIGNAL(toggled(bool)), + allExLE, SLOT(setEnabled(bool))); setFromPrefs(); } @@ -102,6 +104,8 @@ void UIPrefsDialog::setFromPrefs() // External editor. Can use desktop prefs or internal useDesktopOpenCB->setChecked(prefs.useDesktopOpen); viewActionPB->setEnabled(!prefs.useDesktopOpen); + allExLE->setEnabled(prefs.useDesktopOpen); + allExLE->setText(QString::fromUtf8(theconfig->getMimeViewerAllEx().c_str())); keepSortCB->setChecked(prefs.keepSort); previewHtmlCB->setChecked(prefs.previewHtml); @@ -242,6 +246,8 @@ void UIPrefsDialog::accept() prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked(); prefs.useDesktopOpen = useDesktopOpenCB->isChecked(); + theconfig->setMimeViewerAllEx((const char*)allExLE->text().toUtf8()); + prefs.keepSort = keepSortCB->isChecked(); prefs.previewHtml = previewHtmlCB->isChecked(); diff --git a/src/query/reslistpager.cpp b/src/query/reslistpager.cpp index 0d242e38..2164dbda 100644 --- a/src/query/reslistpager.cpp +++ b/src/query/reslistpager.cpp @@ -236,7 +236,7 @@ void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc, string apptag; doc.getmeta(Rcl::Doc::keyapptg, &apptag); - if (!config->getMimeViewerDef(doc.mimetype, apptag).empty()) { + if (!config->getMimeViewerDef(doc.mimetype, apptag, false).empty()) { linksbuf << "" << trans("Open") << ""; } diff --git a/src/sampleconf/mimeview b/src/sampleconf/mimeview index 2c7bbc7b..a5aa6c91 100644 --- a/src/sampleconf/mimeview +++ b/src/sampleconf/mimeview @@ -9,6 +9,12 @@ # exceptions and the list is normally empty #nouncompforviewmts = +# Exceptions when using the x-all entry: these types will use their local +# definition. This is useful, e.g. for pdf, where we can pass additional +# parameters like page to open and search string when using the local +# definition +xallexcepts = application/pdf application/postscript application/x-dvi + [view] # Pseudo entry used if the 'use desktop' preference is set in the GUI application/x-all = xdg-open %f @@ -16,9 +22,9 @@ application/x-all = xdg-open %f application/x-kword = kword %f application/x-abiword = abiword %f -application/pdf = okular %f -application/postscript = okular %f -application/x-dvi = okular %f +application/pdf = evince --page-index=%p --find=%s %f +application/postscript = evince --page-index=%p --find=%s %f +application/x-dvi = evince --page-index=%p --find=%s %f application/x-lyx = lyx %f application/x-scribus = scribus %f diff --git a/src/utils/conftree.cpp b/src/utils/conftree.cpp index b339ac4f..cc557f9b 100644 --- a/src/utils/conftree.cpp +++ b/src/utils/conftree.cpp @@ -246,7 +246,7 @@ int ConfSimple::get(const string &nm, string &value, const string &sk) const // Appropriately output a subkey (nm=="") or variable line. // Splits long lines static ConfSimple::WalkerCode varprinter(void *f, const string &nm, - const string &value) + const string &value) { ostream *output = (ostream *)f; if (nm.empty()) { @@ -276,7 +276,8 @@ int ConfSimple::set(const std::string &nm, const std::string &value, { if (status != STATUS_RW) return 0; - + LOGDEB2(("ConfSimple::set [%s]:[%s] -> [%s]\n", sk.c_str(), + nm.c_str(), value.c_str())); if (!i_set(nm, value, sk)) return 0; return write(); diff --git a/src/utils/conftree.h b/src/utils/conftree.h index 42533d5c..3750fadd 100644 --- a/src/utils/conftree.h +++ b/src/utils/conftree.h @@ -408,7 +408,8 @@ public: { if (!m_ok) return 0; - + //LOGDEB2(("ConfStack::set [%s]:[%s] -> [%s]\n", sk.c_str(), + //nm.c_str(), val.c_str())); // Avoid adding unneeded entries: if the new value matches the // one out from the deeper configs, erase or dont add it // from/to the topmost file diff --git a/website/release-1.18.html b/website/release-1.18.html new file mode 100644 index 00000000..f75dc910 --- /dev/null +++ b/website/release-1.18.html @@ -0,0 +1,120 @@ + + + + Recoll 1.18 series release notes + + + + + + + + + + + + + + + + +
+ +

Release notes for Recoll 1.18.x

+ + +

Caveats

+ +

Installing over an older version: 1.18 introduces serious + index formats changes, and it will be advisable to reset the + index in most cases. IF the 1.18 index is not configured for + case and diacritics sensitivity, it is mostly compatible with + 1.17 indexes though. Case/diacritics sensitivity can be turned + off either by a compile flag or a configuration variable, and + the default is still a stripped index (so, mostly compatible + with 1.17). If you activate case and diacritics sensitivity, + you must reset the index.

+ +

Always reset the index if installing over an older version (1.14 + and older). The simplest way to do this is to quit all recoll + programs and just delete the index directory (rm -rf ~/.recoll/xapiandb), then + start recoll or recollindex. recollindex -z will do the same in most + cases.

+ +

Some new, auxiliary, features do require a full reindex to work:

+
    +
  • The file size filtering functions (for an index created by + 1.16 or older).
  • +
  • The anchored search feature if the index was created by + release 1.15 or older.
  • +
+ + + +

Changes

+ +

Recoll 1.18 has some major changes 1.17, the most visible of + which is the ability to consider character case and diacritics + when searching.

+ +

Recoll 1.18.0 changes:

+ +
    + +
  • The index can now be configured for case and diacritics + sensitivity. Raw terms are indexed, and query time expansions + are used when search insensitivity is designed (in a similar + manner to what is used for stemming). See the chapter + manual for details about controlling the feature.
  • + +
  • More effort is put in choosing the terms used in + generating the snippets inside the result list.
  • + +
  • Capacity to store page breaks and use them when opening a + document.
  • +
  • Capacity to pass a search string to the native app.
  • +
  • New "snippets" window for documents with page numbers, let + the user choose a snippet and open the document at the + appropriate page.
  • +
  • We now use the Xapian "synonyms" mechanism to store all + data about stemming, case, and diacritics expansion (this + replace the previous ad-hoc stemming expansion mechanism).
  • + +
  • New script to start/stop recollindex according to mains + power status.
  • +
  • Add <pre style="white-space: pre-wrap"> to plain + text HTML display options.
  • +
  • Allow multiple directory specifications in the query + language, as in: dir:/home/me -dir:tmp
  • +
  • Improved search in the preview window, allows selecting + one of the initial search clauses from a list.
  • + +
  • Fixed bugs: +
      +
    • The unac_except_trans mechanism could be buggy in some + cases and generate wrong character translations.
    • +
    • Don't terminate monitor for permissions-related + addwatch error.
    • +
    • Fix handling of ODF documents exported by Google + docs.
    • + +
    +
  • + +
+ + +
+ +