added external filters and pdf handling

This commit is contained in:
dockes
2005-02-01 17:20:06 +00:00
parent cc512e2ec0
commit d0aaf92220
14 changed files with 373 additions and 82 deletions
+16
View File
@@ -0,0 +1,16 @@
#ifndef _IDXTHREAD_H_INCLUDED_
#define _IDXTHREAD_H_INCLUDED_
/* @(#$Id: idxthread.h,v 1.1 2005-02-01 17:20:05 dockes Exp $ (C) 2004 J.F.Dockes */
class RclConfig;
// These two deal with starting / stopping the thread itself, not indexing
// sessions.
extern void start_idxthread(RclConfig *cnf);
extern void stop_idxthread();
extern int startindexing;
extern int indexingdone;
extern bool indexingstatus;
#endif /* _IDXTHREAD_H_INCLUDED_ */
+17
View File
@@ -0,0 +1,17 @@
#ifndef _RECOLL_H_INCLUDED_
#define _RECOLL_H_INCLUDED_
/* @(#$Id: recoll.h,v 1.1 2005-02-01 17:20:05 dockes Exp $ (C) 2004 J.F.Dockes */
#include "rclconfig.h"
#include "rcldb.h"
#include "idxthread.h"
extern void recollCleanup();
// Misc declarations in need of sharing between the UI files
extern RclConfig *rclconfig;
extern Rcl::Db *rcldb;
extern int recollNeedsExit;
#endif /* _RECOLL_H_INCLUDED_ */
+8 -4
View File
@@ -146,9 +146,9 @@ void RecollMain::reslistTE_clicked(int par, int car)
// for preview:
// Look for appropriate handler
MimeHandlerFunc fun =
MimeHandler *handler =
getMimeHandler(doc.mimetype, rclconfig->getMimeConf());
if (!fun) {
if (!handler) {
QMessageBox::warning(0, "Recoll",
QString("No mime handler for mime type ") +
doc.mimetype.c_str());
@@ -157,13 +157,15 @@ void RecollMain::reslistTE_clicked(int par, int car)
string fn = urltolocalpath(doc.url);
Rcl::Doc fdoc;
if (!fun(rclconfig, fn, doc.mimetype, fdoc)) {
if (!handler->worker(rclconfig, fn, doc.mimetype, fdoc)) {
QMessageBox::warning(0, "Recoll",
QString("Failed to convert document for preview!\n") +
fn.c_str() + " mimetype " +
doc.mimetype.c_str());
delete handler;
return;
}
delete handler;
string rich = plaintorich(fdoc.text);
@@ -188,7 +190,8 @@ void RecollMain::reslistTE_clicked(int par, int car)
}
// User asked to start query
// User asked to start query. Run it and call listNextPB_clicked to display
// first page of results
void RecollMain::queryText_returnPressed()
{
LOGDEB(("RecollMain::queryText_returnPressed()\n"));
@@ -294,6 +297,7 @@ void RecollMain::listNextPB_clicked()
struct tm *tm = localtime(&mtime);
strftime(datebuf, 99, "<i>Modified:</i>&nbsp;%F&nbsp;%T", tm);
}
LOGDEB(("Abstract: %s\n", doc.abstract.c_str()));
string result = "<p>" +
string(perbuf) + " <b>" + doc.title + "</b><br>" +
doc.mimetype + "&nbsp;" +