Changeset 5994 for trunk/qt-gui

Show
Ignore:
Timestamp:
01/07/08 22:47:27 (11 months ago)
Author:
eugene
Message:

Candidate fix for #1611.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt-gui/src/searchuserdlg.cpp

    r4716 r5994  
    534534  SearchItem* current = static_cast<SearchItem*>(foundView->firstChild()); 
    535535 
    536   while(current) { 
    537     if(current->isSelected()) { 
    538       ICQUser* user = gUserManager.FetchUser(current->uin(), LOCK_N); 
    539  
    540       if(user) 
     536  while (current) 
     537  { 
     538    if (current->isSelected()) 
     539    { 
     540      ICQUser* user = gUserManager.FetchUser(current->uin(), LOCK_R); 
     541 
     542      if (user) 
     543      { 
     544        bool tempUser = user->NotInList(); 
    541545        gUserManager.DropUser(user); 
    542       else { 
    543         server->AddUserToList(current->uin()); 
    544         if (qcbAlertUser->isChecked()) // alert the user they were added 
    545             server->icqAlertUser(current->uin()); 
     546        if (tempUser) 
     547          gUserManager.RemoveUser(current->uin()); 
    546548      } 
    547 //      current->setSelected(false); 
     549 
     550      if (server->AddUserToList(current->uin()) && 
     551          qcbAlertUser->isChecked()) // alert the user they were added 
     552        server->icqAlertUser(current->uin()); 
    548553    } 
    549554    current = static_cast<SearchItem*>(current->nextSibling()); 
    550555  } 
     556 
    551557  foundView->triggerUpdate(); 
    552558  selectionChanged();