have more compact list header + %N
This commit is contained in:
parent
d242fe8665
commit
e5725c9eb7
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.7 2006-11-10 17:53:54 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.8 2006-11-11 15:30:48 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -229,9 +229,6 @@ void ResList::resultPageNext()
|
|||||||
if (!m_docsource)
|
if (!m_docsource)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int percent;
|
|
||||||
Rcl::Doc doc;
|
|
||||||
|
|
||||||
int resCnt = m_docsource->getResCnt();
|
int resCnt = m_docsource->getResCnt();
|
||||||
m_pageParaToReldocnums.clear();
|
m_pageParaToReldocnums.clear();
|
||||||
|
|
||||||
@ -283,8 +280,8 @@ void ResList::resultPageNext()
|
|||||||
// setUpdatesEnabled(false);
|
// setUpdatesEnabled(false);
|
||||||
for (int i = 0; i < last; i++) {
|
for (int i = 0; i < last; i++) {
|
||||||
string sh;
|
string sh;
|
||||||
doc.erase();
|
Rcl::Doc doc;
|
||||||
|
int percent;
|
||||||
if (!m_docsource->getDoc(m_winfirst + i, doc, &percent, &sh)) {
|
if (!m_docsource->getDoc(m_winfirst + i, doc, &percent, &sh)) {
|
||||||
// Error or end of docs, stop.
|
// Error or end of docs, stop.
|
||||||
break;
|
break;
|
||||||
@ -299,22 +296,27 @@ void ResList::resultPageNext()
|
|||||||
// Display list header
|
// Display list header
|
||||||
// We could use a <title> but the textedit doesnt display
|
// We could use a <title> but the textedit doesnt display
|
||||||
// it prominently
|
// it prominently
|
||||||
append("<qt><head></head><body>");
|
|
||||||
// Note: have to append text in chunks that make sense
|
// Note: have to append text in chunks that make sense
|
||||||
// html-wise. If we break things up to much, the editor
|
// html-wise. If we break things up to much, the editor
|
||||||
// gets confused. Hence the use of the 'chunk' text
|
// gets confused. Hence the use of the 'chunk' text
|
||||||
// accumulator
|
// accumulator
|
||||||
QString chunk = "<p><font size=+1><b>";
|
QString chunk = "<qt><head></head><body><p>";
|
||||||
|
|
||||||
|
chunk += "<font size=+1><b>";
|
||||||
chunk += QString::fromUtf8(m_docsource->title().c_str());
|
chunk += QString::fromUtf8(m_docsource->title().c_str());
|
||||||
chunk += "</b></font><br>";
|
chunk += ".</b></font>";
|
||||||
chunk += "<a href=\"H-1\">";
|
|
||||||
chunk += tr("Show query details");
|
chunk += " ";
|
||||||
chunk += "</a><br>";
|
|
||||||
append(chunk);
|
chunk += tr("Documents <b>%1-%2</b> out of <b>%3</b> for ")
|
||||||
chunk = tr("<b>Displaying results starting at index"
|
|
||||||
" %1 (maximum set size %2)</b></p>\n")
|
|
||||||
.arg(m_winfirst+1)
|
.arg(m_winfirst+1)
|
||||||
|
.arg(m_winfirst+last)
|
||||||
.arg(resCnt);
|
.arg(resCnt);
|
||||||
|
|
||||||
|
chunk += "<a href=\"H-1\">";
|
||||||
|
chunk += tr("(show query)");
|
||||||
|
chunk += "</a>";
|
||||||
|
|
||||||
append(chunk);
|
append(chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +349,11 @@ void ResList::resultPageNext()
|
|||||||
if (doc.title.empty()) {
|
if (doc.title.empty()) {
|
||||||
doc.title = path_getsimple(url);
|
doc.title = path_getsimple(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Result number
|
||||||
|
char numbuf[20];
|
||||||
|
sprintf(numbuf, "%.2d", m_winfirst+1+i);
|
||||||
|
|
||||||
// Document date: either doc or file modification time
|
// Document date: either doc or file modification time
|
||||||
char datebuf[100];
|
char datebuf[100];
|
||||||
datebuf[0] = 0;
|
datebuf[0] = 0;
|
||||||
@ -409,6 +415,7 @@ void ResList::resultPageNext()
|
|||||||
subs['D'] = datebuf;
|
subs['D'] = datebuf;
|
||||||
subs['K'] = !doc.keywords.empty() ? doc.keywords + "<br>" : "";
|
subs['K'] = !doc.keywords.empty() ? doc.keywords + "<br>" : "";
|
||||||
subs['L'] = linksbuf;
|
subs['L'] = linksbuf;
|
||||||
|
subs['N'] = numbuf;
|
||||||
subs['M'] = doc.mimetype;
|
subs['M'] = doc.mimetype;
|
||||||
subs['R'] = perbuf;
|
subs['R'] = perbuf;
|
||||||
subs['S'] = sizebuf;
|
subs['S'] = sizebuf;
|
||||||
|
|||||||
@ -154,7 +154,7 @@
|
|||||||
<string>Result paragraph<br>format string</string>
|
<string>Result paragraph<br>format string</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip" stdset="0">
|
<property name="toolTip" stdset="0">
|
||||||
<string>Defines the format for each result list paragraph. Use qt html format.<br>See manual for the significance of the %xx substitutions.</string>
|
<string>Defines the format for each result list paragraph. Use qt html format and printf-like replacements:<br>%A Abstract<br> %D Date<br> %K Keywords (if any)<br> %L Preview and Edit links<br> %M Mime type<br> %N Result number<br> %R Relevance percentage<br> %S Size information<br> %T Title<br> %U Url<br></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextEdit">
|
<widget class="QTextEdit">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user