|
a/src/query/reslistpager.cpp |
|
b/src/query/reslistpager.cpp |
|
... |
|
... |
149 |
|
149 |
|
150 |
void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
|
150 |
void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
|
151 |
const HighlightData& hdata, const string& sh)
|
151 |
const HighlightData& hdata, const string& sh)
|
152 |
{
|
152 |
{
|
153 |
ostringstream chunk;
|
153 |
ostringstream chunk;
|
154 |
int percent;
|
|
|
155 |
if (doc.pc == -1) {
|
|
|
156 |
percent = 0;
|
|
|
157 |
// Document not available, maybe other further, will go on.
|
|
|
158 |
doc.meta[Rcl::Doc::keyabs] = string(trans("Unavailable document"));
|
|
|
159 |
} else {
|
|
|
160 |
percent = doc.pc;
|
|
|
161 |
}
|
|
|
162 |
|
154 |
|
163 |
// Determine icon to display if any
|
155 |
// Determine icon to display if any
|
164 |
string iconurl = iconUrl(config, doc);
|
156 |
string iconurl = iconUrl(config, doc);
|
165 |
|
157 |
|
166 |
// Printable url: either utf-8 if transcoding succeeds, or url-encoded
|
158 |
// Printable url: either utf-8 if transcoding succeeds, or url-encoded
|
167 |
string url;
|
159 |
string url;
|
168 |
printableUrl(config->getDefCharset(), doc.url, url);
|
160 |
printableUrl(config->getDefCharset(), doc.url, url);
|
169 |
|
161 |
|
170 |
// Same as url, but with file:// possibly stripped. output by %u instead
|
162 |
// Same as url, but with file:// possibly stripped. output by %u instead
|
|
... |
|
... |
491 |
string ResListPager::iconUrl(RclConfig *config, Rcl::Doc& doc)
|
483 |
string ResListPager::iconUrl(RclConfig *config, Rcl::Doc& doc)
|
492 |
{
|
484 |
{
|
493 |
string apptag;
|
485 |
string apptag;
|
494 |
doc.getmeta(Rcl::Doc::keyapptg, &apptag);
|
486 |
doc.getmeta(Rcl::Doc::keyapptg, &apptag);
|
495 |
|
487 |
|
496 |
return cstr_fileu + config->getMimeIconPath(doc.mimetype, apptag);
|
488 |
return path_pathtofileurl(config->getMimeIconPath(doc.mimetype, apptag));
|
497 |
}
|
489 |
}
|
498 |
|
490 |
|
499 |
bool ResListPager::append(const string& data)
|
491 |
bool ResListPager::append(const string& data)
|
500 |
{
|
492 |
{
|
501 |
fprintf(stderr, "%s", data.c_str());
|
493 |
fprintf(stderr, "%s", data.c_str());
|