Show
Ignore:
Timestamp:
01/28/07 01:30:18 (23 months ago)
Author:
flynd
Message:

Added local time to column information.
To keep the times updated a timer is added that refreshes the contact list every minute.
This closes #1.

Files:
1 modified

Legend:

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

    r4734 r4843  
    3636#include <qimage.h> 
    3737#include <qmime.h> 
     38#include <qtimer.h> 
    3839 
    3940#include "userbox.moc" 
     
    10291030 
    10301031  carId = onlId = 0; 
     1032 
     1033  // Redraw once a minute in case there are cells showing timestamps 
     1034  tmrRefresh = new QTimer(this); 
     1035  connect(tmrRefresh, SIGNAL(timeout()), this, SLOT(updateItems())); 
     1036  tmrRefresh->start(60000); 
    10311037} 
    10321038 
     
    10361042CUserView::~CUserView() 
    10371043{ 
     1044  tmrRefresh->stop(); 
    10381045  barOnline = barOffline = barNotInList = NULL; 
    10391046  if (parent() == NULL) 
     
    16251632} 
    16261633 
     1634// ----------------------------------------------------------------------------- 
     1635 
     1636void CUserView::updateItems() 
     1637{ 
     1638  for (QListViewItemIterator it(firstChild()); it.current() != 0; ++it) 
     1639  { 
     1640    CUserViewItem* item = static_cast<CUserViewItem*>(it.current()); 
     1641 
     1642    ICQUser *u = gUserManager.FetchUser(item->ItemId(), item->ItemPPID(), LOCK_R); 
     1643    if (u == 0) 
     1644      continue; 
     1645    item->setGraphics(u); 
     1646    gUserManager.DropUser(u); 
     1647  } 
     1648  triggerUpdate(); 
     1649} 
    16271650 
    16281651// -----------------------------------------------------------------------------