[PC-BSD Commits] r12247 - pcbsd/current/src-qt4/pc-softwaremanager

svn at pcbsd.org svn at pcbsd.org
Tue Aug 23 16:29:16 PDT 2011


Author: kris
Date: 2011-08-23 16:29:16 -0700 (Tue, 23 Aug 2011)
New Revision: 12247

Modified:
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
Log:

Fixed a few syntax errors in last commit



Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2011-08-23 23:25:49 UTC (rev 12246)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-main.cpp	2011-08-23 23:29:16 UTC (rev 12247)
@@ -122,7 +122,8 @@
 void PBM::checkGroupOperator()
 {
    QString loginName = getlogin();
-   if ( loginName() == "root" )
+   QStringList gNames;
+   if ( loginName == "root" )
      return;
 
    QString tmp;
@@ -133,14 +134,14 @@
    while ( !iFile.atEnd() ) {
      tmp = iFile.readLine().simplified();
      if ( tmp.indexOf("operator") == 0 ) {
-	QStringList gNames = tmp.section(":", 3, 3).split(",");
+	gNames = tmp.section(":", 3, 3).split(",");
 	break;
      }
    }
    iFile.close();
         
    for ( int i = 0; i < gNames.size(); ++i )
-      if ( gNames.at(i).indexOf() == loginName )
+      if ( gNames.at(i).indexOf(loginName) == 0 )
 	    return;
 
    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.") );



More information about the Commits mailing list