Changeset 6466

Show
Ignore:
Timestamp:
07/25/08 04:15:48 (3 months ago)
Author:
flynd
Message:

Use const pointer for owner objects that are fetched only for read access.

Location:
trunk/qt4-gui/src
Files:
18 modified

Legend:

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

    r6463 r6466  
    687687  } 
    688688 
    689   ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
     689  const ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
    690690  if (o == NULL) 
    691691    return; 
     
    11651165  FOR_EACH_PROTO_PLUGIN_START(myLicqDaemon) 
    11661166  { 
    1167     ICQOwner* o = gUserManager.FetchOwner((*_ppit)->PPID(), LOCK_R); 
     1167    const ICQOwner* o = gUserManager.FetchOwner((*_ppit)->PPID(), LOCK_R); 
    11681168    if (o == NULL) 
    11691169      continue; 
     
    11911191    FOR_EACH_PROTO_PLUGIN_START(myLicqDaemon) 
    11921192    { 
    1193       ICQOwner* o = gUserManager.FetchOwner((*_ppit)->PPID(), LOCK_R); 
     1193      const ICQOwner* o = gUserManager.FetchOwner((*_ppit)->PPID(), LOCK_R); 
    11941194      if (o == NULL) 
    11951195        continue; 
     
    12731273 
    12741274  // Do system messages first 
    1275   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     1275  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    12761276  unsigned short numMsg = 0; 
    12771277  if (o != NULL) 
     
    14271427        unsigned short popCheck = 99; 
    14281428 
    1429         ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
     1429        const ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
    14301430        if (o != NULL) 
    14311431        { 
     
    16511651    // Fetch current status 
    16521652    unsigned short status = ICQ_STATUS_OFFLINE; 
    1653     ICQOwner* o = gUserManager.FetchOwner(nPPID, LOCK_R); 
     1653    const ICQOwner* o = gUserManager.FetchOwner(nPPID, LOCK_R); 
    16541654    if (o != NULL) 
    16551655    { 
  • trunk/qt4-gui/src/core/licqkimiface.cpp

    r6463 r6466  
    9595QStringList LicqKIMIface::reachableContacts() 
    9696{ 
    97     ICQOwner* owner = gUserManager.FetchOwner(LOCK_R); 
     97    const ICQOwner* owner = gUserManager.FetchOwner(LOCK_R); 
    9898    bool offline = owner->StatusOffline(); 
    9999    gUserManager.DropOwner(); 
  • trunk/qt4-gui/src/core/mainwin.cpp

    r6463 r6466  
    129129 
    130130  myCaption = "Licq"; 
    131   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     131  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    132132  if (o != NULL) 
    133133  { 
     
    615615 
    616616        myCaption = "Licq (|)"; 
    617         ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
     617        const ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
    618618        if (o != NULL) 
    619619        { 
     
    817817  IconManager* iconman = IconManager::instance(); 
    818818 
    819   ICQOwner* o = gUserManager.FetchOwner(nPPID, LOCK_R); 
     819  const ICQOwner* o = gUserManager.FetchOwner(nPPID, LOCK_R); 
    820820  if (o != NULL) 
    821821  { 
     
    908908{ 
    909909  //TODO iterate all owners that support fetching away message 
    910   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     910  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    911911 
    912912  if (o == NULL) 
  • trunk/qt4-gui/src/core/systemmenu.cpp

    r6374 r6466  
    374374void SystemMenu::aboutToShowFollowMeMenu() 
    375375{ 
    376    ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     376   const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    377377   if (o == NULL) 
    378378     return; 
     
    654654void OwnerData::aboutToShowStatusMenu() 
    655655{ 
    656   ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
     656  const ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
    657657  if (o == NULL) 
    658658    return; 
     
    675675void OwnerData::viewInfo() 
    676676{ 
    677   ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
     677  const ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
    678678  if (o == NULL) 
    679679    return; 
     
    686686void OwnerData::viewHistory() 
    687687{ 
    688   ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
     688  const ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
    689689  if (o == NULL) 
    690690    return; 
  • trunk/qt4-gui/src/dialogs/awaymsgdlg.cpp

    r6374 r6466  
    166166  a->setData(999); 
    167167 
    168   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     168  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    169169  if (o == NULL) 
    170170    return; 
  • trunk/qt4-gui/src/dialogs/editcategorydlg.cpp

    r6374 r6466  
    125125void EditCategoryDlg::ok() 
    126126{ 
    127   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     127  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    128128  if (o != NULL) 
    129129  { 
  • trunk/qt4-gui/src/dialogs/historydlg.cpp

    r6463 r6466  
    236236  gUserManager.DropUser(u); 
    237237 
    238   ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
     238  const ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
    239239  if (o != NULL) 
    240240  { 
  • trunk/qt4-gui/src/dialogs/ownereditdlg.cpp

    r6374 r6466  
    9191  if (ppid != 0) 
    9292  { 
    93     ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
     93    const ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
    9494    if (o != NULL) 
    9595    { 
  • trunk/qt4-gui/src/dialogs/phonedlg.cpp

    r6374 r6466  
    5353  setModal(true); 
    5454 
    55   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     55  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    5656  if (o == NULL) 
    5757  { 
     
    236236  } 
    237237 
    238   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     238  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    239239  if (o == NULL) 
    240240  { 
  • trunk/qt4-gui/src/dialogs/randomchatdlg.cpp

    r6374 r6466  
    181181  myGroupsList->addItem(tr("Seeking Men")); 
    182182 
    183   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    184   if (o == 0) 
     183  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     184  if (o == NULL) 
    185185  { 
    186186    close(); 
  • trunk/qt4-gui/src/dialogs/securitydlg.cpp

    r6374 r6466  
    5151  setWindowTitle(title); 
    5252 
    53   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     53  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    5454  if (o == NULL) 
    5555  { 
     
    9999void SecurityDlg::ok() 
    100100{ 
    101   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     101  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    102102 
    103103  if (o == NULL) 
  • trunk/qt4-gui/src/dialogs/userinfodlg.cpp

    r6463 r6466  
    19351935#endif 
    19361936 
    1937   ICQOwner* o = gUserManager.FetchOwner(m_nPPID, LOCK_R); 
     1937  const ICQOwner* o = gUserManager.FetchOwner(m_nPPID, LOCK_R); 
    19381938  if(o == NULL)  return; 
    19391939  unsigned short status = o->Status(); 
     
    20292029      currentTab != PictureInfo) 
    20302030  { 
    2031     ICQOwner* o = gUserManager.FetchOwner(m_nPPID, LOCK_R); 
     2031    const ICQOwner* o = gUserManager.FetchOwner(m_nPPID, LOCK_R); 
    20322032    if(o == NULL)  return; 
    20332033    unsigned short status = o->Status(); 
  • trunk/qt4-gui/src/dialogs/userselectdlg.cpp

    r6374 r6466  
    8989 
    9090  // For now, just have one owner 
    91   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     91  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    9292  if (o == 0) 
    9393  { 
  • trunk/qt4-gui/src/dockicons/dockicon.cpp

    r6374 r6466  
    7272{ 
    7373  // First check for ICQ/AIM owner presence 
    74   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     74  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    7575 
    7676  // Take any existent one otherwise 
    7777  if (o == NULL && gUserManager.NumOwners() != 0) 
    7878  { 
    79     OwnerList* ol = gUserManager.LockOwnerList(LOCK_R); 
     79    const OwnerList* ol = gUserManager.LockOwnerList(LOCK_R); 
    8080    o = ol->front(); 
    8181    o->Lock(LOCK_R); 
  • trunk/qt4-gui/src/settings/events.cpp

    r6374 r6466  
    327327  oem->Unlock(); 
    328328  //TODO make general for all plugins 
    329   ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     329  const ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    330330  if (o != NULL) 
    331331  { 
  • trunk/qt4-gui/src/userevents/usersendcommon.cpp

    r6463 r6466  
    251251        QTextCodec* myCodec = UserCodec::codecForICQUser(u); 
    252252        QString contactName = QString::fromUtf8(u->GetAlias()); 
    253         ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
     253        const ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
    254254        QString ownerName; 
    255255        if (o) 
  • trunk/qt4-gui/src/widgets/historyview.cpp

    r6463 r6466  
    417417  if (event->Direction() != D_RECEIVER) 
    418418  { 
    419     ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
     419    const ICQOwner* o = gUserManager.FetchOwner(myPpid, LOCK_R); 
    420420    if (o != NULL) 
    421421    { 
  • trunk/qt4-gui/src/widgets/protocombobox.cpp

    r6374 r6466  
    4444  QString id; 
    4545  unsigned long ppid; 
    46   ICQOwner* o; 
    4746 
    4847  FOR_EACH_PROTO_PLUGIN_START(gLicqDaemon) 
    4948  { 
    5049    ppid = (*_ppit)->PPID(); 
    51     o = gUserManager.FetchOwner(ppid, LOCK_R); 
     50    const ICQOwner* o = gUserManager.FetchOwner(ppid, LOCK_R); 
    5251    if (o == NULL) 
    5352      id = "0";