Changeset 6374 for trunk/qt4-gui/src

Show
Ignore:
Timestamp:
07/01/08 06:31:24 (5 months ago)
Author:
flynd
Message:

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

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

Legend:

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

    r6352 r6374  
    694694    if (o->StatusOffline()) 
    695695    { 
    696       gUserManager.DropOwner(ppid); 
     696      gUserManager.DropOwner(o); 
    697697      return; 
    698698    } 
     
    712712 
    713713  bool b = o->StatusOffline(); 
    714   gUserManager.DropOwner(ppid); 
     714  gUserManager.DropOwner(o); 
    715715  if (b) 
    716716    myLicqDaemon->ProtoLogon(ppid, status); 
     
    11621162    QString id = o->IdString(); 
    11631163    unsigned short nNumMsg = o->NewMessages(); 
    1164     gUserManager.DropOwner((*_ppit)->PPID()); 
     1164    gUserManager.DropOwner(o); 
    11651165 
    11661166    if (nNumMsg > 0) 
     
    11871187        continue; 
    11881188      unsigned short nNumMsg = o->NewMessages(); 
    1189       gUserManager.DropOwner((*_ppit)->PPID()); 
     1189      gUserManager.DropOwner(o); 
    11901190      if (nNumMsg > 0) 
    11911191      { 
     
    12651265 
    12661266  // Do system messages first 
    1267   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     1267  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    12681268  unsigned short numMsg = 0; 
    12691269  if (o != NULL) 
    12701270  { 
    12711271    numMsg = o->NewMessages(); 
    1272     gUserManager.DropOwner(); 
     1272    gUserManager.DropOwner(o); 
    12731273  } 
    12741274 
     
    14471447              break; 
    14481448          } 
    1449           gUserManager.DropOwner(ppid); 
     1449          gUserManager.DropOwner(o); 
    14501450        } 
    14511451 
  • trunk/qt4-gui/src/core/mainwin.cpp

    r6332 r6374  
    129129 
    130130  myCaption = "Licq"; 
    131   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     131  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    132132  if (o != NULL) 
    133133  { 
    134134    myCaption += QString(" (%1)").arg(QString::fromUtf8(o->GetAlias())); 
    135     gUserManager.DropOwner(); 
     135    gUserManager.DropOwner(o); 
    136136  } 
    137137  setWindowTitle(myCaption); 
     
    242242  { 
    243243    // Do we need to get a password 
    244     o = gUserManager.FetchOwner(LOCK_R); 
     244    o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    245245    if (o != NULL) 
    246246    { 
    247247     if (o->Password()[0] == '\0') 
    248248     { 
    249        gUserManager.DropOwner(); 
     249       gUserManager.DropOwner(o); 
    250250       new UserSelectDlg(); 
    251251     } 
    252252     else 
    253        gUserManager.DropOwner(); 
     253       gUserManager.DropOwner(o); 
    254254    } 
    255255  } 
     
    619619        { 
    620620          myCaption.replace("|", QString::fromUtf8(o->GetAlias())); 
    621           gUserManager.DropOwner(ppid); 
     621          gUserManager.DropOwner(o); 
    622622        } 
    623623        else 
     
    851851            o->IdString(), o->PPID())); 
    852852      myStatusField->update(); 
     853      gUserManager.DropOwner(o); 
    853854    } 
    854855    else 
    855856    { 
    856       gUserManager.DropOwner(nPPID); 
     857      gUserManager.DropOwner(o); 
    857858 
    858859      // Show icons for each protocol, w/o text 
     
    868869          continue; 
    869870        myStatusField->addPixmap(iconman->iconForStatus(o->StatusFull(), o->IdString(), ppid)); 
    870         gUserManager.DropOwner(ppid); 
     871        gUserManager.DropOwner(o); 
    871872      } 
    872873      FOR_EACH_PROTO_PLUGIN_END 
    873874 
    874875      myStatusField->update(); 
    875  
    876       o = gUserManager.FetchOwner(nPPID, LOCK_R); 
    877876    } 
    878  
    879     gUserManager.DropOwner(nPPID); 
    880877  } 
    881878  else 
     
    892889        continue; 
    893890      myStatusField->addPixmap(iconman->iconForStatus(o->StatusFull(), o->IdString(), ppid)); 
    894       gUserManager.DropOwner(ppid); 
     891      gUserManager.DropOwner(o); 
    895892    } 
    896893    FOR_EACH_PROTO_PLUGIN_END 
     
    911908{ 
    912909  //TODO iterate all owners that support fetching away message 
    913   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     910  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    914911 
    915912  if (o == NULL) 
     
    917914 
    918915  int status = o->Status(); 
    919   gUserManager.DropOwner(); 
     916  gUserManager.DropOwner(o); 
    920917 
    921918  AwayMsgDlg::showAwayMsgDlg(status); 
  • trunk/qt4-gui/src/core/systemmenu.cpp

    r6352 r6374  
    384384      a->setChecked(true); 
    385385 
    386   gUserManager.DropOwner(); 
     386  gUserManager.DropOwner(o); 
    387387} 
    388388 
     
    670670    myStatusInvisibleAction->setChecked(o->StatusInvisible()); 
    671671 
    672   gUserManager.DropOwner(myPpid); 
     672  gUserManager.DropOwner(o); 
    673673} 
    674674 
     
    680680 
    681681  QString userid = o->IdString(); 
    682   gUserManager.DropOwner(myPpid); 
     682  gUserManager.DropOwner(o); 
    683683  LicqGui::instance()->showInfoDialog(mnuUserGeneral, userid, myPpid); 
    684684} 
     
    691691 
    692692  QString userid = o->IdString(); 
    693   gUserManager.DropOwner(myPpid); 
     693  gUserManager.DropOwner(o); 
    694694  new HistoryDlg(userid, myPpid); 
    695695} 
  • trunk/qt4-gui/src/dialogs/awaymsgdlg.cpp

    r6352 r6374  
    166166  a->setData(999); 
    167167 
    168   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     168  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    169169  if (o == NULL) 
    170170    return; 
     
    182182          "(%m messages pending from you).") 
    183183        .arg(LicqStrings::getStatus(myStatus, false))); 
    184   gUserManager.DropOwner(); 
     184  gUserManager.DropOwner(o); 
    185185 
    186186  myAwayMsg->setFocus(); 
     
    252252  QString s = myAwayMsg->toPlainText().trimmed(); 
    253253 
    254   ICQOwner* o = gUserManager.FetchOwner(LOCK_W); 
     254  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 
    255255  if (o != NULL) 
    256256  { 
    257257    QTextCodec* codec = UserCodec::defaultEncoding(); 
    258258    o->SetAutoResponse(codec->fromUnicode(s)); 
    259     gUserManager.DropOwner(); 
     259    gUserManager.DropOwner(o); 
    260260  } 
    261261 
  • trunk/qt4-gui/src/dialogs/editcategorydlg.cpp

    r5837 r6374  
    125125void EditCategoryDlg::ok() 
    126126{ 
    127   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     127  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    128128  if (o != NULL) 
    129129  { 
    130130    QTextCodec* codec = UserCodec::codecForICQUser(o); 
    131     gUserManager.DropOwner(); 
     131    gUserManager.DropOwner(o); 
    132132 
    133133    ICQUserCategory* cat = new ICQUserCategory(myUserCat); 
  • trunk/qt4-gui/src/dialogs/historydlg.cpp

    r6186 r6374  
    239239  { 
    240240    myOwnerName = QString::fromUtf8(o->GetAlias()); 
    241     gUserManager.DropOwner(myPpid); 
     241    gUserManager.DropOwner(o); 
    242242  } 
    243243 
  • trunk/qt4-gui/src/dialogs/ownereditdlg.cpp

    r6352 r6374  
    9898      edtPassword->setText(o->Password()); 
    9999      chkSave->setChecked(o->SavePassword()); 
    100       gUserManager.DropOwner(ppid); 
     100      gUserManager.DropOwner(o); 
    101101    } 
    102102 
     
    139139  o->SetSavePassword(chkSave->isChecked()); 
    140140 
    141   gUserManager.DropOwner(ppid); 
     141  gUserManager.DropOwner(o); 
    142142  gLicqDaemon->SaveConf(); 
    143143 
  • trunk/qt4-gui/src/dialogs/ownermanagerdlg.cpp

    r6352 r6374  
    169169void OwnerManagerDlg::registerOwner() 
    170170{ 
    171   if (gUserManager.OwnerUin() != 0) 
     171  if (!gUserManager.OwnerId(LICQ_PPID).empty()) 
    172172  { 
    173173    QString buf = tr("You are currently registered as\n" 
     
    176176        "Rerun licq with the -b option to select a new\n" 
    177177        "base directory and then register a new user.") 
    178             .arg(gUserManager.OwnerUin()).arg(BASE_DIR); 
     178        .arg(gUserManager.OwnerId(LICQ_PPID).c_str()).arg(BASE_DIR); 
    179179    InformUser(this, buf); 
    180180    return; 
  • trunk/qt4-gui/src/dialogs/phonedlg.cpp

    r5892 r6374  
    5353  setModal(true); 
    5454 
    55   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     55  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    5656  if (o == NULL) 
    5757  { 
     
    6060  } 
    6161  QTextCodec* codec = UserCodec::codecForICQUser(o); 
    62   gUserManager.DropOwner(); 
     62  gUserManager.DropOwner(o); 
    6363 
    6464  m_nEntry = nEntry; 
     
    236236  } 
    237237 
    238   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     238  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    239239  if (o == NULL) 
    240240  { 
     
    243243  } 
    244244  QTextCodec* codec = UserCodec::codecForICQUser(o); 
    245   gUserManager.DropOwner(); 
     245  gUserManager.DropOwner(o); 
    246246 
    247247  struct PhoneBookEntry pbe; 
  • trunk/qt4-gui/src/dialogs/randomchatdlg.cpp

    r6099 r6374  
    203203      myGroupsList->setCurrentRow(0); break; 
    204204  } 
    205   gUserManager.DropOwner(); 
     205  gUserManager.DropOwner(o); 
    206206 
    207207  show(); 
  • trunk/qt4-gui/src/dialogs/registeruser.cpp

    r5837 r6374  
    234234  { 
    235235    o->SetSavePassword(mySavePassword->isChecked()); 
    236     gUserManager.DropOwner(ppid); 
     236    gUserManager.DropOwner(o); 
    237237    gLicqDaemon->SaveConf(); 
    238238  } 
  • trunk/qt4-gui/src/dialogs/securitydlg.cpp

    r6352 r6374  
    8080#undef ADD_CHECK 
    8181 
    82   gUserManager.DropOwner(); 
     82  gUserManager.DropOwner(o); 
    8383 
    8484  top_lay->addWidget(boxOptions); 
     
    111111  if (o->Status() == ICQ_STATUS_OFFLINE) 
    112112  { 
    113     gUserManager.DropOwner(LICQ_PPID); 
     113    gUserManager.DropOwner(o); 
    114114    InformUser(this, tr("You need to be connected to the\n" 
    115115          "ICQ Network to change the settings.")); 
     
    125125      ip != o->HideIp()) 
    126126  { 
    127     gUserManager.DropOwner(LICQ_PPID); 
     127    gUserManager.DropOwner(o); 
    128128    btnUpdate->setEnabled(false); 
    129129 
     
    138138  } 
    139139 
    140   gUserManager.DropOwner(LICQ_PPID); 
     140  gUserManager.DropOwner(o); 
    141141 
    142142  close(); 
  • trunk/qt4-gui/src/dialogs/userinfodlg.cpp

    r6352 r6374  
    15111511  o->SetEnableSave(true); 
    15121512  o->SavePictureInfo(); 
    1513   gUserManager.DropOwner(); 
     1513  gUserManager.DropOwner(o); 
    15141514 
    15151515  gLicqDaemon->icqUpdatePictureTimestamp(); 
     
    19391939  unsigned short status = o->Status(); 
    19401940  QTextCodec* codec = UserCodec::codecForICQUser(o); 
    1941   gUserManager.DropOwner(m_nPPID); 
     1941  gUserManager.DropOwner(o); 
    19421942 
    19431943  if (m_bOwner && currentTab == PhoneInfo) 
     
    20332033    unsigned short status = o->Status(); 
    20342034    codec = UserCodec::codecForICQUser(o); 
    2035     gUserManager.DropOwner(m_nPPID); 
     2035    gUserManager.DropOwner(o); 
    20362036 
    20372037    if(status == ICQ_STATUS_OFFLINE) { 
  • trunk/qt4-gui/src/dialogs/userselectdlg.cpp

    r6352 r6374  
    8989 
    9090  // For now, just have one owner 
    91   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     91  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    9292  if (o == 0) 
    9393  { 
     
    9797  cmbUser->addItem(QString("%1 (%2)").arg(o->GetAlias()).arg(o->IdString())); 
    9898  edtPassword->setText(o->Password()); 
    99   gUserManager.DropOwner(); 
     99  gUserManager.DropOwner(o); 
    100100 
    101101  // Wait for dialog to finish before returning to caller 
     
    109109void UserSelectDlg::slot_ok() 
    110110{ 
    111   ICQOwner* o = gUserManager.FetchOwner(LOCK_W); 
     111  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 
    112112  if (o == 0) 
    113113  { 
     
    117117  o->SetSavePassword(chkSavePassword->isChecked()); 
    118118  o->SetPassword(edtPassword->text().toLatin1()); 
    119   gUserManager.DropOwner(); 
     119  gUserManager.DropOwner(o); 
    120120 
    121121  close(); 
  • trunk/qt4-gui/src/dockicons/dockicon.cpp

    r6058 r6374  
    7272{ 
    7373  // First check for ICQ/AIM owner presence 
    74   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     74  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    7575 
    7676  // Take any existent one otherwise 
     
    9090    myStatus = o->Status(); 
    9191    myInvisible = o->StatusInvisible(); 
    92     gUserManager.DropOwner(myPpid); 
     92    gUserManager.DropOwner(o); 
    9393  } 
    9494  else 
  • trunk/qt4-gui/src/settings/events.cpp

    r6149 r6374  
    327327  oem->Unlock(); 
    328328  //TODO make general for all plugins 
    329   ICQOwner* o = gUserManager.FetchOwner(LOCK_R); 
     329  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 
    330330  if (o != NULL) 
    331331  { 
     
    334334    myOnEventOccupiedCheck->setChecked(o->AcceptInOccupied()); 
    335335    myOnEventDndCheck->setChecked(o->AcceptInDND()); 
    336     gUserManager.DropOwner(); 
     336    gUserManager.DropOwner(o); 
    337337  } 
    338338  myAlwaysOnlineNotifyCheck->setChecked(gLicqDaemon->AlwaysOnlineNotify()); 
     
    393393  oem->SetParameters(txtSndPlayer.toLatin1(), oemparams); 
    394394  //TODO Make general for all plugins 
    395   ICQOwner* o = gUserManager.FetchOwner(LOCK_W); 
     395  ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 
    396396  if (o) 
    397397  { 
     
    403403    o->SetEnableSave(true); 
    404404    o->SaveLicqInfo(); 
    405     gUserManager.DropOwner(); 
     405    gUserManager.DropOwner(o); 
    406406  } 
    407407  gLicqDaemon->SetAlwaysOnlineNotify(myAlwaysOnlineNotifyCheck->isChecked()); 
  • trunk/qt4-gui/src/userevents/usersendcommon.cpp

    r6365 r6374  
    256256        { 
    257257          ownerName = QString::fromUtf8(o->GetAlias()); 
    258           gUserManager.DropOwner(myPpid); 
     258          gUserManager.DropOwner(o); 
    259259        } 
    260260        else 
  • trunk/qt4-gui/src/widgets/historyview.cpp

    r6185 r6374  
    421421    { 
    422422      contactName = QString::fromUtf8(o->GetAlias()); 
    423       gUserManager.DropOwner(myPpid); 
     423      gUserManager.DropOwner(o); 
    424424    } 
    425425  } 
  • trunk/qt4-gui/src/widgets/protocombobox.cpp

    r6224 r6374  
    5656      if (skipExisting) 
    5757      { 
    58         gUserManager.DropOwner(ppid); 
     58        gUserManager.DropOwner(o); 
    5959        continue; 
    6060      } 
     
    6262      { 
    6363        id = o->IdString(); 
    64         gUserManager.DropOwner(ppid); 
     64        gUserManager.DropOwner(o); 
    6565      } 
    6666    }