Ignore:
Timestamp:
May 17, 2013 3:34:20 PM (11 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1
Children:
850f9fa
Parents:
78fa8b2
Message:

Fix a couple display quirks with AppCafe2 and EasyPBI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/EasyPBI/mainGUI.cpp

    r47239e7 rda99d41  
    123123} 
    124124 
     125void PBM::checkGroupOperator() 
     126{ 
     127   QString loginName = getlogin(); 
     128   QStringList gNames; 
     129   if ( loginName == "root" ) 
     130     return; 
     131 
     132   QString tmp; 
     133   QFile iFile("/etc/group"); 
     134   if ( ! iFile.open(QIODevice::ReadOnly | QIODevice::Text)) 
     135     return; 
     136                 
     137   while ( !iFile.atEnd() ) { 
     138     tmp = iFile.readLine().simplified(); 
     139     if ( tmp.indexOf("operator") == 0 ) { 
     140        gNames = tmp.section(":", 3, 3).split(","); 
     141        break; 
     142     } 
     143   } 
     144   iFile.close(); 
     145         
     146   for ( int i = 0; i < gNames.size(); ++i ) 
     147      if ( gNames.at(i).indexOf(loginName) == 0 ) 
     148            return; 
     149 
     150   QMessageBox::information( this, tr("Error!"), tr("Installing applications has been disabled for this user. Please add the user to the operator group or restart as root.") ); 
     151   close();   
     152} 
     153 
    125154void MainGUI::slotSingleInstance(){ 
    126155  this->showNormal(); 
Note: See TracChangeset for help on using the changeset viewer.