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

fixed infinite recursion under certain conditions

This commit is contained in:
krepa098 2014-10-15 17:35:58 +02:00
parent c4529d4062
commit 87132389aa
2 changed files with 9 additions and 2 deletions

View File

@ -52,6 +52,11 @@ Widget::Widget(QWidget *parent)
: QMainWindow(parent),
ui(new Ui::MainWindow),
activeChatroomWidget{nullptr}
{
}
void Widget::init()
{
ui->setupUi(this);
@ -214,7 +219,10 @@ Widget::~Widget()
Widget* Widget::getInstance()
{
if (!instance)
{
instance = new Widget();
instance->init();
}
return instance;
}
@ -465,7 +473,6 @@ void Widget::setUsername(const QString& username)
{
ui->nameLabel->setText(username);
ui->nameLabel->setToolTip(username); // for overlength names
settingsWidget->getIdentityForm()->setUserName(username);
}
void Widget::onStatusMessageChanged(const QString& newStatusMessage, const QString& oldStatusMessage)
@ -479,7 +486,6 @@ void Widget::setStatusMessage(const QString &statusMessage)
{
ui->statusLabel->setText(statusMessage);
ui->statusLabel->setToolTip(statusMessage); // for overlength messsages
settingsWidget->getIdentityForm()->setStatusMessage(statusMessage);
}
void Widget::addFriend(int friendId, const QString &userId)

View File

@ -54,6 +54,7 @@ public:
QThread* getCoreThread();
Camera* getCamera();
static Widget* getInstance();
void init();
void newMessageAlert();
bool isFriendWidgetCurActiveWidget(Friend* f);
bool getIsWindowMinimized();