Commit a7069b20 authored by Martin Straka's avatar Martin Straka

Minor refactoring and comments

parent 76be1431
......@@ -51,7 +51,7 @@
#define DMSTATE_REMOVED 9
#define DMSTATE_IN_SAFE 10
QString IsdsConversion::authorTypeToText(const QString &authorType)
QString IsdsConversion::dmAuthorTypeToText(const QString &authorType)
{
if (AUTYPE_PRIMARY_USER == authorType) {
/* Opravnena osoba. */
......@@ -76,7 +76,7 @@ QString IsdsConversion::authorTypeToText(const QString &authorType)
}
}
QString IsdsConversion::dataBoxStateDescription(int state)
QString IsdsConversion::dbStateToText(int state)
{
switch (state) {
case DBSTATE_ACCESSIBLE:
......@@ -143,7 +143,7 @@ QString IsdsConversion::dmTypeToText(const QString &val)
}
}
QString IsdsConversion::msgStatusToText(int status)
QString IsdsConversion::dmStatusToText(int status)
{
switch (status) {
case DMSTATE_SENT:
......
......@@ -41,28 +41,28 @@ private:
public:
/*!
* @brief Returns localised author type string.
* @brief Returns localised author type description.
*
* @param[in] authorType Author ISDS string.
* @return Localised author type string.
* @return Localised author type description.
*/
static
QString authorTypeToText(const QString &authorType);
QString dmAuthorTypeToText(const QString &authorType);
/*!
* @brief Returns localised description of data box state.
*
* @param[in] state Data-box state code.
* @return Localised description.
* @return Localised data box state description.
*/
static
QString dataBoxStateDescription(int state);
QString dbStateToText(int state);
/*!
* @brief Returns localised message type description.
*
* @param[in] val Message type char.
* @return Localised description.
* @return Localised message type description.
*/
static
QString dmTypeToText(const QString &val);
......@@ -70,11 +70,11 @@ public:
/*!
* @brief Returns localised message status description.
*
* @param[in] status Messahe status code.
* @return Localised description.
* @param[in] status Message status code.
* @return Localised message status description.
*/
static
QString msgStatusToText(int status);
QString dmStatusToText(int status);
};
#endif /* _ISDS_CONVERSION_H_ */
......@@ -103,7 +103,7 @@ QString DbWrapper::createAccountInfoStringForQml(
accountInfo.nationality));
}
dbInfo.append(strongInfoLine(tr("Databox state"),
IsdsConversion::dataBoxStateDescription(accountInfo.dbState)));
IsdsConversion::dbStateToText(accountInfo.dbState)));
dbInfo.append(strongInfoLine(tr("Effective OVM"),
(accountInfo.dbEffectiveOVM) ? tr("Yes") : tr("No")));
dbInfo.append(strongInfoLine(tr("Open addressing"),
......@@ -260,7 +260,7 @@ bool DbWrapper::updateAuthorInfo(const QString &userName,
return false;
}
QString data = IsdsConversion::authorTypeToText(userType);
QString data = IsdsConversion::dmAuthorTypeToText(userType);
if (!authorName.isEmpty()) {
data += ", " + authorName;
......
......@@ -304,7 +304,7 @@ QString AccountDb::getAccountDetail(const QString &userName) const
} else if (dsPrintedAttribs[i] == "dbState") {
html += strongInfoLine(
accntinfTbl.attrProps[dsPrintedAttribs[i]].desc,
IsdsConversion::dataBoxStateDescription(query.value(i).toInt()));
IsdsConversion::dbStateToText(query.value(i).toInt()));
} else {
html += strongInfoLine(
accntinfTbl.attrProps[dsPrintedAttribs[i]].desc,
......@@ -374,7 +374,7 @@ QString AccountDb::getAccountDetail(const QString &userName) const
} else if (userPrintedAttribs[i] == "userType") {
html += strongInfoLine(
userinfTbl.attrProps[userPrintedAttribs[i]].desc,
IsdsConversion::authorTypeToText(query.value(i).toString()));
IsdsConversion::dmAuthorTypeToText(query.value(i).toString()));
} else {
html += strongInfoLine(
userinfTbl.attrProps[userPrintedAttribs[i]].desc,
......
......@@ -466,7 +466,7 @@ QString MessageDb::getMessageDetailDataFromDb(qint64 dmId) const
html += strongInfoLine(
msgsTbl.attrProps[msgStatus[2]].desc,
QString::number(query.value(2).toInt()) + " -- " +
IsdsConversion::msgStatusToText(query.value(2).toInt()));
IsdsConversion::dmStatusToText(query.value(2).toInt()));
} else {
goto fail;
}
......
Markdown is supported
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