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

refactor: Remove unused 'SettingsWidget' from 'ContentDialog'

This commit is contained in:
Diadlo 2017-10-30 21:35:54 +03:00
parent 47da91d74f
commit 62c60a89df
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
3 changed files with 5 additions and 9 deletions

View File

@ -39,7 +39,6 @@
#include "src/grouplist.h" #include "src/grouplist.h"
#include "src/persistence/settings.h" #include "src/persistence/settings.h"
#include "src/widget/form/chatform.h" #include "src/widget/form/chatform.h"
#include "src/widget/form/settingswidget.h"
#include "src/widget/friendlistlayout.h" #include "src/widget/friendlistlayout.h"
#include "src/widget/translator.h" #include "src/widget/translator.h"
#include "tool/adjustingscrollarea.h" #include "tool/adjustingscrollarea.h"
@ -54,12 +53,11 @@ static const int minHeight = 220;
static const QSize minSize(minHeight, minWidget); static const QSize minSize(minHeight, minWidget);
static const QSize defaultSize(720, 400); static const QSize defaultSize(720, 400);
ContentDialog::ContentDialog(SettingsWidget* settingsWidget, QWidget* parent) ContentDialog::ContentDialog(QWidget* parent)
: ActivateDialog(parent, Qt::Window) : ActivateDialog(parent, Qt::Window)
, splitter{new QSplitter(this)} , splitter{new QSplitter(this)}
, friendLayout{new FriendListLayout(this)} , friendLayout{new FriendListLayout(this)}
, activeChatroomWidget(nullptr) , activeChatroomWidget(nullptr)
, settingsWidget(settingsWidget)
, videoSurfaceSize(QSize()) , videoSurfaceSize(QSize())
, videoCount(0) , videoCount(0)
{ {
@ -684,7 +682,7 @@ void ContentDialog::keyPressEvent(QKeyEvent* event)
*/ */
void ContentDialog::openNewDialog(GenericChatroomWidget* widget) void ContentDialog::openNewDialog(GenericChatroomWidget* widget)
{ {
ContentDialog* contentDialog = new ContentDialog(settingsWidget); ContentDialog* contentDialog = new ContentDialog();
contentDialog->show(); contentDialog->show();
if (widget->getFriend()) { if (widget->getFriend()) {

View File

@ -38,7 +38,6 @@ class GenericChatroomWidget;
class FriendWidget; class FriendWidget;
class GroupWidget; class GroupWidget;
class FriendListLayout; class FriendListLayout;
class SettingsWidget;
class Friend; class Friend;
class Group; class Group;
@ -48,8 +47,8 @@ class ContentDialog : public ActivateDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
ContentDialog(SettingsWidget* settingsWidget, QWidget* parent = 0); explicit ContentDialog(QWidget* parent = nullptr);
~ContentDialog(); ~ContentDialog() override;
FriendWidget* addFriend(const Friend* f); FriendWidget* addFriend(const Friend* f);
GroupWidget* addGroup(int groupId, const QString& name); GroupWidget* addGroup(int groupId, const QString& name);
@ -126,7 +125,6 @@ private:
GenericChatItemLayout groupLayout; GenericChatItemLayout groupLayout;
ContentLayout* contentLayout; ContentLayout* contentLayout;
GenericChatroomWidget* activeChatroomWidget; GenericChatroomWidget* activeChatroomWidget;
SettingsWidget* settingsWidget;
QSize videoSurfaceSize; QSize videoSurfaceSize;
int videoCount; int videoCount;

View File

@ -1550,7 +1550,7 @@ void Widget::toggleFullscreen()
ContentDialog* Widget::createContentDialog() const ContentDialog* Widget::createContentDialog() const
{ {
ContentDialog* contentDialog = new ContentDialog(settingsWidget); ContentDialog* contentDialog = new ContentDialog();
connect(contentDialog, &ContentDialog::friendDialogShown, this, &Widget::onFriendDialogShown); connect(contentDialog, &ContentDialog::friendDialogShown, this, &Widget::onFriendDialogShown);
connect(contentDialog, &ContentDialog::groupDialogShown, this, &Widget::onGroupDialogShown); connect(contentDialog, &ContentDialog::groupDialogShown, this, &Widget::onGroupDialogShown);
connect(Core::getInstance(), &Core::usernameSet, contentDialog, &ContentDialog::setUsername); connect(Core::getInstance(), &Core::usernameSet, contentDialog, &ContentDialog::setUsername);