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:
parent
630b9400d2
commit
b435dd8cc3
1 changed files with 12 additions and 4 deletions
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue