Show
Ignore:
Timestamp:
05/03/03 09:14:22 (6 years ago)
Author:
emostar
Message:

Removing unnecessary code

Location:
branches/protocol_plugin_1_3_0/qt-gui/src
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • branches/protocol_plugin_1_3_0/qt-gui/src/filedlg.cpp

    r3472 r3488  
    348348  read(ftman->Pipe(), buf, 32); 
    349349 
    350   //TODO Fix this 
    351   QTextCodec *codec = UserCodec::codecForUIN(strtoul(m_szId, (char **)NULL, 10)); 
     350  QTextCodec *codec = UserCodec::codecForProtoUser(m_szId, m_nPPID); 
    352351 
    353352  CFileTransferEvent *e = NULL; 
     
    528527  bool bValid = false; 
    529528 
    530   QTextCodec *codec = UserCodec::codecForUIN(m_nUin); 
     529  QTextCodec *codec = UserCodec::codecForProtoUser(m_szId, m_nPPID); 
    531530   
    532531  // Get the local filename and open it, loop until valid or cancel 
  • branches/protocol_plugin_1_3_0/qt-gui/src/reqauthdlg.cpp

    r3472 r3488  
    143143void ReqAuthDlg::ok() 
    144144{ 
    145   unsigned long nUin = edtUin->text().toULong(); 
     145  char *szId = (char *)edtUin->text().ascii(); 
    146146 
    147   if (nUin != 0) 
     147  if (szId) 
    148148  { 
    149     QTextCodec *codec = UserCodec::codecForUIN(nUin); 
    150     server->icqRequestAuth(nUin, codec->fromUnicode(mleRequest->text())); 
     149    //TODO add a drop down list for protocol 
     150    QTextCodec *codec = UserCodec::codecForProtoUser(szId, LICQ_PPID); 
     151    server->icqRequestAuth(strtoul(szId, (char **)NULL, 10), 
     152      codec->fromUnicode(mleRequest->text())); 
    151153    close(true); 
    152154  } 
  • branches/protocol_plugin_1_3_0/qt-gui/src/userbox.cpp

    r3472 r3488  
    6363  if(listView()->parent() == NULL) 
    6464    listView()->setCaption(CUserView::tr("%1 Floaty (%2)") 
    65                            .arg(_cUser->GetAlias()).arg(_cUser->Uin())); 
     65                           .arg(_cUser->GetAlias()).arg(_cUser->IdString())); 
    6666 
    6767  m_nUin = _cUser->Uin(); 
     
    168168  CUserView *v = (CUserView *)listView(); 
    169169 
    170   if (v == NULL || m_nUin == 0) return; 
     170  if (v == NULL || m_szId == 0) return; 
    171171 
    172172  if (m_szId) 
     
    395395  p->setFont(newFont); 
    396396 
    397   bool onlBlink = (listView()->onlTimerId && listView()->onlUin && 
    398                    listView()->onlUin == m_nUin && listView()->onlCounter & 1); 
     397  bool onlBlink = (listView()->onlTimerId && listView()->onlId && 
     398                   strcmp(listView()->onlId, m_szId) == 0 && 
     399                   listView()->onlPPID == m_nPPID && listView()->onlCounter & 1); 
    399400 
    400401  QColorGroup cg(cgdefault.foreground(), cgdefault.background(), 
     
    851852} 
    852853 
    853  
    854 CUserView *CUserView::FindFloaty(unsigned long nUin) 
    855 { 
    856   unsigned int i = 0; 
    857   for (; i<floaties->size(); i++) 
    858   { 
    859     if (static_cast<CUserViewItem*>(floaties->at(i)->firstChild())->ItemUin()== nUin) 
    860         break; 
    861   } 
    862   if(i<floaties->size()) return floaties->at(i); 
    863  
    864   return NULL; 
    865 } 
    866  
    867854CUserView *CUserView::FindFloaty(const char *szId, unsigned long nPPID) 
    868855{ 
  • branches/protocol_plugin_1_3_0/qt-gui/src/userbox.h

    r3472 r3488  
    134134 
    135135  static UserFloatyList* floaties; 
    136   static CUserView *FindFloaty(unsigned long); 
    137136  static CUserView *FindFloaty(const char *, unsigned long); 
    138137  static void UpdateFloaties(); 
  • branches/protocol_plugin_1_3_0/qt-gui/src/usercodec.cpp

    r3472 r3488  
    9292} 
    9393 
    94 QTextCodec* UserCodec::codecForUIN(uint uin) 
    95 { 
    96   QTextCodec *codec = QTextCodec::codecForLocale(); 
    97    
    98   ICQUser *u = gUserManager.FetchUser(uin, LOCK_R); 
    99   if (u != NULL) 
    100   { 
    101      codec = UserCodec::codecForICQUser(u); 
    102      gUserManager.DropUser(u); 
    103   } 
    104    
    105   return codec; 
    106 } 
    107  
    10894QTextCodec *UserCodec::codecForProtoUser(const char *szId, unsigned long nPPID) 
    10995{ 
     
    126112 
    127113  // return default encoding 
    128   return codecForUIN(u->Uin()); 
     114  return codecForProtoUser(u->Id(), u->PPID()); 
    129115} 
    130116 
  • branches/protocol_plugin_1_3_0/qt-gui/src/usercodec.h

    r3472 r3488  
    4040  // Retrieves the codec for an CChatUser object 
    4141  static QTextCodec * codecForCChatUser(CChatUser *u); 
    42   // Helper function to retrieve the codec for an UIN 
    43   static QTextCodec * codecForUIN(uint uin); 
    4442  // Retrieves the codec for a proto user 
    4543  static QTextCodec * codecForProtoUser(const char *, unsigned long);