escape possibly not html-safe text
This commit is contained in:
parent
b3d67b2806
commit
fca75ed7b2
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.23 2007-02-08 09:03:28 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.24 2007-05-30 12:29:38 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -29,11 +29,11 @@ static char rcsid[] = "@(#$Id: reslist.cpp,v 1.23 2007-02-08 09:03:28 dockes Exp
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
|
#include "smallut.h"
|
||||||
#include "recoll.h"
|
#include "recoll.h"
|
||||||
#include "guiutils.h"
|
#include "guiutils.h"
|
||||||
#include "pathut.h"
|
#include "pathut.h"
|
||||||
#include "docseq.h"
|
#include "docseq.h"
|
||||||
#include "transcode.h"
|
|
||||||
#include "pathut.h"
|
#include "pathut.h"
|
||||||
#include "mimehandler.h"
|
#include "mimehandler.h"
|
||||||
#include "plaintorich.h"
|
#include "plaintorich.h"
|
||||||
@ -261,6 +261,18 @@ static string displayableBytes(long size)
|
|||||||
return string(sizebuf);
|
return string(sizebuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResList::append(const QString &text)
|
||||||
|
{
|
||||||
|
QTEXTBROWSER::append(text);
|
||||||
|
#if 0
|
||||||
|
{
|
||||||
|
FILE *fp = fopen("/tmp/debugreslist", "a");
|
||||||
|
fprintf(fp, "%s\n", (const char *)text.utf8());
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Fill up result list window with next screen of hits
|
// Fill up result list window with next screen of hits
|
||||||
void ResList::resultPageNext()
|
void ResList::resultPageNext()
|
||||||
{
|
{
|
||||||
@ -458,7 +470,7 @@ void ResList::resultPageNext()
|
|||||||
} else {
|
} else {
|
||||||
abstract = doc.abstract;
|
abstract = doc.abstract;
|
||||||
}
|
}
|
||||||
|
// No need to call escapeHtml(), plaintorich handles it
|
||||||
string richabst;
|
string richabst;
|
||||||
plaintorich(abstract, richabst, hdata, true);
|
plaintorich(abstract, richabst, hdata, true);
|
||||||
|
|
||||||
@ -492,13 +504,14 @@ void ResList::resultPageNext()
|
|||||||
map<char,string> subs;
|
map<char,string> subs;
|
||||||
subs['A'] = !richabst.empty() ? richabst + "<br>" : "";
|
subs['A'] = !richabst.empty() ? richabst + "<br>" : "";
|
||||||
subs['D'] = datebuf;
|
subs['D'] = datebuf;
|
||||||
subs['K'] = !doc.keywords.empty() ? doc.keywords + "<br>" : "";
|
subs['K'] = !doc.keywords.empty() ? escapeHtml(doc.keywords) + "<br>"
|
||||||
|
: "";
|
||||||
subs['L'] = linksbuf;
|
subs['L'] = linksbuf;
|
||||||
subs['N'] = numbuf;
|
subs['N'] = numbuf;
|
||||||
subs['M'] = doc.mimetype;
|
subs['M'] = doc.mimetype;
|
||||||
subs['R'] = perbuf;
|
subs['R'] = perbuf;
|
||||||
subs['S'] = sizebuf;
|
subs['S'] = sizebuf;
|
||||||
subs['T'] = doc.title;
|
subs['T'] = escapeHtml(doc.title);
|
||||||
subs['U'] = url;
|
subs['U'] = url;
|
||||||
|
|
||||||
string formatted;
|
string formatted;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef _RESLIST_H_INCLUDED_
|
#ifndef _RESLIST_H_INCLUDED_
|
||||||
#define _RESLIST_H_INCLUDED_
|
#define _RESLIST_H_INCLUDED_
|
||||||
/* @(#$Id: reslist.h,v 1.9 2007-01-19 15:22:50 dockes Exp $ (C) 2005 J.F.Dockes */
|
/* @(#$Id: reslist.h,v 1.10 2007-05-30 12:29:38 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@ -57,6 +57,7 @@ class ResList : public QTEXTBROWSER
|
|||||||
virtual void menuExpand();
|
virtual void menuExpand();
|
||||||
virtual void menuSeeParent();
|
virtual void menuSeeParent();
|
||||||
virtual void previewExposed(int);
|
virtual void previewExposed(int);
|
||||||
|
virtual void append(const QString &text);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void nextPageAvailable(bool);
|
void nextPageAvailable(bool);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user