Show
Ignore:
Timestamp:
07/24/08 04:08:58 (4 months ago)
Author:
flynd
Message:

Use a const pointer for user objects that are only fetched for read access. Fixed some places where we changed the user even though we just had a read lock.

Location:
trunk/qt4-gui/src/core
Files:
4 modified

Legend:

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

    r6430 r6463  
    725725    parent = myMainWindow; 
    726726 
    727   ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     727  const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    728728  if (u == NULL) 
    729729    return true; 
     
    10651065    return; 
    10661066 
    1067   ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     1067  const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    10681068 
    10691069  if (u == NULL) 
     
    12211221    if (Config::Chat::instance()->msgChatView()) 
    12221222    { 
    1223       ICQUser* u = NULL; 
     1223      const ICQUser* u = NULL; 
    12241224      if (ppid == 0) 
    12251225      { 
     
    13111311  if (id.isEmpty() || ppid == 0) 
    13121312    return; 
    1313   ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     1313  const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    13141314  if (u == NULL) 
    13151315    return; 
     
    14031403  unsigned long ppid = sig->PPID(); 
    14041404 
    1405   ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     1405  const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    14061406  if (u == NULL) 
    14071407  { 
     
    14541454        if (Config::Chat::instance()->autoPopup() >= popCheck) 
    14551455        { 
    1456           ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     1456          const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    14571457          if (u != NULL) 
    14581458          { 
     
    15001500    case USER_TYPING: 
    15011501    { 
    1502       ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     1502      const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    15031503      if (u == NULL) 
    15041504        break; 
  • trunk/qt4-gui/src/core/licqkimiface.cpp

    r6365 r6463  
    406406 
    407407    // check if user exists 
    408     ICQUser* pUser = gUserManager.FetchUser(contactId.latin1(), PPID, LOCK_R); 
     408    const ICQUser* pUser = gUserManager.FetchUser(contactId.latin1(), PPID, LOCK_R); 
    409409    if (pUser != 0) 
    410410    { 
     
    489489 
    490490    // check if user already exists 
    491     ICQUser* pUser = gUserManager.FetchUser(contactId.latin1(), PPID, LOCK_R); 
     491    const ICQUser* pUser = gUserManager.FetchUser(contactId.latin1(), PPID, LOCK_R); 
    492492    if (pUser != 0) 
    493493    { 
  • trunk/qt4-gui/src/core/mainwin.cpp

    r6374 r6463  
    633633      } 
    634634 
    635       ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
     635      const ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 
    636636      if (u == NULL) 
    637637      { 
  • trunk/qt4-gui/src/core/usermenu.cpp

    r6454 r6463  
    227227void UserMenu::aboutToShowMenu() 
    228228{ 
    229   ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), myPpid, LOCK_R); 
     229  const ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), myPpid, LOCK_R); 
    230230 
    231231  int status = (u == NULL ? ICQ_STATUS_OFFLINE : u->Status()); 
     
    568568  if (gid == GROUP_IGNORE_LIST && !action->isChecked()) 
    569569  { 
    570     ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), myPpid, LOCK_R); 
     570    const ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), myPpid, LOCK_R); 
    571571    if (u == NULL) 
    572572      return;