get things to compile with recoll 1.9 and suse + kde 3.5.5
This commit is contained in:
parent
5fdea601f3
commit
8f082be8d5
@ -1,4 +1,6 @@
|
||||
|
||||
(this used to work but last time I tried with konqueror (kde3, 11-2007), it failed with "protocol not authorized" or such. Didn't investigate more).
|
||||
|
||||
This is a small experiment with a recoll kio_slave
|
||||
|
||||
A kio_slave was implemented, supporting the "get" operation. Ie, you type
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
depth=../..
|
||||
depth=../../..
|
||||
include $(depth)/mk/sysconf
|
||||
|
||||
all: kio_recoll.so
|
||||
|
||||
DEPS_CXXFLAGS = -MT pop3.lo -MD -MP -MF .deps/pop3.Tpo
|
||||
|
||||
INC_CXXFLAGS = -I. -I/usr/local/include -I/usr/X11R6/include \
|
||||
INC_CXXFLAGS = -I. \
|
||||
-I/usr/local/include -I/usr/X11R6/include \
|
||||
-I/opt/kde3/include -I$(QTDIR)/include \
|
||||
-I$(depth)/common -I$(depth)/query -I$(depth)/utils \
|
||||
-I$(depth)/qtgui -I$(depth)/rcldb
|
||||
|
||||
@ -17,7 +19,10 @@ QT_CXXFLAGS = -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL \
|
||||
SYS_CXXFLAGS = -D_GNU_SOURCE
|
||||
THREAD_CXXFLAGS = -D_THREAD_SAFE -pthread -D_THREAD_SAFE -pthread
|
||||
|
||||
LDFLAGS = -rpath=/usr/lib:/usr/local/lib \
|
||||
|
||||
# -rpath=/usr/lib:/usr/local/lib \
|
||||
|
||||
LDFLAGS = \
|
||||
-Wl,--rpath -Wl,/usr/local/lib \
|
||||
-Wl,--rpath -Wl,/usr/X11R6/lib \
|
||||
-Wl,-export-dynamic -Wl,-soname -Wl,kio_recoll.so
|
||||
@ -28,8 +33,8 @@ kio_recoll.so : kio_recoll.o libpic
|
||||
-Wl,--no-undefined \
|
||||
kio_recoll.o piclib/librcl.a \
|
||||
$(LIBXAPIAN) $(LIBICONV) \
|
||||
-L/usr/local/lib -L/usr/X11R6/lib -lkio -lkdecore \
|
||||
-lqt-mt \
|
||||
-L/opt/kde3/lib -L/usr/local/lib -L/usr/X11R6/lib -lkio -lkdecore \
|
||||
-L/usr/lib/qt3/lib -lqt-mt \
|
||||
-L/usr/lib -lstdc++ -lm -lc \
|
||||
-o kio_recoll.so
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: kio_recoll.cpp,v 1.6 2007-02-01 12:43:21 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: kio_recoll.cpp,v 1.7 2007-11-09 15:46:17 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@ -27,14 +27,18 @@ using namespace std;
|
||||
#include "kio_recoll.h"
|
||||
|
||||
using namespace KIO;
|
||||
|
||||
static RclConfig *rclconfig;
|
||||
RclConfig *RclConfig::getMainConfig()
|
||||
{
|
||||
return rclconfig;
|
||||
}
|
||||
|
||||
RecollProtocol::RecollProtocol(const QCString &pool, const QCString &app)
|
||||
: SlaveBase("recoll", pool, app), m_initok(false),
|
||||
m_rclconfig(0), m_rcldb(0), m_docsource(0)
|
||||
{
|
||||
string reason;
|
||||
m_rclconfig = recollinit(0, 0, m_reason);
|
||||
rclconfig = m_rclconfig = recollinit(0, 0, m_reason);
|
||||
if (!m_rclconfig || !m_rclconfig->ok()) {
|
||||
m_reason = string("Configuration problem: ") + reason;
|
||||
return;
|
||||
@ -69,7 +73,10 @@ bool RecollProtocol::maybeOpenDb(string &reason)
|
||||
reason = "Internal error: initialization error";
|
||||
return false;
|
||||
}
|
||||
if (!m_rcldb->isopen() && !m_rcldb->open(m_dbdir, Rcl::Db::DbRO)) {
|
||||
if (!m_rcldb->isopen() && !m_rcldb->open(m_dbdir,
|
||||
m_rclconfig->getStopfile(),
|
||||
Rcl::Db::DbRO,
|
||||
Rcl::Db::QO_STEM)) {
|
||||
reason = "Could not open database in " + m_dbdir;
|
||||
return false;
|
||||
}
|
||||
@ -134,7 +141,7 @@ void RecollProtocol::get(const KURL & url)
|
||||
if (!m_docsource->getDoc(i, doc, &percent, &sh)) {
|
||||
// This may very well happen for history if the doc has
|
||||
// been removed since. So don't treat it as fatal.
|
||||
doc.abstract = string("Unavailable document");
|
||||
doc.meta["abstract"] = string("Unavailable document");
|
||||
}
|
||||
|
||||
string iconname = m_rclconfig->getMimeIconName(doc.mimetype);
|
||||
@ -150,8 +157,8 @@ void RecollProtocol::get(const KURL & url)
|
||||
|
||||
char perbuf[10];
|
||||
sprintf(perbuf, "%3d%%", percent);
|
||||
if (doc.title.empty())
|
||||
doc.title = path_getsimple(doc.url);
|
||||
if (doc.meta["title"].empty())
|
||||
doc.meta["title"] = path_getsimple(doc.url);
|
||||
char datebuf[100];
|
||||
datebuf[0] = 0;
|
||||
if (!doc.dmtime.empty() || !doc.fmtime.empty()) {
|
||||
@ -162,12 +169,13 @@ void RecollProtocol::get(const KURL & url)
|
||||
"<i>Modified:</i> %Y-%m-%d %H:%M:%S", tm);
|
||||
}
|
||||
result += "<img src=\"file://" + imgfile + "\" align=\"left\">";
|
||||
string abst = escapeHtml(doc.abstract);
|
||||
result += string(perbuf) + " <b>" + doc.title + "</b><br>" +
|
||||
string abst = escapeHtml(doc.meta["abstract"]);
|
||||
result += string(perbuf) + " <b>" + doc.meta["title"] + "</b><br>" +
|
||||
doc.mimetype + " " +
|
||||
(datebuf[0] ? string(datebuf) + "<br>" : string("<br>")) +
|
||||
(!abst.empty() ? abst + "<br>" : string("")) +
|
||||
(!doc.keywords.empty() ? doc.keywords + "<br>" : string("")) +
|
||||
(!doc.meta["keywords"].empty() ? doc.meta["keywords"] +
|
||||
"<br>" : string("")) +
|
||||
"<a href=\"" + doc.url + "\">" + doc.url + "</a><br></p>\n";
|
||||
|
||||
QString str = QString::fromUtf8(result.c_str(), result.length());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user