mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
prevent null crash
This commit is contained in:
parent
cbea43267e
commit
27969b6752
2 changed files with 12 additions and 5 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <QAction>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include "tab_message.h"
|
||||
#include "abstractclient.h"
|
||||
#include "chatview.h"
|
||||
|
|
@ -131,9 +132,15 @@ bool TabMessage::shouldShowSystemPopup(const Event_UserMessage &event) {
|
|||
}
|
||||
|
||||
void TabMessage::showSystemPopup(const Event_UserMessage &event) {
|
||||
disconnect(trayIcon, SIGNAL(messageClicked()), 0, 0);
|
||||
trayIcon->showMessage(tr("Private message from ") + otherUserInfo->name().c_str(), event.message().c_str());
|
||||
connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
|
||||
if (trayIcon) {
|
||||
disconnect(trayIcon, SIGNAL(messageClicked()), 0, 0);
|
||||
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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue