mirror of
git://projects.qi-hardware.com/vido.git
synced 2024-12-22 09:23:19 +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
@ -100,9 +100,25 @@ void set_html(const gchar *url){
|
||||
|
||||
// // replace '+' signs with spaces in url
|
||||
std::replace(term.begin(), term.end(), '+', ' ');
|
||||
|
||||
// // find and declare namespace
|
||||
size_t found;
|
||||
size_t found2;
|
||||
char *ns;
|
||||
|
||||
// // declare namespace
|
||||
char *ns = "A";
|
||||
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 {
|
||||
@ -129,7 +145,8 @@ void set_html(const gchar *url){
|
||||
|
||||
// // load new data into gtkhtml widget
|
||||
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(...){
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user