1
0
mirror of git://projects.qi-hardware.com/vido.git synced 2024-12-22 19:18:38 +02:00

limit output to one article (fix to problem in prior commit)

Signed-off-by: Mirko Lindner <mirko@qi-hardware.com>
This commit is contained in:
Mirko Lindner 2009-10-30 13:23:17 +01:00
parent 6575416e60
commit 642a891998

View File

@ -102,7 +102,7 @@ void set_html(const gchar *url){
std::replace(term.begin(), term.end(), '+', ' '); std::replace(term.begin(), term.end(), '+', ' ');
// // declare namespace // // declare namespace
char* ns = "A"; char *ns = "A";
// // try to retrieve article // // try to retrieve article
try { try {
@ -118,12 +118,18 @@ void set_html(const gchar *url){
// // get content html // // get content html
content = article.getData().data(); 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 // // emtpy gtkhtml widget
gtk_html_flush(GTK_HTML(html_wg)); gtk_html_flush(GTK_HTML(html_wg));
// // load new data into gtkhtml widget // // 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<<term<<".\n";
}catch(...){ }catch(...){
} }
} }
@ -163,7 +169,7 @@ void set_berlin(const gchar *url){
}catch(...){ }catch(...){
} }
// std::cout<<content<<".\n"; std::cout<<url<<".\n";
} }
void articles2file(){ void articles2file(){
@ -224,7 +230,7 @@ int main(int argc, char **argv)
window.show_all(); window.show_all();
show_random(); show_random();
// articles2file();
// set_berlin(); // set_berlin();
Main::run(window); Main::run(window);
return 0; return 0;