pull/3/head
Igor Belitskiy 2 years ago
parent 8c4d8bbf7b
commit 61a401c9e9

@ -21,7 +21,6 @@ set(SOURCE_FILES
system_cmd_quotas.cc
system_cmd_quotas.h
controler.h
global_var.h
controler.cc
my_device.h
my_device.cc

@ -1,3 +0,0 @@
#include "project_lib.h"
#include "my_type.h"

@ -1,6 +1,5 @@
#include "project_lib.h"
#include "ubl-settings-diskquota.h"
#include "global_var.h"
class CmdArgParser : public Glib::OptionGroup {
public:

@ -45,6 +45,8 @@ struct status_quotas {
bool project;
bool status;
};
typedef struct users_grups USER_GRUPS;
typedef map <string, string> map_str_str;
typedef map <string, string>* map_s_s_ptr;

@ -158,4 +158,31 @@ bool Quotas_sys::off_quota_system(string partition, string quota_hw, string quot
}
void Quotas_sys::pars_data(string cmd) {
string start_pars = "------\n";
string response = obj_process_call.call_all_sections(cmd);
size_t index_start = response.find(start_pars);
string line_pars = "";
int index = 0;
int old_index = index;
if (index_start!=string::npos) {
response = response.substr(index_start+start_pars.length(), response.length());
vector<int> vec_index_sep = Utils::find_all(response, "\n");
cout << response.substr(0, vec_index_sep[0]) << endl;
for (size_t i = 0; i < vec_index_sep.size(); i++) {
old_index = index;
index = vec_index_sep[i];
if (index-1 == old_index) {
break;
}
line_pars = line_pars.substr(old_index, index);
part_quotas_line(line_pars);
}
}
}
struct status_quotas part_quotas_line(string line) {
vector<int> vec_index_sep = Utils::find_all(response, "\t");
cout << vec_index_sep.size() << endl;
}
}

@ -24,6 +24,9 @@ class Quotas_sys {
struct status_quotas check_on_quotas_system_2_hw(string params);
bool on_quota_hw(string partition, string cmd_hw, string cmd_sw);
bool on_quota_sw(string partition, int mode);
void pars_data(string cmd);
protected:
struct status_quotas part_quotas_line(string line);
};
}
#endif

@ -59,6 +59,7 @@ void MainWindow::settings() {
this->load_system_cfg();
this->load_global_cfg();
this->event();
obj_quotas_sys.pars_data("repquota -pu /mnt/ext4");
}
else {
boxFuncs->set_sensitive(false);

@ -8,7 +8,6 @@
#include "my_type.h"
#include "my_device.h"
#include "controler.h"
#include "global_var.h"
using namespace std;

Loading…
Cancel
Save