Commit 922f7303 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

reslist popup: enable save to file for web cache entries, disable open parent

parent 4d35cbab
......@@ -291,18 +291,10 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n",
groksipath, wantsfile, wantsparentfile));
bool notinfs = false;
{
string backend;
doc.getmeta(Rcl::Doc::keybcknd, &backend);
if (!backend.empty() && backend.compare("FS"))
notinfs = true;
}
// If the command wants a file but this is not a file url, or
// there is an ipath that it won't understand, we need a temp file:
theconfig->setKeyDir(path_getfather(fn));
if (notinfs ||
if (!doc.isFsFile() ||
((wantsfile || wantsparentfile) && fn.empty()) ||
(!groksipath && !doc.ipath.empty()) ) {
TempFile temp;
......
......@@ -103,8 +103,9 @@ QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
popup->addAction(QWidget::tr("Copy &File Name"), me, SLOT(menuCopyFN()));
popup->addAction(QWidget::tr("Copy &URL"), me, SLOT(menuCopyURL()));
if ((opts&showSaveOne) && !doc.ipath.empty())
popup->addAction(QWidget::tr("&Write to File"), me, SLOT(menuSaveToFile()));
if ((opts&showSaveOne) && (!doc.isFsFile() || !doc.ipath.empty()))
popup->addAction(QWidget::tr("&Write to File"), me,
SLOT(menuSaveToFile()));
if ((opts&showSaveSel))
popup->addAction(QWidget::tr("Save selection to files"),
......@@ -117,8 +118,9 @@ QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
}
// Open parent is useful even if there is no parent because we open
// the enclosing folder.
popup->addAction(QWidget::tr("&Open Parent document/folder"),
me, SLOT(menuOpenParent()));
if (doc.isFsFile())
popup->addAction(QWidget::tr("&Open Parent document/folder"),
me, SLOT(menuOpenParent()));
if (opts & showExpand)
popup->addAction(QWidget::tr("Find &similar documents"),
......
......@@ -233,6 +233,18 @@ class Doc {
return true;
}
/* Is this document stored as a regular filesystem file ?
* (as opposed to e.g. a webcache file), not a subdoc,
*/
bool isFsFile() {
string backend;
getmeta(keybcknd, &backend);
if (!backend.empty() && backend.compare("FS"))
return false;
return true;
}
void dump(bool dotext=false) const;
// The official names for recoll native fields when used in a text
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment