[PC-BSD Commits] r8242 - pcbsd/current/src-qt4/pc-usermanager

svn at pcbsd.org svn at pcbsd.org
Tue Dec 21 06:53:16 PST 2010


Author: kris
Date: 2010-12-21 06:53:16 -0800 (Tue, 21 Dec 2010)
New Revision: 8242

Modified:
   pcbsd/current/src-qt4/pc-usermanager/maindlgcode.cpp
   pcbsd/current/src-qt4/pc-usermanager/maindlgcode.h
Log:

Fixed crash in user-manager when adding users from stray pointer



Modified: pcbsd/current/src-qt4/pc-usermanager/maindlgcode.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-usermanager/maindlgcode.cpp	2010-12-21 14:21:18 UTC (rev 8241)
+++ pcbsd/current/src-qt4/pc-usermanager/maindlgcode.cpp	2010-12-21 14:53:16 UTC (rev 8242)
@@ -39,8 +39,6 @@
     setEnabled(false);
     
     this->back = back;
-    userListPointer = 0;
-    groupListPointer = 0;
     availablePointer = 0;
     memberPointer = 0;
     white = QColor(255, 255, 255);
@@ -77,17 +75,11 @@
     qDebug() << "MainDlg: Updating user list";
     disconnect(userList, SIGNAL(currentTextChanged( const QString & )), 0, 0);
     
-    userListPointer = userList->currentItem();
-    if (userListPointer < 0) { userListPointer = 0; }
     QStringList users = back->getAllUsers(-1, -1);
     users.sort();
     userList->clear();
     userList->addItems(users);
-    if ( userListPointer == 0)
-    	userList->setCurrentRow(0);
-    else
-    	userList->setCurrentRow(0);
-    	//userList->setCurrentItem(userListPointer);
+    userList->setCurrentRow(0);
     
     getUserDetails(userList->currentItem()->text());
     
@@ -110,24 +102,20 @@
 void mainDlgCode::updateGroupList()
 {
     qDebug() << "MainDlg: Updating group list";
-    //disconnect(groupList, SIGNAL(currentTextChanged( const QString & )), 0, 0);
+    disconnect(groupList, SIGNAL(currentTextChanged( const QString & )), 0, 0);
 
-    groupListPointer = groupList->currentItem();
-    if (groupListPointer < 0) { groupListPointer = 0; }
     QStringList groups = back->getAllGroups(-1, -1);
     groups.sort();
     groupBox->clear();
     groupBox->addItems(groups);
     groupList->clear();
     groupList->addItems(groups);
-    if ( groupListPointer == 0 )
-    	groupList->setCurrentRow(0);
-    else
-    	groupList->setCurrentItem(groupListPointer);
+    groupList->setCurrentRow(0);
 
     getGroupDetails(groupList->currentItem()->text());
 
-    //connect(groupList, SIGNAL(currentTextChanged( const QString & )), this, SLOT(getGroupDetails( const QString& )));
+    qDebug() << "MainDlg: Done with updateGroupList()";
+    connect(groupList, SIGNAL(currentTextChanged( const QString & )), this, SLOT(getGroupDetails( const QString& )));
 }
 
 void mainDlgCode::enableEdits(bool enable)

Modified: pcbsd/current/src-qt4/pc-usermanager/maindlgcode.h
===================================================================
--- pcbsd/current/src-qt4/pc-usermanager/maindlgcode.h	2010-12-21 14:21:18 UTC (rev 8241)
+++ pcbsd/current/src-qt4/pc-usermanager/maindlgcode.h	2010-12-21 14:53:16 UTC (rev 8242)
@@ -68,8 +68,6 @@
     UserManagerBackend *back;
     QStringList *users;
     AddDlgCode *addui;
-    QListWidgetItem *userListPointer;
-    QListWidgetItem *groupListPointer;
     QListWidgetItem *availablePointer;
     QListWidgetItem *memberPointer;
     ChangePassCode *changePassUi;



More information about the Commits mailing list