mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: remove Core::getInstance from SettingsWidget
This commit is contained in:
parent
c1ec6bc649
commit
2809cd91f5
|
@ -41,10 +41,10 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
SettingsWidget::SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Widget* parent)
|
||||
SettingsWidget::SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Core* core, Widget* parent)
|
||||
: QWidget(parent, Qt::Window)
|
||||
{
|
||||
CoreAV* coreAV = Core::getInstance()->getAv();
|
||||
CoreAV* coreAV = core->getAv();
|
||||
IAudioSettings* audioSettings = &Settings::getInstance();
|
||||
IVideoSettings* videoSettings = &Settings::getInstance();
|
||||
CameraSource& camera = CameraSource::getInstance();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <memory>
|
||||
|
||||
class Camera;
|
||||
class Core;
|
||||
class GenericForm;
|
||||
class GeneralForm;
|
||||
class IAudioControl;
|
||||
|
@ -43,7 +44,7 @@ class SettingsWidget : public QWidget
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Widget* parent = nullptr);
|
||||
SettingsWidget(UpdateCheck* updateCheck, IAudioControl& audio, Core *core, Widget* parent = nullptr);
|
||||
~SettingsWidget();
|
||||
|
||||
bool isShown() const;
|
||||
|
|
|
@ -276,16 +276,18 @@ void Widget::init()
|
|||
filesForm = new FilesForm();
|
||||
addFriendForm = new AddFriendForm;
|
||||
groupInviteForm = new GroupInviteForm;
|
||||
|
||||
core = Nexus::getCore();
|
||||
|
||||
#if UPDATE_CHECK_ENABLED
|
||||
updateCheck = std::unique_ptr<UpdateCheck>(new UpdateCheck(settings));
|
||||
connect(updateCheck.get(), &UpdateCheck::updateAvailable, this, &Widget::onUpdateAvailable);
|
||||
#endif
|
||||
settingsWidget = new SettingsWidget(updateCheck.get(), audio, this);
|
||||
settingsWidget = new SettingsWidget(updateCheck.get(), audio, core, this);
|
||||
#if UPDATE_CHECK_ENABLED
|
||||
updateCheck->checkForUpdate();
|
||||
#endif
|
||||
|
||||
core = Nexus::getCore();
|
||||
CoreFile* coreFile = core->getCoreFile();
|
||||
Profile* profile = Nexus::getProfile();
|
||||
profileInfo = new ProfileInfo(core, profile);
|
||||
|
|
Loading…
Reference in New Issue
Block a user