Show
Ignore:
Timestamp:
06/17/08 02:19:46 (6 months ago)
Author:
flynd
Message:

Use new group handling when pressing delete key to remove a user from a group.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/core/mainwin.cpp

    r6283 r6319  
    502502void MainWindow::removeUserFromGroup() 
    503503{ 
     504  GroupType gtype = Config::ContactList::instance()->groupType(); 
     505  unsigned short gid = Config::ContactList::instance()->groupId(); 
     506 
     507  // Removing "All users" is the same as removing user from the list 
     508  if (gtype == GROUPS_SYSTEM && gid == 0) 
     509  { 
     510    removeUserFromList(); 
     511    return; 
     512  } 
     513 
     514  // Removing user from "Other users" is not allowed 
     515  if (gtype == GROUPS_USER && gid == 0) 
     516    return; 
     517 
     518  // Get currently selected user 
    504519  QString id; 
    505520  unsigned long ppid = 0; 
    506521  myUserView->MainWindowSelectedItemUser(id, ppid); 
    507522 
    508   LicqGui::instance()->removeUserFromGroup( 
    509       Config::ContactList::instance()->groupType(), 
    510       Config::ContactList::instance()->groupId(), 
    511       id, ppid, this); 
     523  gUserManager.SetUserInGroup(id.toLatin1(), ppid, GROUPS_USER, gid, false); 
    512524} 
    513525 
     
    728740void MainWindow::setCurrentGroup(int groupId) 
    729741{ 
     742//TODO: This is bugged 
    730743  GroupType groupType = GROUPS_USER; 
    731744  unsigned short nNumGroups = gUserManager.NumGroups();