set name as preview title

This commit is contained in:
dockes 2008-12-08 17:43:32 +00:00
parent 7f3017d8c9
commit e4bf6f4cf5

View File

@ -1,5 +1,5 @@
#ifndef lint #ifndef lint
static char rcsid[] = "@(#$Id: htmlif.cpp,v 1.8 2008-12-08 14:34:50 dockes Exp $ (C) 2005 J.F.Dockes"; static char rcsid[] = "@(#$Id: htmlif.cpp,v 1.9 2008-12-08 17:43:32 dockes Exp $ (C) 2005 J.F.Dockes";
#endif #endif
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -97,12 +97,11 @@ const string& RecollKioPager::parFormat()
str << str <<
"<a href=\"%U\"><img src=\"%I\" align=\"left\"></a>" "<a href=\"%U\"><img src=\"%I\" align=\"left\"></a>"
"%R %S " "%R %S "
"<a href=\"%U\">Open</a>&nbsp;&nbsp;"; "<a href=\"" << escurl << "&cmd=pv&dn=%N\">Preview</a>&nbsp;&nbsp;" <<
str << "<a href=\"" << escurl << "&cmd=pv&dn=%N\">Preview</a><br>"; "<a href=\"%U\">Open</a><br>" <<
str << "<b>%T</b><br>"
"<b>%T</b><br>" "%M&nbsp;%D&nbsp;&nbsp; <i>%U</i><br>"
"%M&nbsp;%D&nbsp;&nbsp; <i>%U</i><br>" "%A %K";
"%A %K";
return parformat = str.str(); return parformat = str.str();
} }
@ -206,20 +205,29 @@ void RecollProtocol::queryDetails()
data(array); data(array);
} }
class PlainToRichKio : public PlainToRich { class PlainToRichKio : public PlainToRich {
public: public:
PlainToRichKio(bool inputhtml = false) : PlainToRich(inputhtml) { PlainToRichKio(const string& nm, bool inputhtml = false)
: PlainToRich(inputhtml) , m_name(nm)
{
} }
virtual ~PlainToRichKio() {} virtual ~PlainToRichKio() {}
virtual string header() { virtual string header() {
if (m_inputhtml) { if (m_inputhtml) {
return snull; return snull;
} else { } else {
return string("<html><head><title></title></head><body><p>"); return
string("<html><head>"
"<META http-equiv=\"Content-Type\""
"content=\"text/html;charset=UTF-8\"><title>") +
m_name +
string("</title></head><body><p>");
} }
} }
virtual string startMatch() {return string("<font color=\"blue\">");} virtual string startMatch() {return string("<font color=\"blue\">");}
virtual string endMatch() {return string("</font>");} virtual string endMatch() {return string("</font>");}
const string &m_name;
}; };
void RecollProtocol::showPreview(const Rcl::Doc& doc) void RecollProtocol::showPreview(const Rcl::Doc& doc)
@ -259,8 +267,8 @@ void RecollProtocol::showPreview(const Rcl::Doc& doc)
mimeType("text/html"); mimeType("text/html");
PlainToRichKio ptr; string fname = path_getsimple(doc.url).c_str();
ptr.set_inputhtml(!fdoc.mimetype.compare("text/html")); PlainToRichKio ptr(fname, !fdoc.mimetype.compare("text/html"));
list<string> otextlist; list<string> otextlist;
HiliteData hdata; HiliteData hdata;
if (!m_source.isNull()) if (!m_source.isNull())