mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-19 06:20:44 -04:00
storage of chat room icons in local variables to avoid re-reading them from qrc everytime (patch from sss)
This commit is contained in:
parent
acd83556e5
commit
c2d55799e1
2 changed files with 9 additions and 5 deletions
|
@ -63,7 +63,9 @@ const static uint32_t timeToInactivity = 60 * 10; // in seconds
|
||||||
|
|
||||||
/** Default constructor */
|
/** Default constructor */
|
||||||
ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WindowFlags flags)
|
ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::WindowFlags flags)
|
||||||
: ChatDialog(parent, flags), lobbyId(lid)
|
: ChatDialog(parent, flags), lobbyId(lid),
|
||||||
|
bullet_red_128(":/icons/bullet_red_128.png"), bullet_grey_128(":/icons/bullet_grey_128.png"),
|
||||||
|
bullet_green_128(":/icons/bullet_green_128.png"), bullet_yellow_128(":/icons/bullet_yellow_128.png")
|
||||||
{
|
{
|
||||||
/* Invoke Qt Designer generated QObject setup routine */
|
/* Invoke Qt Designer generated QObject setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
@ -556,16 +558,16 @@ void ChatLobbyDialog::updateParticipantsList()
|
||||||
|
|
||||||
|
|
||||||
if(isParticipantMuted(it2->first))
|
if(isParticipantMuted(it2->first))
|
||||||
widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_red_128.png"));
|
widgetitem->setIcon(COLUMN_ICON, bullet_red_128);
|
||||||
else if (tLastAct + timeToInactivity < now)
|
else if (tLastAct + timeToInactivity < now)
|
||||||
widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_grey_128.png"));
|
widgetitem->setIcon(COLUMN_ICON, bullet_grey_128);
|
||||||
else
|
else
|
||||||
widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_green_128.png"));
|
widgetitem->setIcon(COLUMN_ICON, bullet_green_128);
|
||||||
|
|
||||||
RsGxsId gxs_id;
|
RsGxsId gxs_id;
|
||||||
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
|
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
|
||||||
|
|
||||||
if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, QIcon(":/icons/bullet_yellow_128.png"));
|
if (RsGxsId(participant.toStdString()) == gxs_id) widgetitem->setIcon(COLUMN_ICON, bullet_yellow_128);
|
||||||
|
|
||||||
widgetitem->updateBannedState();
|
widgetitem->updateBannedState();
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,8 @@ private:
|
||||||
QAction *showinpeopleAct;
|
QAction *showinpeopleAct;
|
||||||
|
|
||||||
GxsIdChooser *ownIdChooser ;
|
GxsIdChooser *ownIdChooser ;
|
||||||
|
//icons cache
|
||||||
|
QIcon bullet_red_128, bullet_grey_128, bullet_green_128, bullet_yellow_128;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue