|
|
|
@ -436,21 +436,28 @@ void MainWindow::open_browser() {
|
|
|
|
webkit_web_view_load_uri(one, link_doc);
|
|
|
|
webkit_web_view_load_uri(one, link_doc);
|
|
|
|
wndWeb->show_all();
|
|
|
|
wndWeb->show_all();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
this->template_open_browser();
|
|
|
|
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
string cmd = cmd_xdg + string(_(link_doc)) + " &";
|
|
|
|
this->template_open_browser();
|
|
|
|
string buf = "";
|
|
|
|
|
|
|
|
if (geteuid() == 0) {
|
|
|
|
|
|
|
|
string response_user = getlogin();
|
|
|
|
|
|
|
|
int size_s = std::snprintf(nullptr, 0, cmd_execute, response_user.c_str(), cmd.c_str()) + 1;
|
|
|
|
|
|
|
|
auto size = static_cast<size_t>(size_s);
|
|
|
|
|
|
|
|
std::unique_ptr<char[]> buf(new char[ size ]);
|
|
|
|
|
|
|
|
std::snprintf( buf.get(), size, cmd_execute, response_user.c_str(), cmd.c_str() );
|
|
|
|
|
|
|
|
cmd = std::string( buf.get(), buf.get() + size - 1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
obj_process_system.call(cmd, "&");
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::template_open_browser() {
|
|
|
|
|
|
|
|
string cmd = cmd_xdg + string(_(link_doc)) + " &";
|
|
|
|
|
|
|
|
string buf = "";
|
|
|
|
|
|
|
|
if (geteuid() == 0) {
|
|
|
|
|
|
|
|
string response_user = getlogin();
|
|
|
|
|
|
|
|
int size_s = std::snprintf(nullptr, 0, cmd_execute, response_user.c_str(), cmd.c_str()) + 1;
|
|
|
|
|
|
|
|
auto size = static_cast<size_t>(size_s);
|
|
|
|
|
|
|
|
std::unique_ptr<char[]> buf(new char[ size ]);
|
|
|
|
|
|
|
|
std::snprintf( buf.get(), size, cmd_execute, response_user.c_str(), cmd.c_str() );
|
|
|
|
|
|
|
|
cmd = std::string( buf.get(), buf.get() + size - 1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
index_error = system(cmd.c_str());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::load_local_cfg() {
|
|
|
|
void MainWindow::load_local_cfg() {
|
|
|
|
flag_local_global_load = 0;
|
|
|
|
flag_local_global_load = 0;
|
|
|
|
flag_load = false;
|
|
|
|
flag_load = false;
|
|
|
|
|