From 216ad6ac8d87dc4ea0035be8c09c3532cec10743 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Wed, 22 Mar 2023 11:32:34 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ublexec.cc | 11 +++++++---- source/ublexec.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) 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;