Changeset 6186 for trunk/qt4-gui/src/dialogs
- Timestamp:
- 05/06/08 04:56:15 (7 months ago)
- Location:
- trunk/qt4-gui/src/dialogs
- Files:
-
- 2 modified
-
historydlg.cpp (modified) (3 diffs)
-
historydlg.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/dialogs/historydlg.cpp
r6178 r6186 35 35 #include <QVBoxLayout> 36 36 37 #include <licq_events.h> 38 #include <licq_message.h> 37 39 #include <licq_user.h> 38 40 39 41 #include "config/chat.h" 40 42 #include "core/licqgui.h" 43 #include "core/signalmanager.h" 41 44 #include "core/usermenu.h" 42 45 #include "helpers/eventdesc.h" … … 252 255 myCalendar->setSelectedDate(lastDate); 253 256 calenderClicked(); 257 258 // Catch sent messages and add them to history 259 connect(LicqGui::instance(), SIGNAL(eventSent(const ICQEvent*)), 260 SLOT(eventSent(const ICQEvent*))); 261 262 // Catch received messages so we can add them to history 263 connect(LicqGui::instance()->signalManager(), SIGNAL(updatedUser(CICQSignal*)), SLOT(updatedUser(CICQSignal*))); 254 264 } 255 265 … … 257 267 { 258 268 ICQUser::ClearHistory(myHistoryList); 269 } 270 271 void HistoryDlg::updatedUser(CICQSignal* signal) 272 { 273 if (signal->Id() != myId || signal->PPID() != myPpid) 274 return; 275 276 if (signal->SubSignal() == USER_EVENTS) 277 { 278 ICQUser* u = gUserManager.FetchUser(myId.toLatin1(), myPpid, LOCK_R); 279 if (u == NULL) 280 return; 281 282 const CUserEvent* event = u->EventPeekId(signal->Argument()); 283 gUserManager.DropUser(u); 284 285 if (event != NULL && signal->Argument() > 0 && signal->Argument() > (*(--myHistoryList.end()))->Id()) 286 addMsg(event); 287 } 288 } 289 290 void HistoryDlg::eventSent(const ICQEvent* event) 291 { 292 if (event->Id() == myId && event->PPID() == myPpid && event->UserEvent() != NULL) 293 addMsg(event->UserEvent()); 294 } 295 296 void HistoryDlg::addMsg(const CUserEvent* event) 297 { 298 CUserEvent* eventCopy = event->Copy(); 299 myHistoryList.push_back(eventCopy); 300 QDate date = QDateTime::fromTime_t(event->Time()).date(); 301 myCalendar->markDate(date); 302 myCalendar->setMaximumDate(date); 259 303 } 260 304 -
trunk/qt4-gui/src/dialogs/historydlg.h
r5999 r6186 35 35 class QRegExp; 36 36 class QTextCodec; 37 38 class CICQSignal; 39 class ICQEvent; 37 40 38 41 namespace LicqQtGui … … 108 111 void previousDate(); 109 112 113 private slots: 114 /** 115 * A user was updated. Add to history if it was a message recieved for this user 116 * 117 * @param signal Signal from daemon 118 */ 119 void updatedUser(CICQSignal* signal); 120 121 /** 122 * A message was sent. Add to history if it was for the current user 123 * 124 * @param event Event object for message 125 */ 126 void eventSent(const ICQEvent* event); 127 110 128 private: 129 /** 130 * Add an event to the current history 131 * 132 * @param event Event to add 133 */ 134 void addMsg(const CUserEvent* event); 135 111 136 /** 112 137 * Build a regular expression from the input fields
