Changeset cf8eab0


Ignore:
Timestamp:
02/11/14 10:53:22 (6 months ago)
Author:
Kris Moore <kris@…>
Branches:
releng/10.0
Children:
3432a95
Parents:
b178bf3
git-author:
Ken Moore <ken@…> (02/11/14 07:52:14)
git-committer:
Kris Moore <kris@…> (02/11/14 10:53:22)
Message:

Make sure that we use UTF-8 encoding when reading the system usernames/information file in PCDM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/pcdm-backend.cpp

    rac342ef rcf8eab0  
    469469  usernameList.clear(); displaynameList.clear(); homedirList.clear(); 
    470470  //Get all the users from the file "/etc/passwd" 
    471   QStringList uList = pcbsd::Utils::runShellCommand("cat /etc/passwd"); 
    472  
     471  QStringList uList;// = pcbsd::Utils::runShellCommand("cat /etc/passwd"); 
     472  QFile PWF("/etc/passwd"); 
     473  if( PWF.open(QIODevice::ReadOnly | QIODevice::Text) ){ 
     474    QTextStream in(&PWF); 
     475      in.setCodec( "UTF-8" ); 
     476    while( !in.atEnd() ){ 
     477      uList << QString( in.readLine() ); 
     478    } 
     479  } 
    473480  //Remove all users that have: 
    474481  for(int i=0; i<uList.length(); i++){ 
Note: See TracChangeset for help on using the changeset viewer.