refs #628 Use the metaclass mixins in all value classes.

This commit is contained in:
Mathew Sutcliffe
2016-04-02 17:34:18 +01:00
parent 4f3637a046
commit 4bd4baa535
82 changed files with 629 additions and 560 deletions

View File

@@ -148,8 +148,6 @@ namespace BlackCore
static CGlobalSetup fromJsonFile(const QString &fileNameAndPath);
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackCore::Data::CGlobalSetup)
bool m_wasLoaded = false; //!< Loaded from web
int m_dbHttpPort = 80; //!< port
int m_dbHttpsPort = 443; //!< SSL port
@@ -165,6 +163,23 @@ namespace BlackCore
// transient members, to be switched on/off via GUI or set from reader
bool m_dbDebugFlag = false; //!< can trigger DEBUG on the server, so you need to know what you are doing
BLACK_METACLASS(CGlobalSetup,
BLACK_METAMEMBER(wasLoaded),
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(dbRootDirectoryUrl),
BLACK_METAMEMBER(dbHttpPort),
BLACK_METAMEMBER(dbHttpsPort),
BLACK_METAMEMBER(vatsimStatusFileUrls),
BLACK_METAMEMBER(vatsimDataFileUrls),
BLACK_METAMEMBER(vatsimBookingsUrl),
BLACK_METAMEMBER(vatsimMetarsUrls),
BLACK_METAMEMBER(sharedUrls),
BLACK_METAMEMBER(newsUrls),
BLACK_METAMEMBER(fsdTestServers),
BLACK_METAMEMBER(development),
BLACK_METAMEMBER(dbDebugFlag, BlackMisc::DisabledForJson)
);
};
//! Trait for global setup data
@@ -185,20 +200,5 @@ namespace BlackCore
} // ns
Q_DECLARE_METATYPE(BlackCore::Data::CGlobalSetup)
BLACK_DECLARE_TUPLE_CONVERSION(BlackCore::Data::CGlobalSetup, (
attr(o.m_wasLoaded),
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_dbRootDirectoryUrl),
attr(o.m_dbHttpPort),
attr(o.m_dbHttpsPort),
attr(o.m_vatsimStatusFileUrls),
attr(o.m_vatsimDataFileUrls),
attr(o.m_vatsimBookingsUrl),
attr(o.m_vatsimMetarsUrls),
attr(o.m_sharedUrls),
attr(o.m_newsUrls),
attr(o.m_fsdTestServers),
attr(o.m_development),
attr(o.m_dbDebugFlag, flags < DisabledForJson > ())
))
#endif // guard

View File

@@ -91,8 +91,6 @@ namespace BlackCore
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackCore::Data::CUpdateInfo)
bool m_development = false; //!< for development
BlackMisc::Network::CUrlList m_downloadsStableUrls; //!< Download URLs, here I get the installer
BlackMisc::Network::CUrlList m_downloadsBetaUrls; //!< Download URLs, here I get the installer
@@ -100,6 +98,17 @@ namespace BlackCore
QString m_lastSupportedVersionStable; //!< last supported version
QString m_latestVersionBeta; //!< latest version
QString m_lastSupportedVersionBeta; //!< last supported version
BLACK_METACLASS(CUpdateInfo,
BLACK_METAMEMBER(timestampMSecsSinceEpoch),
BLACK_METAMEMBER(development),
BLACK_METAMEMBER(downloadsStableUrls),
BLACK_METAMEMBER(downloadsBetaUrls),
BLACK_METAMEMBER(latestVersionStable),
BLACK_METAMEMBER(lastSupportedVersionStable),
BLACK_METAMEMBER(latestVersionBeta),
BLACK_METAMEMBER(lastSupportedVersionBeta)
);
};
//! Trait for global setup data
@@ -120,14 +129,5 @@ namespace BlackCore
} // ns
Q_DECLARE_METATYPE(BlackCore::Data::CUpdateInfo)
BLACK_DECLARE_TUPLE_CONVERSION(BlackCore::Data::CUpdateInfo, (
attr(o.m_timestampMSecsSinceEpoch),
attr(o.m_development),
attr(o.m_downloadsStableUrls),
attr(o.m_downloadsBetaUrls),
attr(o.m_latestVersionStable),
attr(o.m_lastSupportedVersionStable),
attr(o.m_latestVersionBeta),
attr(o.m_lastSupportedVersionBeta)
))
#endif // guard

View File

@@ -96,14 +96,22 @@ namespace BlackCore
void setPropertyByIndex(const BlackMisc::CVariant &variant, const BlackMisc::CPropertyIndex &index);
private:
BLACK_ENABLE_TUPLE_CONVERSION(BlackCore::Data::CVatsimSetup)
BlackMisc::Network::CUrlList m_serverFileUrls; //!< only the FSD servers
BlackMisc::Network::CUrlList m_dataFileUrls; //!< Full VATSIM files
BlackMisc::Network::CUrlList m_metarFileUrls; //!< METAR files
BlackMisc::Network::CServerList m_fsdServers; //!< FSD test servers
BlackMisc::Network::CServerList m_voiceServers; //!< voice servers
BlackMisc::Network::CUser m_lastLoginUser; //!< last login user
BLACK_METACLASS(CVatsimSetup,
BLACK_METAMEMBER(serverFileUrls),
BLACK_METAMEMBER(dataFileUrls),
BLACK_METAMEMBER(metarFileUrls),
BLACK_METAMEMBER(fsdServers),
BLACK_METAMEMBER(voiceServers),
BLACK_METAMEMBER(lastLoginUser),
BLACK_METAMEMBER(timestampMSecsSinceEpoch)
);
};
//! Trait for global setup data
@@ -124,13 +132,5 @@ namespace BlackCore
} // ns
Q_DECLARE_METATYPE(BlackCore::Data::CVatsimSetup)
BLACK_DECLARE_TUPLE_CONVERSION(BlackCore::Data::CVatsimSetup, (
attr(o.m_serverFileUrls),
attr(o.m_dataFileUrls),
attr(o.m_metarFileUrls),
attr(o.m_fsdServers),
attr(o.m_voiceServers),
attr(o.m_lastLoginUser),
attr(o.m_timestampMSecsSinceEpoch)
))
#endif // guard