Style, in CGuiApplication sGui can be used as guard (no QPointer needed)

This commit is contained in:
Klaus Basan
2018-08-13 23:43:06 +02:00
parent 0327776edd
commit 755455e8a4
5 changed files with 39 additions and 53 deletions

View File

@@ -29,14 +29,14 @@ namespace BlackSimPlugin
ui->comp_SettingsXSwiftBus->setDefaultP2PAddress(m_xswiftbusServerSetting.getDefault());
ui->comp_SettingsXSwiftBus->set(m_xswiftbusServerSetting.getThreadLocal());
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::settingsAccepted);
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::onSettingsAccepted);
connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorXPlaneConfigWindow::close);
}
CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow()
{ }
void CSimulatorXPlaneConfigWindow::settingsAccepted()
void CSimulatorXPlaneConfigWindow::onSettingsAccepted()
{
const QString currentAddress = m_xswiftbusServerSetting.getThreadLocal();
if (currentAddress != ui->comp_SettingsXSwiftBus->getDBusAddress())
@@ -45,6 +45,5 @@ namespace BlackSimPlugin
}
close();
}
} // ns
} // ns

View File

@@ -18,8 +18,6 @@
#include <QObject>
#include <QScopedPointer>
class QWidget;
namespace Ui { class CSimulatorXPlaneConfigWindow; }
namespace BlackSimPlugin
{
@@ -40,7 +38,8 @@ namespace BlackSimPlugin
virtual ~CSimulatorXPlaneConfigWindow();
private:
void settingsAccepted();
//! Settings have been accepted
void onSettingsAccepted();
QScopedPointer<Ui::CSimulatorXPlaneConfigWindow> ui;
BlackMisc::CSetting<BlackMisc::Simulation::Settings::TXSwiftBusServer> m_xswiftbusServerSetting { this };