1
0
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:
sudden6 2016-06-11 20:45:38 +02:00
commit 5e5e27cf60
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
6 changed files with 6 additions and 4 deletions

View File

@ -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");

View File

@ -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();

View File

@ -100,6 +100,7 @@ SystemTrayIcon::SystemTrayIcon()
SystemTrayIcon::~SystemTrayIcon()
{
qDebug() << "Deleting SystemTrayIcon";
delete qtIcon;
}
QString SystemTrayIcon::extractIconToFile(QIcon icon, QString name)

View File

@ -47,7 +47,7 @@ private:
private:
SystrayBackendType backendType;
QSystemTrayIcon* qtIcon;
QSystemTrayIcon* qtIcon = nullptr;
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
AppIndicator *unityIndicator;

View File

@ -507,6 +507,7 @@ Widget::~Widget()
if (icon)
icon->hide();
delete icon;
delete profileForm;
delete settingsWidget;
delete addFriendForm;

View File

@ -234,7 +234,7 @@ private:
void focusChatInput();
private:
SystemTrayIcon *icon;
SystemTrayIcon *icon = nullptr;
QMenu *trayMenu;
QAction *statusOnline;
QAction *statusAway;