Switch to unified view

a/src/qtgui/respopup.cpp b/src/qtgui/respopup.cpp
...
...
23
#include "debuglog.h"
23
#include "debuglog.h"
24
#include "smallut.h"
24
#include "smallut.h"
25
#include "recoll.h"
25
#include "recoll.h"
26
#include "docseq.h"
26
#include "docseq.h"
27
#include "respopup.h"
27
#include "respopup.h"
28
#include "appformime.h"
28
29
29
namespace ResultPopup {
30
namespace ResultPopup {
30
31
31
QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
32
QMenu *create(QWidget *me, int opts, RefCntr<DocSequence> source, Rcl::Doc& doc)
32
{
33
{
...
...
43
44
44
    popup->addAction(me->tr("&Preview"), me, SLOT(menuPreview()));
45
    popup->addAction(me->tr("&Preview"), me, SLOT(menuPreview()));
45
46
46
    if (!theconfig->getMimeViewerDef(doc.mimetype, apptag, 0).empty()) {
47
    if (!theconfig->getMimeViewerDef(doc.mimetype, apptag, 0).empty()) {
47
    popup->addAction(me->tr("&Open"), me, SLOT(menuEdit()));
48
    popup->addAction(me->tr("&Open"), me, SLOT(menuEdit()));
49
    }
50
51
    if (doc.ipath.empty()) {
52
        vector<DesktopDb::AppDef> aps;
53
        DesktopDb *ddb = DesktopDb::getDb();
54
        if (ddb && ddb->appForMime(doc.mimetype, &aps) && 
55
            !aps.empty()) {
56
            QMenu *sub = popup->addMenu(me->tr("Open With"));
57
            if (sub) {
58
                for (vector<DesktopDb::AppDef>::const_iterator it = aps.begin();
59
                     it != aps.end(); it++) {
60
                    QAction *act = new 
61
                        QAction(QString::fromUtf8(it->name.c_str()), me);
62
                    QVariant v(QString::fromUtf8(it->command.c_str()));
63
                    act->setData(v);
64
                    sub->addAction(act);
65
                }
66
                sub->connect(sub, SIGNAL(triggered(QAction *)), me, 
67
                             SLOT(menuOpenWith(QAction *)));
68
            }
69
        }
48
    }
70
    }
49
71
50
    popup->addAction(me->tr("Copy &File Name"), me, SLOT(menuCopyFN()));
72
    popup->addAction(me->tr("Copy &File Name"), me, SLOT(menuCopyFN()));
51
    popup->addAction(me->tr("Copy &URL"), me, SLOT(menuCopyURL()));
73
    popup->addAction(me->tr("Copy &URL"), me, SLOT(menuCopyURL()));
52
74