mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
Ref T709 Prevent instantiation of CXSwiftBusSettingsQtFree, to avoid slicing.
- Constructors and destructor are protected. - Therefore destructor doesn't need to be virtual. - objectUpdated is pure virtual, so the class is abstract. - Both derived classes are declared final.
This commit is contained in:
@@ -24,16 +24,17 @@ namespace BlackMisc
|
||||
*/
|
||||
class CXSwiftBusSettingsQtFree
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
//! Constructor.
|
||||
CXSwiftBusSettingsQtFree();
|
||||
|
||||
//! JSON Constructor.
|
||||
CXSwiftBusSettingsQtFree(const std::string &json);
|
||||
|
||||
//! Dtor
|
||||
virtual ~CXSwiftBusSettingsQtFree() {}
|
||||
//! Destructor.
|
||||
~CXSwiftBusSettingsQtFree() = default;
|
||||
|
||||
public:
|
||||
//! DBus server
|
||||
const std::string &getDBusServerAddress() const { return m_dBusServerAddress; }
|
||||
|
||||
@@ -112,7 +113,7 @@ namespace BlackMisc
|
||||
//! @}
|
||||
|
||||
//! Object has been updated
|
||||
virtual void objectUpdated();
|
||||
virtual void objectUpdated() = 0;
|
||||
|
||||
std::string m_dBusServerAddress { "tcp:host=127.0.0.1,port=45001" }; //!< DBus server
|
||||
std::string m_nightTextureMode { "auto" }; //!< night texture mode
|
||||
|
||||
Reference in New Issue
Block a user