add user list
This commit is contained in:
25
controller_user_info.cpp
Normal file
25
controller_user_info.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "controller_user_info.h"
|
||||
|
||||
|
||||
controller_user_info::controller_user_info(view_user_info *view, session_manager *sesion)
|
||||
{
|
||||
this->view=view;
|
||||
this->sesion=sesion;
|
||||
this->load_info();
|
||||
}
|
||||
|
||||
void controller_user_info::load_info(){
|
||||
std::list<std::string> list=this->sesion->get_users_info();
|
||||
for(std::string data:list){
|
||||
Gtk::TreeModel::Row row = *(this->view->m_refTreeModel->append());
|
||||
row[this->view->m_Columns.r_user]=get_first(data);
|
||||
row[this->view->m_Columns.r_admin]=(get_first(data)=="t");
|
||||
}
|
||||
}
|
||||
|
||||
std::string controller_user_info::get_first(std::string &info){
|
||||
int pos = info.find(":");
|
||||
std::string ret = info.substr(0, pos);
|
||||
info=info.substr(pos+1, info.size()+1);
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user