summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2019-04-02 19:59:44 -0400
committerGitHub <noreply@github.com>2019-04-02 19:59:44 -0400
commita2df9beb9f0493eea58a5ef1fe211e2a7932b590 (patch)
tree69dc532523c4a3535ad763577a7e7ac88500b832 /Source
parent8e1fb126d711f7dcecbf16725d35b06cdc8f18b9 (diff)
parentd106169a83853c94b999d185b61cee6bf5d8fee2 (diff)
Merge pull request #7924 from jordan-woyak/info-widget-fix
DolphinQt: Fix unused widgets in InfoWidget from being visible.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Config/InfoWidget.cpp30
-rw-r--r--Source/Core/DolphinQt/Config/InfoWidget.h6
-rw-r--r--Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.cpp4
-rw-r--r--Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.h2
-rw-r--r--Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.cpp4
-rw-r--r--Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.h2
6 files changed, 22 insertions, 26 deletions
diff --git a/Source/Core/DolphinQt/Config/InfoWidget.cpp b/Source/Core/DolphinQt/Config/InfoWidget.cpp
index 79b980e52a..d819d0b6d1 100644
--- a/Source/Core/DolphinQt/Config/InfoWidget.cpp
+++ b/Source/Core/DolphinQt/Config/InfoWidget.cpp
@@ -102,24 +102,23 @@ QGroupBox* InfoWidget::CreateBannerDetails()
layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
- m_name = CreateValueDisplay();
- m_maker = CreateValueDisplay();
- m_description = new QTextEdit(group);
- m_description->setReadOnly(true);
CreateLanguageSelector();
-
layout->addRow(tr("Show Language:"), m_language_selector);
+
if (m_game.GetPlatform() == DiscIO::Platform::GameCubeDisc)
{
- layout->addRow(tr("Name:"), m_name);
- layout->addRow(tr("Maker:"), m_maker);
- layout->addRow(tr("Description:"), m_description);
+ layout->addRow(tr("Name:"), m_name = CreateValueDisplay());
+ layout->addRow(tr("Maker:"), m_maker = CreateValueDisplay());
+ layout->addRow(tr("Description:"), m_description = new QTextEdit());
+ m_description->setReadOnly(true);
}
else if (DiscIO::IsWii(m_game.GetPlatform()))
{
- layout->addRow(tr("Name:"), m_name);
+ layout->addRow(tr("Name:"), m_name = CreateValueDisplay());
}
+ ChangeLanguage();
+
QPixmap banner = ToQPixmap(m_game.GetBannerImage());
if (!banner.isNull())
layout->addRow(tr("Banner:"), CreateBannerGraphic(banner));
@@ -183,16 +182,21 @@ void InfoWidget::CreateLanguageSelector()
connect(m_language_selector,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&InfoWidget::ChangeLanguage);
- ChangeLanguage();
}
void InfoWidget::ChangeLanguage()
{
DiscIO::Language language =
static_cast<DiscIO::Language>(m_language_selector->currentData().toInt());
- m_name->setText(QString::fromStdString(m_game.GetLongName(language)));
- m_maker->setText(QString::fromStdString(m_game.GetLongMaker(language)));
- m_description->setText(QString::fromStdString(m_game.GetDescription(language)));
+
+ if (m_name)
+ m_name->setText(QString::fromStdString(m_game.GetLongName(language)));
+
+ if (m_maker)
+ m_maker->setText(QString::fromStdString(m_game.GetLongMaker(language)));
+
+ if (m_description)
+ m_description->setText(QString::fromStdString(m_game.GetDescription(language)));
}
QWidget* InfoWidget::CreateChecksumComputer()
diff --git a/Source/Core/DolphinQt/Config/InfoWidget.h b/Source/Core/DolphinQt/Config/InfoWidget.h
index b6fd934290..6827fd162f 100644
--- a/Source/Core/DolphinQt/Config/InfoWidget.h
+++ b/Source/Core/DolphinQt/Config/InfoWidget.h
@@ -38,7 +38,7 @@ private:
UICommon::GameFile m_game;
QLineEdit* m_checksum_result;
QComboBox* m_language_selector;
- QLineEdit* m_name;
- QLineEdit* m_maker;
- QTextEdit* m_description;
+ QLineEdit* m_name = {};
+ QLineEdit* m_maker = {};
+ QTextEdit* m_description = {};
};
diff --git a/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.cpp b/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.cpp
index 7a9b8cf1de..993da44f62 100644
--- a/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.cpp
+++ b/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.cpp
@@ -6,10 +6,6 @@
#include "DolphinQt/QtUtils/DoubleClickEventFilter.h"
-DoubleClickEventFilter::DoubleClickEventFilter(QObject* parent) : QObject(parent)
-{
-}
-
bool DoubleClickEventFilter::eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::MouseButtonDblClick)
diff --git a/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.h b/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.h
index 548262bd88..2517801514 100644
--- a/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.h
+++ b/Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.h
@@ -10,7 +10,7 @@ class DoubleClickEventFilter : public QObject
{
Q_OBJECT
public:
- explicit DoubleClickEventFilter(QObject* parent);
+ using QObject::QObject;
signals:
void doubleClicked();
diff --git a/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.cpp b/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.cpp
index a3819e24b4..74907c46d6 100644
--- a/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.cpp
+++ b/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.cpp
@@ -7,10 +7,6 @@
#include "DolphinQt/QtUtils/WindowActivationEventFilter.h"
-WindowActivationEventFilter::WindowActivationEventFilter(QObject* parent) : QObject(parent)
-{
-}
-
bool WindowActivationEventFilter::eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::WindowDeactivate)
diff --git a/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.h b/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.h
index 49c467c8be..b7f09a8898 100644
--- a/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.h
+++ b/Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.h
@@ -10,7 +10,7 @@ class WindowActivationEventFilter : public QObject
{
Q_OBJECT
public:
- explicit WindowActivationEventFilter(QObject* parent);
+ using QObject::QObject;
signals:
void windowActivated();