mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge pull request #3365
PafXUS (4): fix(widget): delete icon in destructor fix(systemtrayicon): delete qtIcon in destructor fix(profileform): set parent for validator fix(friendwidget): check pointer before using it
This commit is contained in:
commit
5e5e27cf60
|
@ -93,7 +93,7 @@ ProfileForm::ProfileForm(QWidget *parent) :
|
|||
bodyUI->qrLabel->setWordWrap(true);
|
||||
|
||||
QRegExp re("[^@ ]+");
|
||||
QRegExpValidator* validator = new QRegExpValidator(re);
|
||||
QRegExpValidator* validator = new QRegExpValidator(re, this);
|
||||
bodyUI->toxmeUsername->setValidator(validator);
|
||||
|
||||
profilePicture = new MaskablePixmapWidget(this, QSize(64, 64), ":/img/avatar_mask.svg");
|
||||
|
|
|
@ -78,7 +78,7 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
|||
if (contentDialog == nullptr || notAlone)
|
||||
openChatWindow = menu.addAction(tr("Open chat in new window"));
|
||||
|
||||
if (contentDialog->hasFriendWidget(friendId, this))
|
||||
if (contentDialog != nullptr && contentDialog->hasFriendWidget(friendId, this))
|
||||
removeChatWindow = menu.addAction(tr("Remove chat from this window"));
|
||||
|
||||
menu.addSeparator();
|
||||
|
|
|
@ -100,6 +100,7 @@ SystemTrayIcon::SystemTrayIcon()
|
|||
SystemTrayIcon::~SystemTrayIcon()
|
||||
{
|
||||
qDebug() << "Deleting SystemTrayIcon";
|
||||
delete qtIcon;
|
||||
}
|
||||
|
||||
QString SystemTrayIcon::extractIconToFile(QIcon icon, QString name)
|
||||
|
|
|
@ -47,7 +47,7 @@ private:
|
|||
|
||||
private:
|
||||
SystrayBackendType backendType;
|
||||
QSystemTrayIcon* qtIcon;
|
||||
QSystemTrayIcon* qtIcon = nullptr;
|
||||
|
||||
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
|
||||
AppIndicator *unityIndicator;
|
||||
|
|
|
@ -507,6 +507,7 @@ Widget::~Widget()
|
|||
if (icon)
|
||||
icon->hide();
|
||||
|
||||
delete icon;
|
||||
delete profileForm;
|
||||
delete settingsWidget;
|
||||
delete addFriendForm;
|
||||
|
|
|
@ -234,7 +234,7 @@ private:
|
|||
void focusChatInput();
|
||||
|
||||
private:
|
||||
SystemTrayIcon *icon;
|
||||
SystemTrayIcon *icon = nullptr;
|
||||
QMenu *trayMenu;
|
||||
QAction *statusOnline;
|
||||
QAction *statusAway;
|
||||
|
|
Loading…
Reference in New Issue
Block a user