mirror of
git://projects.qi-hardware.com/vido.git
synced 2024-11-01 10:06:15 +02:00
get namespace from url -- not perfect
Signed-off-by: Mirko Lindner <mirko@qi-hardware.com>
This commit is contained in:
parent
642a891998
commit
d82627dc08
23
src/vido.cc
23
src/vido.cc
@ -101,8 +101,24 @@ void set_html(const gchar *url){
|
|||||||
// // replace '+' signs with spaces in url
|
// // replace '+' signs with spaces in url
|
||||||
std::replace(term.begin(), term.end(), '+', ' ');
|
std::replace(term.begin(), term.end(), '+', ' ');
|
||||||
|
|
||||||
// // declare namespace
|
// // find and declare namespace
|
||||||
char *ns = "A";
|
size_t found;
|
||||||
|
size_t found2;
|
||||||
|
char *ns;
|
||||||
|
|
||||||
|
found=term.find("/");
|
||||||
|
if (found!=std::string::npos){
|
||||||
|
if (found != (int) 0){
|
||||||
|
ns = &term[0];
|
||||||
|
}else{
|
||||||
|
term = term.substr(1, strlen(url));
|
||||||
|
ns = &term[0];
|
||||||
|
found2 = term.find("/");
|
||||||
|
term = term.substr(found2 + 1, strlen(url));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
ns = "A";
|
||||||
|
}
|
||||||
|
|
||||||
// // try to retrieve article
|
// // try to retrieve article
|
||||||
try {
|
try {
|
||||||
@ -129,7 +145,8 @@ void set_html(const gchar *url){
|
|||||||
|
|
||||||
// // load new data into gtkhtml widget
|
// // load new data into gtkhtml widget
|
||||||
gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1);
|
gtk_html_load_from_string(GTK_HTML(html_wg), str2.c_str(), -1);
|
||||||
// std::cout<<term<<".\n";
|
std::cout<<"term:"<<term<<".\n";
|
||||||
|
std::cout<<"url:"<<url<<".\n";
|
||||||
}catch(...){
|
}catch(...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user