Исправлен баг с флагами заупска программа, флаги удаляются

pull/1/head
Igor Belitskiy 3 years ago
parent 1af326c405
commit 7588b84965

@ -28,6 +28,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <pwd.h> #include <pwd.h>
#include <set> #include <set>
#include <regex>
#include "ublexec.h" #include "ublexec.h"
using namespace std; using namespace std;
@ -268,6 +269,18 @@ void MainWindow::tempate_icon_select(Gtk::IconView *icon, Glib::RefPtr<Gtk::List
const Glib::ustring description = row[m_Columns.m_col_description]; const Glib::ustring description = row[m_Columns.m_col_description];
txtCmd->set_text(app_name_exec); txtCmd->set_text(app_name_exec);
name_app = txtCmd->get_text(); name_app = txtCmd->get_text();
int len_name_app = name_app.length();
string array_del[] = {"%f","%F","%d","%D","%n","%N"};
for (auto &del_sim: array_del){
cout << del_sim << endl;
str_remove(name_app, del_sim);
if (name_app.length()!=len_name_app){
txtCmd->set_text(name_app);
break;
}
}
} }
} }
@ -372,7 +385,7 @@ void MainWindow::open_list_app(){
else if (str_categor=="Network"){ else if (str_categor=="Network"){
this->tempalte_row(st_app.Name,st_app.Exec, path,list_Internet); this->tempalte_row(st_app.Name,st_app.Exec, path,list_Internet);
} }
else if (str_categor=="Multimedia" || str_categor== "Video" || str_categor== "Player" || str_categor== "AudioVideo"){ else if (str_categor== "AudioVideo"){
this->tempalte_row(st_app.Name,st_app.Exec, path, list_Multimedia); this->tempalte_row(st_app.Name,st_app.Exec, path, list_Multimedia);
} }
else if (str_categor=="Settings"){ else if (str_categor=="Settings"){
@ -580,6 +593,15 @@ vector<std::string> MainWindow::split(const std::string &s, char delim) {
return elems; return elems;
} }
string MainWindow::str_remove(std::string& source, const std::string& to_remove){
auto begin = source.find(to_remove);
if (begin!=std::string::npos){
int len_to_remove = to_remove.length();
source.erase(begin, begin+len_to_remove);
}
return source;
}
void MainWindow::pars_apps(){ void MainWindow::pars_apps(){
if (list_app.size()!=0){return;} if (list_app.size()!=0){return;}
namespace fs = std::filesystem; namespace fs = std::filesystem;

@ -102,6 +102,7 @@ public:
void select_Development(); void select_Development();
void select_System(); void select_System();
void icon_clear(); void icon_clear();
string str_remove(std::string& source, const std::string& to_remove);
vector<std::string> split(const std::string &s, char delim); vector<std::string> split(const std::string &s, char delim);
public: public:

Loading…
Cancel
Save