refs #452, adjusted aircraft/aviation classes

* support for loading from datastore
* improved timestamp handling
* new color and country classes
* new attributes
* updates for missing parts in CUser
This commit is contained in:
Klaus Basan
2015-09-23 03:20:36 +02:00
committed by Mathew Sutcliffe
parent c5f7179588
commit ae24700299
45 changed files with 2762 additions and 401 deletions

View File

@@ -28,19 +28,40 @@ namespace BlackMisc
//! Property index
enum ColumnIndex
{
IndexDbIntergerKey = CPropertyIndex::GlobalIndexIDatastoreInteger
IndexDbIntegerKey = CPropertyIndex::GlobalIndexIDatastoreInteger
};
//! Get DB key.
int getDbKey() const { return m_dbKey; }
//! DB key as string
QString getDbKeyAsString() const;
//! Db ley in parentheses, e.g. "(3)"
QString getDbKeyAsStringInParentheses() const;
//! Set the DB key
void setDbKey(int key) { m_dbKey = key; }
//! DB key passed as string
void setDbKey(const QString &key);
//! Has valid DB key
bool hasValidDbKey() const { return m_dbKey >= 0; }
protected:
//! Constructor
IDatastoreObjectWithIntegerKey() {}
//! Constructor
IDatastoreObjectWithIntegerKey(int key) : m_dbKey(key) {}
//! Set key and timestamp values
void setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
//! Is a key available?
static bool existsKey(const QJsonObject &json, const QString &prefix = QString());
//! \copydoc CValueObject::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
@@ -75,6 +96,18 @@ namespace BlackMisc
bool hasValidDbKey() const { return !m_dbKey.isEmpty(); }
protected:
//! Constructor
IDatastoreObjectWithStringKey() {}
//! Constructor
IDatastoreObjectWithStringKey(const QString &key) : m_dbKey(key) {}
//! Set key and timestamp values
void setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
//! Is a key available?
static bool existsKey(const QJsonObject &json, const QString &prefix = QString());
//! \copydoc CValueObject::propertyByIndex
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;