";
- if (it->first > 0) {
- char buf[100];
- sprintf(buf, "P. %d", it->first);
+ if (it->page > 0) {
+ char txt[100];
+ sprintf(txt, "P. %d", it->page);
+ char url[100];
+ sprintf(url, "P%dT%s", it->page, it->term.c_str());
html += "";
- html += buf;
+ html += txt;
html += "";
}
html += " | ";
list lr;
- g_hiliter.plaintorich(it->second, lr, hdata);
+ g_hiliter.plaintorich(it->snippet, lr, hdata);
html.append(QString::fromUtf8(lr.front().c_str()));
html.append(" |
\n");
}
@@ -117,7 +119,12 @@ void SnippetsW::linkWasClicked(const QUrl &url)
if (numpos == string::npos)
return;
int page = atoi(ascurl.c_str() + numpos);
- emit startNativeViewer(m_doc, page);
+ string::size_type termpos = ascurl.find_first_of("T");
+ string term;
+ if (termpos != string::npos)
+ term = ascurl.substr(termpos+1);
+ emit startNativeViewer(m_doc, page,
+ QString::fromUtf8(term.c_str()));
return;
}
}
diff --git a/src/qtgui/snippets_w.h b/src/qtgui/snippets_w.h
index 27f3b571..6b50152b 100644
--- a/src/qtgui/snippets_w.h
+++ b/src/qtgui/snippets_w.h
@@ -16,6 +16,7 @@
*/
#ifndef _SNIPPETS_W_H_INCLUDED_
#define _SNIPPETS_W_H_INCLUDED_
+#include