Commit c3a230c9 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

ViewContainer: take into account Profile::BellMode when setting tab icon

If the BellMode Profile property is set to NoBell, don't change the tab
icon on Bell events.

CCBUG: 425759
parent de9e92b8
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "profile/ProfileList.h" #include "profile/ProfileList.h"
#include "KonsoleSettings.h" #include "KonsoleSettings.h"
#include "session/SessionController.h" #include "session/SessionController.h"
#include "session/SessionManager.h"
#include "DetachableTabBar.h" #include "DetachableTabBar.h"
#include "terminalDisplay/TerminalDisplay.h" #include "terminalDisplay/TerminalDisplay.h"
#include "widgets/ViewSplitter.h" #include "widgets/ViewSplitter.h"
...@@ -551,12 +552,17 @@ void TabbedViewContainer::updateIcon(ViewProperties *item) ...@@ -551,12 +552,17 @@ void TabbedViewContainer::updateIcon(ViewProperties *item)
// the status // the status
// 3. Active view icon // 3. Active view icon
QIcon icon; QIcon icon = item->icon();
if (state.notification != Session::NoNotification) { if (state.notification != Session::NoNotification) {
switch(state.notification) { switch(state.notification) {
case Session::Bell: case Session::Bell: {
icon = QIcon::fromTheme(QLatin1String("notifications")); auto session = controller->session();
break; auto profilePtr = SessionManager::instance()->sessionProfile(session);
if (profilePtr->property<int>(Profile::BellMode) != Enum::NoBell) {
icon = QIcon::fromTheme(QLatin1String("notifications"));
}
}
break;
case Session::Activity: case Session::Activity:
icon = QIcon::fromTheme(QLatin1String("dialog-information")); icon = QIcon::fromTheme(QLatin1String("dialog-information"));
break; break;
...@@ -570,8 +576,6 @@ void TabbedViewContainer::updateIcon(ViewProperties *item) ...@@ -570,8 +576,6 @@ void TabbedViewContainer::updateIcon(ViewProperties *item)
icon = QIcon::fromTheme(QLatin1String("irc-voice")); icon = QIcon::fromTheme(QLatin1String("irc-voice"));
} else if (state.readOnly) { } else if (state.readOnly) {
icon = QIcon::fromTheme(QLatin1String("object-locked")); icon = QIcon::fromTheme(QLatin1String("object-locked"));
} else {
icon = item->icon();
} }
if (tabIcon(index).name() != icon.name()) { if (tabIcon(index).name() != icon.name()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment