Commit bf2224d8 authored by Karel Slaný's avatar Karel Slaný
Browse files

Renamed some enumeration type values.

parent da6cc3cb
......@@ -3427,10 +3427,10 @@ class Isds::DTInfoOutputPrivate {
//Q_DISABLE_COPY(DTInfoOutputPrivate)
public:
DTInfoOutputPrivate(void)
: m_actDTType(Type::DTT_NULL), m_actDTCapacity(-1), m_actDTFrom(),
m_actDTTo(), m_actDTCapUsed(-1), m_futDTType(Type::DTT_NULL),
: m_actDTType(Type::DTT_UNKNOWN), m_actDTCapacity(-1), m_actDTFrom(),
m_actDTTo(), m_actDTCapUsed(-1), m_futDTType(Type::DTT_UNKNOWN),
m_futDTCapacity(-1), m_futDTFrom(), m_futDTTo(),
m_futDTPaid(Type::FDTPS_NULL)
m_futDTPaid(Type::FDTPS_UNKNOWN)
{ }
DTInfoOutputPrivate &operator=(const DTInfoOutputPrivate &other) Q_DECL_NOTHROW
......@@ -3570,7 +3570,7 @@ enum Isds::Type::DTType Isds::DTInfoOutput::actDTType(void) const
{
Q_D(const DTInfoOutput);
if (Q_UNLIKELY(d == Q_NULLPTR)) {
return Type::DTT_NULL;
return Type::DTT_UNKNOWN;
}
return d->m_actDTType;
}
......@@ -3668,7 +3668,7 @@ enum Isds::Type::DTType Isds::DTInfoOutput::futDTType(void) const
{
Q_D(const DTInfoOutput);
if (Q_UNLIKELY(d == Q_NULLPTR)) {
return Type::DTT_NULL;
return Type::DTT_UNKNOWN;
}
return d->m_futDTType;
}
......@@ -3750,7 +3750,7 @@ enum Isds::Type::FutDTPaidState Isds::DTInfoOutput::futDTPaid(void) const
{
Q_D(const DTInfoOutput);
if (Q_UNLIKELY(d == Q_NULLPTR)) {
return Type::FDTPS_NULL;
return Type::FDTPS_UNKNOWN;
}
return d->m_futDTPaid;
}
......
......@@ -753,14 +753,14 @@ const QString &Isds::fulltextSearchType2Str(enum Type::FulltextSearchType fst)
enum Isds::Type::DTType Isds::long2DTType(long int dtt, bool *ok)
{
bool iOk = true;
enum Type::DTType type = Type::DTT_NULL;
enum Type::DTType type = Type::DTT_UNKNOWN;
switch (dtt) {
case Type::DTT_DISABLED: type = Type::DTT_DISABLED; break;
case Type::DTT_INACTIVE: type = Type::DTT_INACTIVE; break;
case Type::DTT_PREPAID: type = Type::DTT_PREPAID; break;
case Type::DTT_UNUSED_2: type = Type::DTT_UNUSED_2; break;
case Type::DTT_FLAT_RATE: type = Type::DTT_FLAT_RATE; break;
case Type::DTT_TRYOUT: type = Type::DTT_TRYOUT; break;
case Type::DTT_CONTRACTUAL: type = Type::DTT_CONTRACTUAL; break;
case Type::DTT_TRIAL: type = Type::DTT_TRIAL; break;
case Type::DTT_UNUSED_5: type = Type::DTT_UNUSED_5; break;
case Type::DTT_SPECIAL_OFFER: type = Type::DTT_SPECIAL_OFFER; break;
default:
......@@ -777,7 +777,7 @@ enum Isds::Type::DTType Isds::long2DTType(long int dtt, bool *ok)
QVariant Isds::dtType2Variant(enum Type::DTType dtt)
{
if (dtt == Type::DTT_NULL) {
if (dtt == Type::DTT_UNKNOWN) {
return QVariant();
} else {
return QVariant((int)dtt);
......@@ -787,14 +787,14 @@ QVariant Isds::dtType2Variant(enum Type::DTType dtt)
enum Isds::Type::DTType Isds::variant2DTType(const QVariant &v)
{
if (v.isNull()) {
return Type::DTT_NULL;
return Type::DTT_UNKNOWN;
}
bool ok = false;
qint64 num = v.toLongLong(&ok);
if (Q_UNLIKELY(!ok)) {
Q_ASSERT(0);
return Type::DTT_NULL;
return Type::DTT_UNKNOWN;
}
return long2DTType(num);
......@@ -803,7 +803,7 @@ enum Isds::Type::DTType Isds::variant2DTType(const QVariant &v)
enum Isds::Type::FutDTPaidState Isds::long2DTPaidState(long int fdtps, bool *ok)
{
bool iOk = true;
enum Type::FutDTPaidState type = Type::FDTPS_NULL;
enum Type::FutDTPaidState type = Type::FDTPS_UNKNOWN;
switch (fdtps) {
case Type::FDTPS_NOT_PAID_YET: type = Type::FDTPS_NOT_PAID_YET; break;
......@@ -822,7 +822,7 @@ enum Isds::Type::FutDTPaidState Isds::long2DTPaidState(long int fdtps, bool *ok)
QVariant Isds::dtPaidState2Variant(enum Type::FutDTPaidState dtps)
{
if (dtps == Type::FDTPS_NULL) {
if (dtps == Type::FDTPS_UNKNOWN) {
return QVariant();
} else {
return QVariant((int)dtps);
......@@ -832,14 +832,14 @@ QVariant Isds::dtPaidState2Variant(enum Type::FutDTPaidState dtps)
enum Isds::Type::FutDTPaidState Isds::variant2DTPaidState(const QVariant &v)
{
if (v.isNull()) {
return Type::FDTPS_NULL;
return Type::FDTPS_UNKNOWN;
}
bool ok = false;
qint64 num = v.toLongLong(&ok);
if (Q_UNLIKELY(!ok)) {
Q_ASSERT(0);
return Type::FDTPS_NULL;
return Type::FDTPS_UNKNOWN;
}
return long2DTPaidState(num);
......
......@@ -398,18 +398,6 @@ namespace Isds {
CET_EXPIRED = 5 /*!< Credit has expired. */
};
/*!
* @brief Response status type.
*
* @note Is actually not a type but may be used to distinguish
* between dbStatus and dmStatus.
*/
enum ResponseStatusType {
RST_UNKNOWN = -1, /*!< Convenience value. */
RST_DB, /*!< Status obtained from dbStatus. */
RST_DM /*!< Status obtained from dmStatus. */
};
/*!
* @brief Long term storage type.
*
......@@ -417,12 +405,12 @@ namespace Isds {
* section 2.8.
*/
enum DTType {
DTT_NULL = -1, /*!< Convenience values. */
DTT_DISABLED = 0, /*!< Long term storage is inactive. */
DTT_UNKNOWN = -1, /*!< Convenience value. */
DTT_INACTIVE = 0, /*!< Long term storage is inactive. */
DTT_PREPAID = 1, /*!< Long term storage is active using a prepaid service. */
DTT_UNUSED_2 = 2, /*<! This type was used until 2013. No more used since then. */
DTT_FLAT_RATE = 3, /*!< Long term storage is active using a flat rate. */
DTT_TRYOUT = 4, /*!< Long term storage is active to try it out. */
DTT_CONTRACTUAL = 3, /*!< Long term storage is active based on a contract. */
DTT_TRIAL = 4, /*!< Long term storage is active to try it out. */
DTT_UNUSED_5 = 5, /*< No more used. */
DTT_SPECIAL_OFFER = 6 /*!< Long term storage is active because of an special offer. */
};
......@@ -434,11 +422,23 @@ namespace Isds {
* section 2.8.
*/
enum FutDTPaidState {
FDTPS_NULL = -1, /*!< Convenience values. */
FDTPS_UNKNOWN = -1, /*!< Convenience value, converted from/to NULL. */
FDTPS_NOT_PAID_YET = 0, /*!< Long term storage has not been paid yet. */
FDTPS_PAID_ALREADY = 1 /*!< Long term storage has already been paid. */
};
/*!
* @brief Response status type.
*
* @note Is actually not a type but may be used to distinguish
* between dbStatus and dmStatus.
*/
enum ResponseStatusType {
RST_UNKNOWN = -1, /*!< Convenience value. */
RST_DB, /*!< Status obtained from dbStatus. */
RST_DM /*!< Status obtained from dmStatus. */
};
/*!
* @brief Error value. Taken from libdatovka for compatibility.
*/
......
......@@ -206,12 +206,12 @@ void TestIsdsXmlBox::dtiXmlTest(void)
bool iOk = false;
Isds::DTInfoOutput dti = Isds::Xml::toDTInfo(data, &iOk);
QVERIFY(dti.actDTType() == Isds::Type::DTT_FLAT_RATE);
QVERIFY(dti.actDTType() == Isds::Type::DTT_CONTRACTUAL);
QVERIFY(dti.actDTCapacity() == 100);
QVERIFY(dti.actDTFrom() == QDate::fromString("2012-04-30", Qt::ISODate));
QVERIFY(dti.actDTTo() == QDate::fromString("2100-01-01", Qt::ISODate));
QVERIFY(dti.actDTCapUsed() == 50);
QVERIFY(dti.futDTType() == Isds::Type::DTT_DISABLED);
QVERIFY(dti.futDTType() == Isds::Type::DTT_INACTIVE);
QVERIFY(dti.futDTCapacity() == -1);
QVERIFY(dti.futDTFrom().isNull());
QVERIFY(dti.futDTTo().isNull());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment