Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
27969b67
Commit
27969b67
authored
Mar 15, 2016
by
Zach H
Browse files
prevent null crash
parent
cbea4326
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/tab_message.cpp
View file @
27969b67
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include
<QAction>
#include
<QAction>
#include
<QSystemTrayIcon>
#include
<QSystemTrayIcon>
#include
<QApplication>
#include
<QApplication>
#include
<QDebug>
#include
"tab_message.h"
#include
"tab_message.h"
#include
"abstractclient.h"
#include
"abstractclient.h"
#include
"chatview.h"
#include
"chatview.h"
...
@@ -131,9 +132,15 @@ bool TabMessage::shouldShowSystemPopup(const Event_UserMessage &event) {
...
@@ -131,9 +132,15 @@ bool TabMessage::shouldShowSystemPopup(const Event_UserMessage &event) {
}
}
void
TabMessage
::
showSystemPopup
(
const
Event_UserMessage
&
event
)
{
void
TabMessage
::
showSystemPopup
(
const
Event_UserMessage
&
event
)
{
disconnect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
0
,
0
);
if
(
trayIcon
)
{
trayIcon
->
showMessage
(
tr
(
"Private message from "
)
+
otherUserInfo
->
name
().
c_str
(),
event
.
message
().
c_str
());
disconnect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
0
,
0
);
connect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
this
,
SLOT
(
messageClicked
()));
trayIcon
->
showMessage
(
tr
(
"Private message from "
)
+
otherUserInfo
->
name
().
c_str
(),
event
.
message
().
c_str
());
connect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
this
,
SLOT
(
messageClicked
()));
}
else
{
qDebug
()
<<
"Error: trayIcon is NULL. TabMessage::showSystemPopup failed"
;
}
}
}
void
TabMessage
::
messageClicked
()
{
void
TabMessage
::
messageClicked
()
{
...
...
cockatrice/src/tab_room.cpp
View file @
27969b67
...
@@ -160,8 +160,8 @@ void TabRoom::focusTab() {
...
@@ -160,8 +160,8 @@ void TabRoom::focusTab() {
}
}
void
TabRoom
::
actShowMentionPopup
(
QString
&
sender
)
{
void
TabRoom
::
actShowMentionPopup
(
QString
&
sender
)
{
if
(
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
)
if
(
trayIcon
&&
(
tabSupervisor
->
currentIndex
()
!=
tabSupervisor
->
indexOf
(
this
)
||
QApplication
::
activeWindow
()
==
0
||
QApplication
::
activeWindow
()
==
0
||
QApplication
::
focusWidget
()
==
0
)
{
||
QApplication
::
focusWidget
()
==
0
)
)
{
disconnect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
0
,
0
);
disconnect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
0
,
0
);
trayIcon
->
showMessage
(
sender
+
tr
(
" mentioned you."
),
tr
(
"Click to view"
));
trayIcon
->
showMessage
(
sender
+
tr
(
" mentioned you."
),
tr
(
"Click to view"
));
connect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
chatView
,
SLOT
(
actMessageClicked
()));
connect
(
trayIcon
,
SIGNAL
(
messageClicked
()),
chatView
,
SLOT
(
actMessageClicked
()));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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