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

View File

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

View File

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