Changeset 6381 for trunk/qt-gui
- Timestamp:
- 07/01/08 17:03:38 (5 months ago)
- Location:
- trunk/qt-gui/src
- Files:
-
- 14 modified
-
awaymsgdlg.cpp (modified) (4 diffs)
-
catdlg.cpp (modified) (2 diffs)
-
ewidgets.cpp (modified) (1 diff)
-
licqkimiface.cpp (modified) (1 diff)
-
mainwin.cpp (modified) (19 diffs)
-
optionsdlg.cpp (modified) (4 diffs)
-
ownermanagerdlg.cpp (modified) (6 diffs)
-
phonedlg.cpp (modified) (4 diffs)
-
randomchatdlg.cpp (modified) (1 diff)
-
securitydlg.cpp (modified) (5 diffs)
-
usereventdlg.cpp (modified) (1 diff)
-
userinfodlg.cpp (modified) (4 diffs)
-
userselectdlg.cpp (modified) (4 diffs)
-
wharf.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/awaymsgdlg.cpp
r6367 r6381 152 152 mnuSelect->insertItem(tr("&Edit Items"), 999); 153 153 154 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);154 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 155 155 if (o == 0) return; 156 156 setCaption(QString(tr("Set %1 Response for %2")) … … 165 165 "(%m messages pending from you).") 166 166 .arg(Strings::getStatus(m_nStatus, false))); 167 gUserManager.DropOwner( );167 gUserManager.DropOwner(o); 168 168 169 169 mleAwayMsg->setFocus(); … … 203 203 s.truncate(s.length()-1); 204 204 205 ICQOwner *o = gUserManager.FetchOwner(LOCK_W);205 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 206 206 if (o == 0) 207 207 { … … 211 211 QTextCodec *codec = UserCodec::defaultEncoding(); 212 212 o->SetAutoResponse(codec->fromUnicode(s)); 213 gUserManager.DropOwner( );213 gUserManager.DropOwner(o); 214 214 close(); 215 215 } -
trunk/qt-gui/src/catdlg.cpp
r4800 r6381 113 113 void EditCategoryDlg::ok() 114 114 { 115 ICQOwner* o = gUserManager.FetchOwner(L OCK_R);115 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 116 116 if (o == NULL) 117 117 { … … 120 120 } 121 121 QTextCodec *codec = UserCodec::codecForICQUser(o); 122 gUserManager.DropOwner( );122 gUserManager.DropOwner(o); 123 123 124 124 ICQUserCategory *cat = new ICQUserCategory(m_uc); -
trunk/qt-gui/src/ewidgets.cpp
r6367 r6381 1092 1092 QTextCodec *ownerCodec = UserCodec::codecForICQUser(o); 1093 1093 contactName = ownerCodec->toUnicode(o->GetAlias()); 1094 gUserManager.DropOwner( m_nPPID);1094 gUserManager.DropOwner(o); 1095 1095 } 1096 1096 } -
trunk/qt-gui/src/licqkimiface.cpp
r6305 r6381 96 96 QStringList LicqKIMIface::reachableContacts() 97 97 { 98 ICQOwner* owner = gUserManager.FetchOwner(L OCK_R);98 ICQOwner* owner = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 99 99 bool offline = owner->StatusOffline(); 100 gUserManager.DropOwner( );100 gUserManager.DropOwner(owner); 101 101 102 102 if (offline) -
trunk/qt-gui/src/mainwin.cpp
r6368 r6381 620 620 m_nRealHeight = hVal; 621 621 622 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);622 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 623 623 if (o != NULL) 624 624 { 625 625 m_szCaption = tr("Licq (%1)").arg(QString::fromUtf8(o->GetAlias())); 626 gUserManager.DropOwner( );626 gUserManager.DropOwner(o); 627 627 } 628 628 else … … 791 791 { 792 792 // Do we need to get a password 793 o = gUserManager.FetchOwner(L OCK_R);793 o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 794 794 if (o != NULL) 795 795 { 796 796 if(o->Password()[0] == '\0') 797 797 { 798 gUserManager.DropOwner( );798 gUserManager.DropOwner(o); 799 799 (void) new UserSelectDlg(licqDaemon); 800 800 } 801 801 else 802 gUserManager.DropOwner( );802 gUserManager.DropOwner(o); 803 803 } 804 804 } … … 808 808 { 809 809 mnuPFM->setItemChecked(o->PhoneFollowMeStatus(), true); 810 gUserManager.DropOwner( );810 gUserManager.DropOwner(o); 811 811 } 812 812 … … 1405 1405 } 1406 1406 else 1407 { 1407 { 1408 1408 s = o->Status(); 1409 gUserManager.DropOwner( nPPID);1409 gUserManager.DropOwner(o); 1410 1410 } 1411 1411 if (s == ICQ_STATUS_ONLINE || s == ICQ_STATUS_FREEFORCHAT) … … 1464 1464 { 1465 1465 m_szCaption = tr("Licq (%1)").arg(QString::fromUtf8(o->GetAlias())); 1466 gUserManager.DropOwner( nPPID);1466 gUserManager.DropOwner(o); 1467 1467 } 1468 1468 else … … 2093 2093 else 2094 2094 { 2095 gUserManager.DropOwner( nPPID);2096 2095 gUserManager.DropOwner(o); 2096 2097 2097 // Show multiple icons for each protocol 2098 2098 lblStatus->clearPrependPixmap(); 2099 2099 lblStatus->setText(""); 2100 2100 lblStatus->clearPixmaps(); 2101 2101 2102 2102 vector<unsigned long>::iterator it; 2103 2103 for (it = m_lnProtMenu.begin(); it != m_lnProtMenu.end(); it++) … … 2108 2108 lblStatus->addPixmap(CMainWindow::iconForStatus(o->StatusFull(), 2109 2109 o->IdString(), *it)); 2110 gUserManager.DropOwner( *it);2110 gUserManager.DropOwner(o); 2111 2111 } 2112 2112 } … … 2133 2133 setIcon(CMainWindow::iconForStatus(o->StatusFull())); 2134 2134 #endif // USE_KDE 2135 2136 gUserManager.DropOwner( nPPID);2135 2136 gUserManager.DropOwner(o); 2137 2137 } 2138 2138 } … … 2151 2151 lblStatus->addPixmap(CMainWindow::iconForStatus(o->StatusFull(), 2152 2152 o->IdString(), *it)); 2153 gUserManager.DropOwner( *it);2153 gUserManager.DropOwner(o); 2154 2154 } 2155 2155 } 2156 2156 2157 2157 lblStatus->update(); 2158 2158 } … … 2168 2168 { 2169 2169 //TODO iterate all owners that support fetching away message 2170 ICQOwner* o = gUserManager.FetchOwner(L OCK_R);2170 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 2171 2171 if (o == NULL) 2172 2172 return; 2173 2173 2174 2174 unsigned short status = o->Status(); 2175 gUserManager.DropOwner( );2175 gUserManager.DropOwner(o); 2176 2176 showAwayMsgDlg(status); 2177 2177 } … … 2296 2296 ICQOwner *o = gUserManager.FetchOwner(nPPID, LOCK_R); 2297 2297 if (o == NULL) continue; 2298 2298 2299 2299 if (id == ICQ_STATUS_OFFLINE) 2300 2300 { 2301 gUserManager.DropOwner( nPPID);2301 gUserManager.DropOwner(o); 2302 2302 licqDaemon->ProtoLogoff(nPPID); 2303 2303 continue; … … 2313 2313 if (o->StatusOffline()) 2314 2314 { 2315 gUserManager.DropOwner( nPPID);2315 gUserManager.DropOwner(o); 2316 2316 continue; 2317 2317 } … … 2342 2342 // call the right function 2343 2343 bool b = o->StatusOffline(); 2344 gUserManager.DropOwner( nPPID);2344 gUserManager.DropOwner(o); 2345 2345 if (b) 2346 2346 licqDaemon->ProtoLogon(nPPID, newStatus); … … 2449 2449 szId = strdup(o->IdString()); 2450 2450 unsigned short nNumMsg = o->NewMessages(); 2451 gUserManager.DropOwner( (*_ppit)->PPID());2452 2451 gUserManager.DropOwner(o); 2452 2453 2453 if (nNumMsg > 0) 2454 2454 callFunction(index, szId, (*_ppit)->PPID()); … … 2469 2469 if (o == 0) continue; 2470 2470 szId = strdup(o->IdString()); 2471 gUserManager.DropOwner( (*_ppit)->PPID());2471 gUserManager.DropOwner(o); 2472 2472 callInfoTab(index, szId, (*_ppit)->PPID()); 2473 2473 free(szId); … … 3002 3002 if (o == 0) continue; // just in case 3003 3003 unsigned short nNumMsg = o->NewMessages(); 3004 gUserManager.DropOwner( (*_ppit)->PPID());3004 gUserManager.DropOwner(o); 3005 3005 if (nNumMsg > 0) 3006 3006 { … … 3586 3586 void CMainWindow::aboutBox() 3587 3587 { 3588 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);3589 3588 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 3589 3590 3590 // We might have no owner 3591 3591 QString m_Alias = (o == 0) ? QString(tr("(Error! No owner set)")) : QString::fromUtf8(o->GetAlias()); 3592 3592 QString id = (o == 0) ? "" : o->IdString(); 3593 3593 3594 3594 QString about(tr("Licq version %1%8.\n" 3595 3595 "Qt GUI plugin version %2.\n" … … 3611 3611 #endif 3612 3612 .arg(__DATE__).arg(CICQDaemon::CryptoEnabled() ? "/SSL" : "")); 3613 gUserManager.DropOwner( );3613 gUserManager.DropOwner(o); 3614 3614 InformUser(this, about); 3615 3615 } … … 4797 4797 4798 4798 // Do system messages first 4799 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);4799 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 4800 4800 unsigned short nNumMsg = 0; 4801 4801 if (o) 4802 4802 { 4803 4803 nNumMsg = o->NewMessages(); 4804 gUserManager.DropOwner( );4805 } 4806 4804 gUserManager.DropOwner(o); 4805 } 4806 4807 4807 if (nNumMsg > 0) 4808 4808 { -
trunk/qt-gui/src/optionsdlg.cpp
r6367 r6381 458 458 oem->Unlock(); 459 459 //TODO make general for all plugins 460 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);460 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 461 461 if (o) 462 462 { … … 465 465 chkOEOccupied->setChecked(o->AcceptInOccupied()); 466 466 chkOEDND->setChecked(o->AcceptInDND()); 467 gUserManager.DropOwner( );467 gUserManager.DropOwner(o); 468 468 } 469 469 chkAlwaysOnlineNotify->setChecked(mainwin->licqDaemon->AlwaysOnlineNotify()); … … 722 722 oem->SetParameters(txtSndPlayer.latin1(), oemparams); 723 723 //TODO Make general for all plugins 724 ICQOwner *o = gUserManager.FetchOwner(LOCK_W);724 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 725 725 if (o) 726 726 { … … 732 732 o->SetEnableSave(true); 733 733 o->SaveLicqInfo(); 734 gUserManager.DropOwner( );734 gUserManager.DropOwner(o); 735 735 } 736 736 mainwin->licqDaemon->SetAlwaysOnlineNotify(chkAlwaysOnlineNotify->isChecked()); -
trunk/qt-gui/src/ownermanagerdlg.cpp
r6187 r6381 87 87 cmbProtocol->insertItem((*it)->Name(), n++); 88 88 else 89 gUserManager.DropOwner( (*it)->PPID());89 gUserManager.DropOwner(o); 90 90 } 91 91 } 92 92 93 93 // Set the fields 94 94 if (szId && nPPID) … … 99 99 { 100 100 edtPassword->setText(o->Password()); 101 gUserManager.DropOwner( nPPID);101 gUserManager.DropOwner(o); 102 102 } 103 103 104 104 n = 0; 105 105 for (it = pl.begin(); it != pl.end(); it++, n++) … … 188 188 o->SetPassword(szPassword); 189 189 } 190 191 gUserManager.DropOwner( nPPID);190 191 gUserManager.DropOwner(o); 192 192 server->SaveConf(); 193 193 194 194 close(); 195 195 } … … 333 333 void OwnerManagerDlg::slot_registerClicked() 334 334 { 335 if ( gUserManager.OwnerUin() != 0)335 if (!gUserManager.OwnerId(LICQ_PPID).empty()) 336 336 { 337 337 QString buf = tr("You are currently registered as\n" … … 340 340 "Rerun licq with the -b option to select a new\n" 341 341 "base directory and then register a new user.") 342 .arg(gUserManager.Owner Uin()).arg(BASE_DIR);342 .arg(gUserManager.OwnerId(LICQ_PPID).c_str()).arg(BASE_DIR); 343 343 InformUser(this, buf); 344 344 return; … … 376 376 updateOwners(); 377 377 378 char sz[20];379 378 //TODO which owner 380 sprintf(sz, "%lu", gUserManager.OwnerUin());379 QString id = gUserManager.OwnerId(LICQ_PPID); 381 380 InformUser(this, tr("Successfully registered, your user identification\n" 382 381 "number (UIN) is %1.\n" 383 "Now set your personal information.").arg( gUserManager.OwnerUin()));384 mainwin->callInfoTab(mnuUserGeneral, sz, LICQ_PPID);382 "Now set your personal information.").arg(id)); 383 mainwin->callInfoTab(mnuUserGeneral, id, LICQ_PPID); 385 384 } 386 385 else -
trunk/qt-gui/src/phonedlg.cpp
r4699 r6381 45 45 : QDialog(parent, "EditPhoneDlg", true, WDestructiveClose) 46 46 { 47 ICQOwner* o = gUserManager.FetchOwner(L OCK_R);47 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 48 48 if (o == NULL) 49 49 { … … 52 52 } 53 53 QTextCodec *codec = UserCodec::codecForICQUser(o); 54 gUserManager.DropOwner( );54 gUserManager.DropOwner(o); 55 55 56 56 m_nEntry = nEntry; … … 230 230 } 231 231 232 ICQOwner* o = gUserManager.FetchOwner(L OCK_R);232 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 233 233 if (o == NULL) 234 234 { … … 237 237 } 238 238 QTextCodec *codec = UserCodec::codecForICQUser(o); 239 gUserManager.DropOwner( );239 gUserManager.DropOwner(o); 240 240 241 241 struct PhoneBookEntry pbe; -
trunk/qt-gui/src/randomchatdlg.cpp
r4699 r6381 216 216 lstGroups->setCurrentItem(0); break; 217 217 } 218 gUserManager.DropOwner( );218 gUserManager.DropOwner(o); 219 219 220 220 show(); -
trunk/qt-gui/src/securitydlg.cpp
r5328 r6381 49 49 ePasswordChange = 0; 50 50 51 unsigned long nUin = gUserManager.OwnerUin(); 52 QString strUin; 53 if (nUin) 54 strUin.setNum(nUin); 51 QString strUin = gUserManager.OwnerId(LICQ_PPID);; 55 52 56 53 QVBoxLayout *lay = new QVBoxLayout(this, 8); … … 92 89 // UIN 93 90 edtUin->setValidator(new QIntValidator(10000, 2147483647, edtUin)); 94 if (nUin) 95 edtUin->setText(strUin); 91 edtUin->setText(strUin); 96 92 97 93 // Owner password 98 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);94 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 99 95 if (o != NULL) 100 96 { … … 149 145 chkWebAware->setChecked(o->WebAware()); 150 146 chkHideIp->setChecked(o->HideIp()); 151 gUserManager.DropOwner( );147 gUserManager.DropOwner(o); 152 148 } 153 149 else … … 193 189 void SecurityDlg::ok() 194 190 { 195 ICQOwner* o = gUserManager.FetchOwner(L OCK_R);191 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 196 192 if(o == 0) return; 197 193 unsigned short status = o->Status(); 198 gUserManager.DropOwner( );194 gUserManager.DropOwner(o); 199 195 200 196 // validate password … … 247 243 if (chkOnlyLocal->isChecked()) 248 244 { 249 o = gUserManager.FetchOwner(L OCK_W);245 o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 250 246 gUserManager.SetOwnerUin(edtUin->text().toULong()); 251 247 o->SetPassword(edtFirst->text().latin1()); 252 gUserManager.DropOwner( );248 gUserManager.DropOwner(o); 253 249 close(); 254 250 } -
trunk/qt-gui/src/usereventdlg.cpp
r6366 r6381 1605 1605 { 1606 1606 ownerName = QString::fromUtf8(o->GetAlias()); 1607 gUserManager.DropOwner( m_nPPID);1607 gUserManager.DropOwner(o); 1608 1608 } 1609 1609 else 1610 1610 ownerName = QString(tr("Error! no owner set")); 1611 1611 QDateTime date; 1612 1612 1613 1613 // Iterate through each message to add 1614 1614 // Only show old messages as recent ones. Don't show duplicates. -
trunk/qt-gui/src/userinfodlg.cpp
r6305 r6381 1500 1500 o->SetEnableSave(true); 1501 1501 o->SavePictureInfo(); 1502 gUserManager.DropOwner( );1502 gUserManager.DropOwner(o); 1503 1503 1504 1504 server->icqUpdatePictureTimestamp(); … … 2000 2000 QTextCodec *ownerCodec = UserCodec::codecForICQUser(o); 2001 2001 ownerName = ownerCodec->toUnicode(o->GetAlias()); 2002 gUserManager.DropOwner( m_nPPID);2002 gUserManager.DropOwner(o); 2003 2003 } 2004 2004 … … 2285 2285 unsigned short status = o->Status(); 2286 2286 QTextCodec *codec = UserCodec::codecForICQUser(o); 2287 gUserManager.DropOwner( m_nPPID);2288 2287 gUserManager.DropOwner(o); 2288 2289 2289 if (m_bOwner && currentTab == PhoneInfo) 2290 2290 { … … 2387 2387 unsigned short status = o->Status(); 2388 2388 codec = UserCodec::codecForICQUser(o); 2389 gUserManager.DropOwner( m_nPPID);2389 gUserManager.DropOwner(o); 2390 2390 2391 2391 if(status == ICQ_STATUS_OFFLINE) { -
trunk/qt-gui/src/userselectdlg.cpp
r6305 r6381 82 82 83 83 // For now, just have one owner 84 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);84 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 85 85 if (o == 0) 86 86 { … … 90 90 cmbUser->insertItem(QString("%1 (%2)").arg(o->GetAlias()).arg(o->IdString())); 91 91 edtPassword->setText(o->Password()); 92 gUserManager.DropOwner();92 gUserManager.DropOwner(o); 93 93 94 94 exec(); // this is different from show(), exec() does not return … … 102 102 void UserSelectDlg::slot_ok() 103 103 { 104 ICQOwner *o = gUserManager.FetchOwner(LOCK_W);104 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_W); 105 105 if (o == 0) 106 106 { … … 110 110 o->SetSavePassword(chkSavePassword->isChecked()); 111 111 o->SetPassword(edtPassword->text().latin1()); 112 gUserManager.DropOwner( );112 gUserManager.DropOwner(o); 113 113 114 114 close(); -
trunk/qt-gui/src/wharf.cpp
r5514 r6381 219 219 { 220 220 QPixmap m; 221 ICQOwner *o = gUserManager.FetchOwner(LOCK_R);221 ICQOwner* o = gUserManager.FetchOwner(LICQ_PPID, LOCK_R); 222 222 if (o == 0) return; 223 223 switch (o->Status()) … … 232 232 } 233 233 if (o->StatusInvisible()) m = QPixmap((const char **)iconInvisible_xpm); 234 gUserManager.DropOwner( );234 gUserManager.DropOwner(o); 235 235 QPainter painter(wharfIcon->vis); 236 236 if (!m_bFortyEight)
