Moved notify of new messages in MainWindow from QTimer to signal messagesChanged.

Show own tray icon for new messages.
Removed unused member p3Forums::mForumsChanged.
The message service send a notify on p3MsgService::markMsgIdRead too.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3353 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-09 12:16:21 +00:00
parent 86ae9983d1
commit 32afd370bb
7 changed files with 88 additions and 67 deletions

View file

@ -1662,6 +1662,8 @@ void MessagesDialog::updateCurrentMessage()
void MessagesDialog::setMsgAsReadUnread(const QList<int> &Rows, bool bRead)
{
LockUpdate Lock (this, false);
for (int nRow = 0; nRow < Rows.size(); nRow++) {
QStandardItem* item[COLUMN_COUNT];
for(int nCol = 0; nCol < COLUMN_COUNT; nCol++)
@ -1671,20 +1673,25 @@ void MessagesDialog::setMsgAsReadUnread(const QList<int> &Rows, bool bRead)
QString mid = item[COLUMN_DATA]->data(ROLE_MSGID).toString();
m_pConfig->beginGroup(CONFIG_SECTION_UNREAD);
if (bRead) {
// set as read in config
m_pConfig->beginGroup(CONFIG_SECTION_UNREAD);
m_pConfig->setValue(mid, false);
m_pConfig->endGroup();
// set message to read
rsMsgs->MessageRead(mid.toStdString());
} else {
// set as unread in config
m_pConfig->beginGroup(CONFIG_SECTION_UNREAD);
m_pConfig->setValue(mid, true);
m_pConfig->endGroup();
}
m_pConfig->endGroup();
InitIconAndFont(m_pConfig, item, 0);
}
// LockUpdate
}
void MessagesDialog::markAsRead()