reslist popup: enable save to file for web cache entries, disable open parent
This commit is contained in:
parent
4d35cbabfb
commit
922f73039a
@ -291,18 +291,10 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
|||||||
LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n",
|
LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n",
|
||||||
groksipath, wantsfile, wantsparentfile));
|
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
|
// 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:
|
// there is an ipath that it won't understand, we need a temp file:
|
||||||
theconfig->setKeyDir(path_getfather(fn));
|
theconfig->setKeyDir(path_getfather(fn));
|
||||||
if (notinfs ||
|
if (!doc.isFsFile() ||
|
||||||
((wantsfile || wantsparentfile) && fn.empty()) ||
|
((wantsfile || wantsparentfile) && fn.empty()) ||
|
||||||
(!groksipath && !doc.ipath.empty()) ) {
|
(!groksipath && !doc.ipath.empty()) ) {
|
||||||
TempFile temp;
|
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 &File Name"), me, SLOT(menuCopyFN()));
|
||||||
popup->addAction(QWidget::tr("Copy &URL"), me, SLOT(menuCopyURL()));
|
popup->addAction(QWidget::tr("Copy &URL"), me, SLOT(menuCopyURL()));
|
||||||
|
|
||||||
if ((opts&showSaveOne) && !doc.ipath.empty())
|
if ((opts&showSaveOne) && (!doc.isFsFile() || !doc.ipath.empty()))
|
||||||
popup->addAction(QWidget::tr("&Write to File"), me, SLOT(menuSaveToFile()));
|
popup->addAction(QWidget::tr("&Write to File"), me,
|
||||||
|
SLOT(menuSaveToFile()));
|
||||||
|
|
||||||
if ((opts&showSaveSel))
|
if ((opts&showSaveSel))
|
||||||
popup->addAction(QWidget::tr("Save selection to files"),
|
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
|
// Open parent is useful even if there is no parent because we open
|
||||||
// the enclosing folder.
|
// the enclosing folder.
|
||||||
popup->addAction(QWidget::tr("&Open Parent document/folder"),
|
if (doc.isFsFile())
|
||||||
me, SLOT(menuOpenParent()));
|
popup->addAction(QWidget::tr("&Open Parent document/folder"),
|
||||||
|
me, SLOT(menuOpenParent()));
|
||||||
|
|
||||||
if (opts & showExpand)
|
if (opts & showExpand)
|
||||||
popup->addAction(QWidget::tr("Find &similar documents"),
|
popup->addAction(QWidget::tr("Find &similar documents"),
|
||||||
|
|||||||
@ -233,6 +233,18 @@ class Doc {
|
|||||||
return true;
|
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;
|
void dump(bool dotext=false) const;
|
||||||
|
|
||||||
// The official names for recoll native fields when used in a text
|
// The official names for recoll native fields when used in a text
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user