1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix circle settings crash regression

This commit is contained in:
TheSpiritXIII 2015-06-05 11:15:59 -04:00 committed by tux3
parent 334bc1ab17
commit d4acf29fc0
4 changed files with 8 additions and 11 deletions

View File

@ -25,7 +25,7 @@
#include "src/core/corestructs.h"
#include "core/toxid.h"
struct FriendWidget;
class FriendWidget;
class ChatForm;
class Friend : public QObject

View File

@ -368,7 +368,7 @@ private:
QString alias;
QString addr;
QString autoAcceptDir;
int circleIndex;
int circleIndex = -1;
};
struct circleProp

View File

@ -60,14 +60,11 @@ void FriendListWidget::addGroupWidget(GroupWidget *widget)
void FriendListWidget::addFriendWidget(FriendWidget *w, Status s, int circleIndex)
{
if (circleIndex == -1)
CircleWidget* circleWidget = CircleWidget::getFromID(circleIndex);
if (circleWidget == nullptr)
moveWidget(w, s, true);
else
{
CircleWidget::getFromID(circleIndex)->addFriendWidget(w, s);
CircleWidget::getFromID(circleIndex)->show();
//w->setParent(CircleWidget::getFromID(circleIndex));
}
circleWidget->addFriendWidget(w, s);
}
void FriendListWidget::addCircleWidget(int id)

View File

@ -27,7 +27,7 @@
class QPixmap;
class MaskablePixmapWidget;
struct FriendWidget final : public GenericChatroomWidget
class FriendWidget : public GenericChatroomWidget
{
Q_OBJECT
public:
@ -51,8 +51,8 @@ public slots:
void setAlias(const QString& alias);
protected:
virtual void mousePressEvent(QMouseEvent* ev) final override;
virtual void mouseMoveEvent(QMouseEvent* ev) final override;
virtual void mousePressEvent(QMouseEvent* ev) override;
virtual void mouseMoveEvent(QMouseEvent* ev) override;
void setFriendAlias();
void showEvent(QShowEvent *)
{