Show
Ignore:
Timestamp:
07/01/08 17:03:38 (5 months ago)
Author:
flynd
Message:

Use the new DropOwner? function to properly specify which owner to unlock.

Files:
1 modified

Legend:

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

    r6368 r6381  
    620620  m_nRealHeight = hVal; 
    621621 
    622   ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 
     622  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    623623  if (o != NULL) 
    624624  { 
    625625    m_szCaption = tr("Licq (%1)").arg(QString::fromUtf8(o->GetAlias())); 
    626     gUserManager.DropOwner(); 
     626    gUserManager.DropOwner(o); 
    627627  } 
    628628  else 
     
    791791   { 
    792792     // Do we need to get a password 
    793      o = gUserManager.FetchOwner(LOCK_R); 
     793     o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    794794     if (o != NULL) 
    795795     { 
    796796      if(o->Password()[0] == '\0') 
    797797      { 
    798         gUserManager.DropOwner(); 
     798        gUserManager.DropOwner(o); 
    799799        (void) new UserSelectDlg(licqDaemon); 
    800800      } 
    801801      else 
    802         gUserManager.DropOwner(); 
     802        gUserManager.DropOwner(o); 
    803803     } 
    804804   } 
     
    808808   { 
    809809    mnuPFM->setItemChecked(o->PhoneFollowMeStatus(), true); 
    810     gUserManager.DropOwner(); 
     810    gUserManager.DropOwner(o); 
    811811   } 
    812812 
     
    14051405          } 
    14061406          else 
    1407           {   
     1407          { 
    14081408            s = o->Status(); 
    1409             gUserManager.DropOwner(nPPID); 
     1409            gUserManager.DropOwner(o); 
    14101410          } 
    14111411          if (s == ICQ_STATUS_ONLINE || s == ICQ_STATUS_FREEFORCHAT) 
     
    14641464        { 
    14651465          m_szCaption = tr("Licq (%1)").arg(QString::fromUtf8(o->GetAlias())); 
    1466           gUserManager.DropOwner(nPPID); 
     1466          gUserManager.DropOwner(o); 
    14671467        } 
    14681468        else 
     
    20932093    else 
    20942094    { 
    2095       gUserManager.DropOwner(nPPID); 
    2096        
     2095      gUserManager.DropOwner(o); 
     2096 
    20972097      // Show multiple icons for each protocol 
    20982098      lblStatus->clearPrependPixmap(); 
    20992099      lblStatus->setText(""); 
    21002100      lblStatus->clearPixmaps(); 
    2101        
     2101 
    21022102      vector<unsigned long>::iterator it; 
    21032103      for (it = m_lnProtMenu.begin(); it != m_lnProtMenu.end(); it++) 
     
    21082108          lblStatus->addPixmap(CMainWindow::iconForStatus(o->StatusFull(), 
    21092109            o->IdString(), *it)); 
    2110           gUserManager.DropOwner(*it); 
     2110          gUserManager.DropOwner(o); 
    21112111        } 
    21122112      } 
     
    21332133      setIcon(CMainWindow::iconForStatus(o->StatusFull())); 
    21342134#endif   // USE_KDE 
    2135    
    2136       gUserManager.DropOwner(nPPID); 
     2135 
     2136      gUserManager.DropOwner(o); 
    21372137    } 
    21382138   } 
     
    21512151         lblStatus->addPixmap(CMainWindow::iconForStatus(o->StatusFull(), 
    21522152           o->IdString(), *it)); 
    2153          gUserManager.DropOwner(*it); 
     2153         gUserManager.DropOwner(o); 
    21542154       } 
    21552155     } 
    2156       
     2156 
    21572157     lblStatus->update(); 
    21582158   } 
     
    21682168{ 
    21692169  //TODO iterate all owners that support fetching away message 
    2170   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     2170  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    21712171  if (o == NULL) 
    21722172    return; 
    21732173 
    21742174  unsigned short status = o->Status(); 
    2175   gUserManager.DropOwner(); 
     2175  gUserManager.DropOwner(o); 
    21762176  showAwayMsgDlg(status); 
    21772177} 
     
    22962296    ICQOwner *o = gUserManager.FetchOwner(nPPID, LOCK_R); 
    22972297    if (o == NULL) continue; 
    2298                
     2298 
    22992299    if (id == ICQ_STATUS_OFFLINE) 
    23002300    { 
    2301       gUserManager.DropOwner(nPPID); 
     2301      gUserManager.DropOwner(o); 
    23022302      licqDaemon->ProtoLogoff(nPPID); 
    23032303      continue; 
     
    23132313      if (o->StatusOffline()) 
    23142314      { 
    2315         gUserManager.DropOwner(nPPID); 
     2315        gUserManager.DropOwner(o); 
    23162316        continue; 
    23172317      } 
     
    23422342    // call the right function 
    23432343    bool b = o->StatusOffline(); 
    2344     gUserManager.DropOwner(nPPID); 
     2344    gUserManager.DropOwner(o); 
    23452345    if (b) 
    23462346      licqDaemon->ProtoLogon(nPPID, newStatus); 
     
    24492449      szId = strdup(o->IdString()); 
    24502450      unsigned short nNumMsg = o->NewMessages(); 
    2451       gUserManager.DropOwner((*_ppit)->PPID()); 
    2452        
     2451      gUserManager.DropOwner(o); 
     2452 
    24532453      if (nNumMsg > 0) 
    24542454        callFunction(index, szId, (*_ppit)->PPID()); 
     
    24692469        if (o == 0) continue; 
    24702470        szId = strdup(o->IdString()); 
    2471         gUserManager.DropOwner((*_ppit)->PPID()); 
     2471        gUserManager.DropOwner(o); 
    24722472        callInfoTab(index, szId, (*_ppit)->PPID()); 
    24732473        free(szId); 
     
    30023002      if (o == 0) continue; // just in case 
    30033003      unsigned short nNumMsg = o->NewMessages(); 
    3004       gUserManager.DropOwner((*_ppit)->PPID()); 
     3004      gUserManager.DropOwner(o); 
    30053005      if (nNumMsg > 0) 
    30063006      { 
     
    35863586void CMainWindow::aboutBox() 
    35873587{ 
    3588   ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 
    3589    
     3588  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
     3589 
    35903590  // We might have no owner 
    35913591  QString m_Alias = (o == 0) ? QString(tr("(Error! No owner set)")) : QString::fromUtf8(o->GetAlias()); 
    35923592  QString id = (o == 0) ? "" : o->IdString(); 
    3593    
     3593 
    35943594  QString about(tr("Licq version %1%8.\n" 
    35953595                   "Qt GUI plugin version %2.\n" 
     
    36113611#endif 
    36123612                   .arg(__DATE__).arg(CICQDaemon::CryptoEnabled() ? "/SSL" : "")); 
    3613   gUserManager.DropOwner(); 
     3613  gUserManager.DropOwner(o); 
    36143614  InformUser(this, about); 
    36153615} 
     
    47974797 
    47984798  // Do system messages first 
    4799   ICQOwner *o = gUserManager.FetchOwner(LOCK_R); 
     4799  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    48004800  unsigned short nNumMsg = 0; 
    48014801  if (o) 
    48024802  { 
    48034803    nNumMsg = o->NewMessages(); 
    4804     gUserManager.DropOwner(); 
    4805   } 
    4806    
     4804    gUserManager.DropOwner(o); 
     4805  } 
     4806 
    48074807  if (nNumMsg > 0) 
    48084808  {