fixed a few connections in subdocs aux reslist

This commit is contained in:
Jean-Francois Dockes 2013-04-25 14:21:24 +02:00
parent cdbf8e6cd3
commit 1ca3d028e6
2 changed files with 29 additions and 11 deletions

View file

@ -367,13 +367,19 @@ int main(int argc, char **argv)
string rundir; string rundir;
config->getConfParam("idxrundir", rundir); config->getConfParam("idxrundir", rundir);
if (!rundir.compare("tmp")) { if (!rundir.compare("tmp")) {
LOGDEB(("recollindex: changing current directory to [%s]\n", LOGINFO(("recollindex: changing current directory to [%s]\n",
tmplocation().c_str())); tmplocation().c_str()));
chdir(tmplocation().c_str()); if (chdir(tmplocation().c_str()) < 0) {
LOGERR(("chdir(%s) failed, errno %d\n",
tmplocation().c_str(), errno));
}
} else if (!rundir.empty()) { } else if (!rundir.empty()) {
LOGDEB(("recollindex: changing current directory to [%s]\n", LOGINFO(("recollindex: changing current directory to [%s]\n",
rundir.c_str())); rundir.c_str()));
chdir(rundir.c_str()); if (chdir(rundir.c_str()) < 0) {
LOGERR(("chdir(%s) failed, errno %d\n",
rundir.c_str(), errno));
}
} }
bool rezero((op_flags & OPT_z) != 0); bool rezero((op_flags & OPT_z) != 0);

View file

@ -389,6 +389,10 @@ void ResList::setDocSource(RefCntr<DocSequence> nsource)
m_rclmain, SLOT(startPreview(Rcl::Doc))); m_rclmain, SLOT(startPreview(Rcl::Doc)));
connect(this, SIGNAL(docEditClicked(Rcl::Doc)), connect(this, SIGNAL(docEditClicked(Rcl::Doc)),
m_rclmain, SLOT(startNativeViewer(Rcl::Doc))); m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
connect(this, SIGNAL(docSaveToFileClicked(Rcl::Doc)),
m_rclmain, SLOT(saveDocToFile(Rcl::Doc)));
connect(this, SIGNAL(editRequested(Rcl::Doc)),
m_rclmain, SLOT(startNativeViewer(Rcl::Doc)));
} }
} }
@ -985,15 +989,16 @@ void ResList::createPopupMenu(const QPoint& pos)
if (m_popDoc < 0) if (m_popDoc < 0)
return; return;
QMenu *popup = new QMenu(this);
popup->addAction(tr("&Preview"), this, SLOT(menuPreview()));
Rcl::Doc doc; Rcl::Doc doc;
bool havedoc = getDoc(m_popDoc, doc); bool havedoc = getDoc(m_popDoc, doc);
string apptag; string apptag;
if (havedoc) if (havedoc)
doc.getmeta(Rcl::Doc::keyapptg, &apptag); doc.getmeta(Rcl::Doc::keyapptg, &apptag);
QMenu *popup = new QMenu(this);
popup->addAction(tr("&Preview"), this, SLOT(menuPreview()));
if (havedoc && if (havedoc &&
!theconfig->getMimeViewerDef(doc.mimetype, apptag, 0).empty()) { !theconfig->getMimeViewerDef(doc.mimetype, apptag, 0).empty()) {
popup->addAction(tr("&Open"), this, SLOT(menuEdit())); popup->addAction(tr("&Open"), this, SLOT(menuEdit()));
@ -1004,7 +1009,9 @@ void ResList::createPopupMenu(const QPoint& pos)
popup->addAction(tr("&Write to File"), this, SLOT(menuSaveToFile())); popup->addAction(tr("&Write to File"), this, SLOT(menuSaveToFile()));
} }
popup->addAction(tr("Find &similar documents"), this, SLOT(menuExpand())); if (m_ismainlist)
popup->addAction(tr("Find &similar documents"),
this, SLOT(menuExpand()));
Rcl::Doc pdoc; Rcl::Doc pdoc;
if (m_source.isNotNull() && m_source->getEnclosing(doc, pdoc)) if (m_source.isNotNull() && m_source->getEnclosing(doc, pdoc))
@ -1028,8 +1035,13 @@ void ResList::createPopupMenu(const QPoint& pos)
void ResList::menuPreview() void ResList::menuPreview()
{ {
Rcl::Doc doc; Rcl::Doc doc;
if (getDoc(m_popDoc, doc)) if (getDoc(m_popDoc, doc)) {
if (m_ismainlist) {
emit docPreviewClicked(m_popDoc, doc, 0); emit docPreviewClicked(m_popDoc, doc, 0);
} else {
emit previewRequested(doc);
}
}
} }
void ResList::menuSaveToFile() void ResList::menuSaveToFile()