From a138d4b770126ef2462fe6bc3b283f5d16ccd8ef Mon Sep 17 00:00:00 2001 From: Mirko Lindner Date: Wed, 28 Oct 2009 14:52:09 +0100 Subject: [PATCH] remove temp file Signed-off-by: Mirko Lindner --- src/vido.cc~ | 159 --------------------------------------------------- 1 file changed, 159 deletions(-) delete mode 100644 src/vido.cc~ diff --git a/src/vido.cc~ b/src/vido.cc~ deleted file mode 100644 index e2d759c..0000000 --- a/src/vido.cc~ +++ /dev/null @@ -1,159 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Mirko Lindner,,, * - * vegyraupe@mira * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#include -#include -#include -#include -#include -#include "main_window.hh" -#include -#include - -extern "C" { - #include "gtkhtml/gtkhtml.h" - } - -using namespace Gtk; -Glib::RefPtr buffer; -unsigned int seed = static_cast(time(0)); -zim::Search::Results result; -std::string res; -std::string content; -std::string file; -zim::File f; - -Widget *html; -GtkWidget *html_wg; - -void set_article(std::string txt) -{ - content = txt; -} - -void show_random(){ - - while(true){ - zim::File m(file); - zim::size_type idx = static_cast(static_cast(m.getCountArticles()) * rand_r(&seed) / RAND_MAX); - - zim::Article article = m.getArticle(idx); - - std::string res = article.getPage(false, 10); - std::cout<<"Diese Zeile läuft so lange bis "< 0){ - set_article(res); - break; - } - } - std::cout<<"nach while "< 0){ - zim::Article article = m.getArticle(result[0].getArticle().getIndex()); - - std::string content = article.getPage(false, 10); - - gtk_html_flush(GTK_HTML(html_wg)); - gtk_html_load_from_string(GTK_HTML(html_wg), content.c_str(), -1); - } - -// std::cout<<"url"<<<<"."; -} - -bool on_link_clicked(GtkHTML *html, const gchar *url) -{ - - set_html(url); -// set_berlin(); - return true; -} - -int main(int argc, char **argv) -{ - - file = argv[1]; - - Main kit(argc, argv); - - main_window window; - window.set_title("Wiki Viewer"); - window.set_border_width(0); - window.set_default_size(320, 240); -// window.set_resizable(0); - - html_wg = gtk_html_new(); - - html = Glib::wrap(html_wg); - g_signal_connect( G_OBJECT( html_wg ), "link_clicked", G_CALLBACK( on_link_clicked ), NULL ); - - ScrolledWindow scrolled_window; - - scrolled_window.add(*html); - scrolled_window.set_policy(POLICY_NEVER, POLICY_AUTOMATIC); - - window.add(scrolled_window); - window.show_all(); - - show_random(); -// set_berlin(); - Main::run(window); - return 0; - -}