Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akregator
Commits
ea04b62a
Commit
ea04b62a
authored
Jan 08, 2021
by
Luigi Baldoni
Committed by
Laurent Montel
Jan 11, 2021
Browse files
Fix Bug 420520 - tray icon always shown
BUG: 420520
(thanks @Jari Kuittinen)
parent
9f2bee26
Pipeline
#47370
passed with stage
in 15 minutes and 41 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/akregator_part.cpp
View file @
ea04b62a
...
...
@@ -274,9 +274,7 @@ void Part::initializeTrayIcon()
TrayIcon
::
setInstance
(
trayIcon
);
m_actionManager
->
setTrayIcon
(
trayIcon
);
if
(
isTrayIconEnabled
())
{
trayIcon
->
setStatus
(
KStatusNotifierItem
::
Active
);
}
trayIcon
->
setEnabled
(
isTrayIconEnabled
());
connect
(
m_mainWidget
.
data
(),
&
MainWidget
::
signalUnreadCountChanged
,
trayIcon
,
&
TrayIcon
::
slotSetUnread
);
connect
(
m_mainWidget
.
data
(),
&
MainWidget
::
signalArticlesSelected
,
...
...
src/trayicon.cpp
View file @
ea04b62a
...
...
@@ -26,6 +26,16 @@ void TrayIcon::setInstance(TrayIcon *trayIcon)
m_instance
=
trayIcon
;
}
bool
TrayIcon
::
isEnabled
()
const
{
return
mEnabled
;
}
void
TrayIcon
::
setEnabled
(
bool
enabled
)
{
mEnabled
=
enabled
;
}
TrayIcon
::
TrayIcon
(
QObject
*
parent
)
:
KStatusNotifierItem
(
parent
)
{
...
...
@@ -40,7 +50,7 @@ TrayIcon::~TrayIcon()
void
TrayIcon
::
slotSetUnread
(
int
unread
)
{
if
(
m_unread
!=
unread
)
{
if
(
mEnabled
&&
m_unread
!=
unread
)
{
m_unread
=
unread
;
setToolTip
(
QStringLiteral
(
"akregator"
),
i18n
(
"Akregator"
),
unread
==
0
?
i18n
(
"There are no unread articles"
)
:
i18np
(
"1 unread article"
,
"%1 unread articles"
,
unread
));
...
...
src/trayicon.h
View file @
ea04b62a
...
...
@@ -20,6 +20,9 @@ public:
static
TrayIcon
*
getInstance
();
static
void
setInstance
(
TrayIcon
*
trayIcon
);
bool
isEnabled
()
const
;
void
setEnabled
(
bool
enabled
);
explicit
TrayIcon
(
QObject
*
parent
=
nullptr
);
~
TrayIcon
();
...
...
@@ -30,6 +33,7 @@ public Q_SLOTS:
private:
static
TrayIcon
*
m_instance
;
int
m_unread
=
0
;
bool
mEnabled
=
false
;
};
}
// namespace Akregator
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment