From 50a85109a0b471b58c48add71cf02f478ba785a5 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 29 Aug 2013 14:01:23 -0400 Subject: [PATCH] Improvements to NewIMsPerConversation mechaics and includes cleanup in lloverlaybar.cpp --- indra/newview/lloverlaybar.cpp | 42 ++++++++++------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index 07357d32a..c43dfb42e 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -39,21 +39,13 @@ #include "aoremotectrl.h" #include "llaudioengine.h" -#include "importtracker.h" -#include "llrender.h" #include "llagent.h" #include "llagentcamera.h" -#include "llbutton.h" #include "llchatbar.h" -#include "llfocusmgr.h" -#include "llimpanel.h" -#include "llimview.h" +#include "llfloaterchatterbox.h" #include "llmediaremotectrl.h" #include "llpanelaudiovolume.h" #include "llparcel.h" -#include "lltextbox.h" -#include "llui.h" -#include "llviewercontrol.h" #include "llviewertexturelist.h" #include "llviewerjoystick.h" #include "llviewermedia.h" @@ -62,20 +54,13 @@ #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" #include "lluictrlfactory.h" -#include "llviewercontrol.h" -#include "llviewerwindow.h" #include "llvoiceclient.h" #include "llvoavatarself.h" #include "llvoiceremotectrl.h" -#include "llmediactrl.h" #include "llselectmgr.h" #include "wlfPanel_AdvSettings.h" #include "llpanelnearbymedia.h" - - -#include "llcontrol.h" - // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -309,21 +294,18 @@ void LLOverlayBar::refresh() { bool buttons_changed = FALSE; - if (LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived())) + int count(0); + static const LLCachedControl per_conversation("NewIMsPerConversation"); + if (per_conversation && !LLFloaterChatterBox::instanceVisible()) { - int unread_count(0); - static const LLCachedControl per_conversation("NewIMsPerConversation"); - if (per_conversation) - { - for(std::set >::const_iterator it = gIMMgr->getIMFloaterHandles().begin(); it != gIMMgr->getIMFloaterHandles().end(); ++it) - if (LLFloaterIMPanel* im_floater = static_cast(it->get())) - if (im_floater->getParent() != gFloaterView && im_floater->getNumUnreadMessages()) // Only count docked IMs - ++unread_count; - } - else - { - unread_count = gIMMgr->getIMUnreadCount(); - } + for(std::set >::const_iterator it = gIMMgr->getIMFloaterHandles().begin(); it != gIMMgr->getIMFloaterHandles().end(); ++it) + if (LLFloaterIMPanel* im_floater = static_cast(it->get())) + if (im_floater->getParent() != gFloaterView && im_floater->getNumUnreadMessages()) // Only count docked IMs + ++count; + } + if (LLButton* button = updateButtonVisiblity(mNewIM, per_conversation ? count : gIMMgr->getIMReceived())) + { + int unread_count(per_conversation ? count : gIMMgr->getIMUnreadCount()); if (unread_count > 0) {