reslist: only create an Open popup menu entry if we would create an Open link (doc type has a viewer).

This commit is contained in:
Jean-Francois Dockes 2012-05-04 09:46:20 +02:00
parent 630b9400d2
commit b435dd8cc3

View file

@ -809,11 +809,19 @@ void ResList::createPopupMenu(const QPoint& pos)
return;
QMenu *popup = new QMenu(this);
popup->addAction(tr("&Preview"), this, SLOT(menuPreview()));
Rcl::Doc doc;
bool havedoc = getDoc(m_popDoc, doc);
string apptag;
if (havedoc)
doc.getmeta(Rcl::Doc::keyapptg, &apptag);
if (havedoc && !theconfig->getMimeViewerDef(doc.mimetype, apptag).empty()) {
popup->addAction(tr("&Open"), this, SLOT(menuEdit()));
}
popup->addAction(tr("Copy &File Name"), this, SLOT(menuCopyFN()));
popup->addAction(tr("Copy &URL"), this, SLOT(menuCopyURL()));
Rcl::Doc doc;
if (getDoc(m_popDoc, doc) && !doc.ipath.empty()) {
if (havedoc && !doc.ipath.empty()) {
popup->addAction(tr("&Write to File"), this, SLOT(menuSaveToFile()));
}