From 642a8919982837fc8cc140a459c49c2a6785a3e8 Mon Sep 17 00:00:00 2001 From: Mirko Lindner Date: Fri, 30 Oct 2009 13:23:17 +0100 Subject: [PATCH] limit output to one article (fix to problem in prior commit) Signed-off-by: Mirko Lindner --- src/vido.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/vido.cc b/src/vido.cc index dd27757..8ae7e3d 100644 --- a/src/vido.cc +++ b/src/vido.cc @@ -102,7 +102,7 @@ void set_html(const gchar *url){ std::replace(term.begin(), term.end(), '+', ' '); // // declare namespace - char* ns = "A"; + char *ns = "A"; // // try to retrieve article try { @@ -117,13 +117,19 @@ void set_html(const gchar *url){ // // get content html content = article.getData().data(); + +// // get article length + int length = article.getArticleSize(); + +// // limit html output to article length + std::string str2 = content.substr (0,length); // // emtpy gtkhtml widget gtk_html_flush(GTK_HTML(html_wg)); // // load new data into gtkhtml widget - gtk_html_load_from_string(GTK_HTML(html_wg), content.c_str(), -1); - + gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1); +// std::cout<