Changeset 5852 for trunk/qt-gui

Show
Ignore:
Timestamp:
11/22/07 04:29:18 (12 months ago)
Author:
flynd
Message:

Merged r5849,r5850,r5851 from qt4-gui to get year in last fields of info dialog.

Location:
trunk/qt-gui/src
Files:
3 modified

Legend:

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

    r5614 r5852  
    664664} 
    665665 
    666  
    667 void CInfoField::setData(const unsigned long data) 
    668 { 
    669   char t[32]; 
    670   sprintf(t, "%lu", data); 
    671   setData(t); 
     666void CInfoField::setData(unsigned long data) 
     667{ 
     668  setText(QString::number(data)); 
     669} 
     670 
     671void CInfoField::setDateTime(uint timestamp) 
     672{ 
     673  if (timestamp == 0) 
     674    setText(tr("Unknown")); 
     675  else 
     676  { 
     677    QDateTime t; 
     678    t.setTime_t(timestamp); 
     679    setText(t.toString()); 
     680  } 
    672681} 
    673682 
  • trunk/qt-gui/src/ewidgets.h

    r5328 r5852  
    186186  void setData(const char *data); 
    187187  void setData(QString data); 
    188   void setData(const unsigned long data); 
     188  void setData(unsigned long data); 
     189  void setDateTime(uint timestamp); 
    189190  void SetReadOnly(bool); 
    190191protected: 
  • trunk/qt-gui/src/userinfodlg.cpp

    r5627 r5852  
    15491549  { 
    15501550    u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R); 
    1551     if (u == NULL) return; 
     1551    if (u == NULL) 
     1552      return; 
    15521553    bDropUser = true; 
    15531554  } 
    1554  
    1555   QDateTime t; 
    1556   QString ds; 
    15571555 
    15581556  if (!u->StatusOffline()) 
    15591557    nfoLastOnline->setData(tr("Now")); 
    1560   else if (u->LastOnline() == 0) 
    1561     nfoLastOnline->setData(tr("Unknown")); 
    1562   else 
    1563   { 
    1564     t.setTime_t(u->LastOnline()); 
    1565     ds = t.toString(); 
    1566     ds.truncate(ds.length() - 8); 
    1567     nfoLastOnline->setData(ds); 
    1568   } 
    1569  
    1570   if (u->LastSentEvent() == 0) 
    1571     nfoLastSent->setData(tr("Unknown")); 
    1572   else 
    1573   { 
    1574     t.setTime_t(u->LastSentEvent()); 
    1575     ds = t.toString(); 
    1576     ds.truncate(ds.length() - 8); 
    1577     nfoLastSent->setData(ds); 
    1578   } 
    1579  
    1580   if (u->LastReceivedEvent() == 0) 
    1581     nfoLastRecv->setData(tr("Unknown")); 
    1582   else 
    1583   { 
    1584     t.setTime_t(u->LastReceivedEvent()); 
    1585     ds = t.toString(); 
    1586     ds.truncate(ds.length() - 8); 
    1587     nfoLastRecv->setData(ds); 
    1588   } 
    1589  
    1590   if (u->LastCheckedAutoResponse() == 0) 
    1591     nfoLastCheckedAR->setData(tr("Unknown")); 
    1592   else 
    1593   { 
    1594     t.setTime_t(u->LastCheckedAutoResponse()); 
    1595     ds = t.toString(); 
    1596     ds.truncate(ds.length() - 8); 
    1597     nfoLastCheckedAR->setData(ds); 
    1598   } 
     1558  else 
     1559    nfoLastOnline->setDateTime(u->LastOnline()); 
     1560 
     1561  nfoLastSent->setDateTime(u->LastSentEvent()); 
     1562  nfoLastRecv->setDateTime(u->LastReceivedEvent()); 
     1563  nfoLastCheckedAR->setDateTime(u->LastCheckedAutoResponse()); 
    15991564 
    16001565  if (u->StatusOffline()) 
    16011566    nfoOnlineSince->setData(tr("Offline")); 
    1602   else if (u->OnlineSince() == 0) 
    1603     nfoOnlineSince->setData(tr("Unknown")); 
    1604   else 
    1605   { 
    1606     t.setTime_t(u->OnlineSince()); 
    1607     ds = t.toString(); 
    1608     ds.truncate(ds.length() - 8); 
    1609     nfoOnlineSince->setData(ds); 
    1610   } 
    1611  
    1612   if (bDropUser) gUserManager.DropUser(u); 
     1567  else 
     1568    nfoOnlineSince->setDateTime(u->OnlineSince()); 
     1569 
     1570  if (bDropUser) 
     1571    gUserManager.DropUser(u); 
    16131572} 
    16141573