Fixes / improvements found during testing

* Redundant "simulatorStatusChanged" signal in proxy
* invokeMethod for timer
* removed redundant this->buildNavigator(1)
* Shortcut in GUI
* comment in variant
This commit is contained in:
Klaus Basan
2015-05-16 01:19:40 +02:00
parent 405de80945
commit c380b8df23
9 changed files with 39 additions and 11 deletions

View File

@@ -73,7 +73,14 @@ namespace BlackCore
void CAirspaceAnalyzer::gracefulShutdown() void CAirspaceAnalyzer::gracefulShutdown()
{ {
this->m_timer.stop(); bool s = QMetaObject::invokeMethod(&m_timer, "stop");
Q_ASSERT_X(s, Q_FUNC_INFO, "invoke failed");
Q_UNUSED(s);
}
CAirspaceAnalyzer::~CAirspaceAnalyzer()
{
gracefulShutdown();
} }
void CAirspaceAnalyzer::ps_watchdogTouchAircraftCallsign(const CAircraftSituation &situation, const CTransponder &transponder) void CAirspaceAnalyzer::ps_watchdogTouchAircraftCallsign(const CAircraftSituation &situation, const CTransponder &transponder)

View File

@@ -58,6 +58,9 @@ namespace BlackCore
//! Gracefully shut down, e.g. for thread safety //! Gracefully shut down, e.g. for thread safety
void gracefulShutdown(); void gracefulShutdown();
//! Destructor
virtual ~CAirspaceAnalyzer();
public slots: public slots:
//! Clear //! Clear
void clear(); void clear();

View File

@@ -18,7 +18,6 @@ using namespace BlackMisc::Aviation;
using namespace BlackMisc::Network; using namespace BlackMisc::Network;
using namespace BlackMisc::Geo; using namespace BlackMisc::Geo;
using namespace BlackMisc::Simulation; using namespace BlackMisc::Simulation;
using namespace BlackMisc::Simulation;
namespace BlackCore namespace BlackCore
{ {
@@ -36,9 +35,6 @@ namespace BlackCore
bool s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(), bool s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
"simulatorStatusChanged", this, SIGNAL(simulatorStatusChanged(int))); "simulatorStatusChanged", this, SIGNAL(simulatorStatusChanged(int)));
Q_ASSERT(s); Q_ASSERT(s);
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
"simulatorStatusChanged", this, SIGNAL(simulatorStatusChanged(int)));
Q_ASSERT(s);
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(), s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
"installedAircraftModelsChanged", this, SIGNAL(installedAircraftModelsChanged())); "installedAircraftModelsChanged", this, SIGNAL(installedAircraftModelsChanged()));
Q_ASSERT(s); Q_ASSERT(s);
@@ -52,7 +48,7 @@ namespace BlackCore
"renderRestrictionsChanged", this, SIGNAL(renderRestrictionsChanged(bool, int, BlackMisc::PhysicalQuantities::CLength, BlackMisc::PhysicalQuantities::CLength))); "renderRestrictionsChanged", this, SIGNAL(renderRestrictionsChanged(bool, int, BlackMisc::PhysicalQuantities::CLength, BlackMisc::PhysicalQuantities::CLength)));
Q_ASSERT(s); Q_ASSERT(s);
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(), s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
"simulatorPluginChanged", this, SIGNAL(simulatorPluginChanged(BlackMisc::Simulation::CSimulatorPluginInfo &))); "simulatorPluginChanged", this, SIGNAL(simulatorPluginChanged(BlackMisc::Simulation::CSimulatorPluginInfo)));
Q_ASSERT(s); Q_ASSERT(s);
s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(), s = connection.connect(serviceName, IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(),
"airspaceSnapshotHandled", this, SIGNAL(airspaceSnapshotHandled())); "airspaceSnapshotHandled", this, SIGNAL(airspaceSnapshotHandled()));

View File

@@ -41,7 +41,7 @@ namespace BlackGui
explicit CMappingComponent(QWidget *parent = nullptr); explicit CMappingComponent(QWidget *parent = nullptr);
//! Destructor //! Destructor
~CMappingComponent(); virtual ~CMappingComponent();
//! Number of current mappings //! Number of current mappings
int countCurrentMappings() const; int countCurrentMappings() const;

View File

@@ -31,7 +31,6 @@ namespace BlackGui
this->allowStatusBar(false); this->allowStatusBar(false);
ui->setupUi(this); ui->setupUi(this);
this->ps_onStyleSheetsChanged(); this->ps_onStyleSheetsChanged();
this->buildNavigator(1);
} }
CNavigatorDockWidget::~CNavigatorDockWidget() CNavigatorDockWidget::~CNavigatorDockWidget()
@@ -143,7 +142,7 @@ namespace BlackGui
int CNavigatorDockWidget::columnsForRows(int rows) int CNavigatorDockWidget::columnsForRows(int rows)
{ {
Q_ASSERT(rows >= 0); Q_ASSERT_X(rows >= 0, Q_FUNC_INFO, "no rows");
int items = this->m_widgets.size(); int items = this->m_widgets.size();
int c = items / rows; int c = items / rows;
return (c * rows) < items ? c + 1 : c; return (c * rows) < items ? c + 1 : c;

View File

@@ -34,7 +34,7 @@ namespace BlackGui
explicit CNavigatorDockWidget(QWidget *parent = nullptr); explicit CNavigatorDockWidget(QWidget *parent = nullptr);
//! Destructor //! Destructor
~CNavigatorDockWidget(); virtual ~CNavigatorDockWidget();
//! Add action as navigator item //! Add action as navigator item
void addAction(QAction * action); void addAction(QAction * action);

View File

@@ -2,6 +2,26 @@
<ui version="4.0"> <ui version="4.0">
<class>CNavigatorDockWidget</class> <class>CNavigatorDockWidget</class>
<widget class="QDockWidget" name="CNavigatorDockWidget"> <widget class="QDockWidget" name="CNavigatorDockWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>60</width>
<height>38</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>30</width>
<height>38</height>
</size>
</property>
<property name="floating"> <property name="floating">
<bool>true</bool> <bool>true</bool>
</property> </property>

View File

@@ -47,7 +47,7 @@ namespace BlackMisc
static void registerMetadata() static void registerMetadata()
{ {
Private::MetaTypeHelper<Derived>::maybeRegisterMetaType(); Private::MetaTypeHelper<Derived>::maybeRegisterMetaType();
//! \todo KB: What does this monster do? Please some comment // Details: https://dev.vatsim-germany.org/issues/413#note-6
[](...){}((qRegisterMetaType<AdditionalTypes>(), qDBusRegisterMetaType<AdditionalTypes>(), 0)...); [](...){}((qRegisterMetaType<AdditionalTypes>(), qDBusRegisterMetaType<AdditionalTypes>(), 0)...);
} }

View File

@@ -478,6 +478,9 @@
<property name="text"> <property name="text">
<string>Navigator</string> <string>Navigator</string>
</property> </property>
<property name="shortcut">
<string>Ctrl+W, Ctrl+N</string>
</property>
</action> </action>
<action name="menu_NavigatorHorizontal"> <action name="menu_NavigatorHorizontal">
<property name="text"> <property name="text">