diff --git a/source/ublexec.cc b/source/ublexec.cc index 6d5c070..1119cf6 100644 --- a/source/ublexec.cc +++ b/source/ublexec.cc @@ -285,6 +285,7 @@ void MainWindow::changed_user() { } void MainWindow::delete_cmd(const int &x, const int &y) { + if (x == 0) {} if (y > 1) { chbTerminal->set_active(false); chbAnotherUser->set_active(false); @@ -294,6 +295,7 @@ void MainWindow::delete_cmd(const int &x, const int &y) { } bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event) { + if (event) {} if (user_cmd.length() != 0) { } else if (name_app.length() != 0) { @@ -311,7 +313,7 @@ bool MainWindow::focus_in_txt_cmd(GdkEventFocus* event) { void MainWindow::synopsis_show() { string cmd = "xdg-open " + string(gettext("https://wiki.ublinux.com/ru/Программное_обеспечение/Программы_и_утилиты/Все/")) + app_name + " &"; - system(cmd.c_str()); + index_error = system(cmd.c_str()); } void MainWindow::icon_clear() { @@ -377,7 +379,7 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtrset_text(app_name_exec); name_app = txtCmd->get_text(); - int len_name_app = name_app.length(); + size_t len_name_app = name_app.length(); string array_del[] = {"%f", "%F", "%d", "%D", "%n", "%N", "%U"}; for (auto &del_sim: array_del) { str_remove(name_app, del_sim); @@ -605,7 +607,7 @@ string MainWindow::start_cmd(string user_cmd) { string user_cmd_X = "xhost +SI:localuser:"; user_cmd_X += cmbUser->get_active_text(); user_cmd_X += " > /dev/null 2>&1"; - system(user_cmd_X.c_str()); + index_error = system(user_cmd_X.c_str()); } if ((cbxExecuteEpriority->get_active()) && (chbAnotherUser->get_active() == false)) { str_nice_cmd = "nice -n " + to_string(spinPriority->get_value_as_int()) + " "; @@ -665,7 +667,7 @@ string MainWindow::start_cmd(string user_cmd) { void MainWindow::call_app(string &cmd) { if (cmd.length() != 0) { - std::thread t([&](string cmd) {system(cmd.c_str());}, cmd); + std::thread t([&](string cmd) {int index = system(cmd.c_str()); if (index){}}, cmd); t.detach(); } } @@ -718,6 +720,7 @@ string MainWindow::call(string cmd) { } bool MainWindow::focus_out_txt_cmd(GdkEventFocus* event) { + if (event) {} if (cmd_old != txtCmd->get_text()) { user_cmd = txtCmd->get_text(); } diff --git a/source/ublexec.h b/source/ublexec.h index f236971..56b8c91 100644 --- a/source/ublexec.h +++ b/source/ublexec.h @@ -211,6 +211,7 @@ public: string execute_cmd = ""; string path_file = ""; string name_app = ""; + int index_error = 0; bool flag_pkexec = false; bool flag_su = false; bool flag_sudo = false;