Date:2009-10-30 13:44:51 (14 years 4 months ago)
Author:Mirko Lindner
Commit:d82627dc081ef0704f11b45b896b35738528e73a
Message:get namespace from url -- not perfect

Signed-off-by: Mirko Lindner <mirko@qi-hardware.com>
Files: src/vido.cc (2 diffs)

Change Details

src/vido.cc
100100
101101// // replace '+' signs with spaces in url
102102    std::replace(term.begin(), term.end(), '+', ' ');
103
104// // declare namespace
105    char *ns = "A";
103
104// // find and declare namespace
105    size_t found;
106    size_t found2;
107    char *ns;
108
109    found=term.find("/");
110    if (found!=std::string::npos){
111        if (found != (int) 0){
112            ns = &term[0];
113        }else{
114            term = term.substr(1, strlen(url));
115            ns = &term[0];
116            found2 = term.find("/");
117            term = term.substr(found2 + 1, strlen(url));
118        }
119    }else{
120        ns = "A";
121    }
106122
107123// // try to retrieve article
108124    try {
...... 
129145
130146// // load new data into gtkhtml widget
131147        gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1);
132// std::cout<<term<<".\n";
148        std::cout<<"term:"<<term<<".\n";
149        std::cout<<"url:"<<url<<".\n";
133150    }catch(...){
134151    }
135152}

Archive Download the corresponding diff file

Branches:
development
master



interactive