Commit 87dfb5ee authored by Martin Straka's avatar Martin Straka

Settings refactoring and comments

parent 8a5e4a5b
......@@ -64,8 +64,6 @@ void Settings::saveToSettings(QSettings &settings) const
settings.setValue(SETTINGS_ZFO_LIMIT_MB, zfoDbSizeMBs);
if (!_pinVal.isEmpty()) {
//settings.setValue(SETTINGS_PIN_VAL,
// QString::fromUtf8(_pinVal.toUtf8().toBase64()));
Q_ASSERT(!pinAlg.isEmpty());
settings.setValue(SETTINGS_PIN_ALG, pinAlg);
......@@ -116,10 +114,6 @@ void Settings::loadFromSettings(const QSettings &settings)
SETTINGS_GLOBAL_GROUP "/" SETTINGS_ZFO_LIMIT_MB,
DEFAULT_ZFO_LIMIT_MB).toInt();
//_pinVal = QString::fromUtf8(QByteArray::fromBase64(
// settings.value(SETTINGS_GLOBAL_GROUP "/" SETTINGS_PIN_VAL,
// QString()).toString().toUtf8()));
pinAlg = settings.value(SETTINGS_GLOBAL_GROUP "/" SETTINGS_PIN_ALG,
QString()).toString();
......@@ -146,13 +140,7 @@ void Settings::loadFromSettings(const QSettings &settings)
}
}
/* ========================================================================= */
/*
* Func: Full path to settings file (datovka.conf).
*/
QString Settings::settingsPath(void)
/* ========================================================================= */
{
QString settingsPath(getDefaultDbAndConfigLocation());
......
......@@ -84,6 +84,7 @@ public:
/*!
* @brief Full path to settings file.
*
* @return Full path to settings file or empty string on error.
*/
static
......@@ -116,12 +117,12 @@ public:
/*!
* @brief Holds global settings data.
*/
QString language;
int fontSize;
bool downloadOnlyNewMsgs;
bool downloadCompleteMsgs;
int msgLifeTimeInDays;
int fileLifeTimeInDays;
QString language; /*!< Application language. */
int fontSize; /*!< Application font size (scale). */
bool downloadOnlyNewMsgs; /*!< Download new messages only (not long term storage). */
bool downloadCompleteMsgs; /*!< Download complete messages. */
int msgLifeTimeInDays; /*!< Message life time in days. */
int fileLifeTimeInDays; /*!< File life time in days. */
QString _pinVal; /*! PIN value is not read from the configuration file, nor it is stored to the configuration file. */
QString pinAlg; /*!< PIN algorithm identifier. */
QByteArray pinSalt; /*!< Salt value used to generate PIN hash. */
......@@ -135,7 +136,7 @@ private:
};
/*!
* @brief Global instance of the structure.
* @brief Global instance of the class.
*/
extern Settings globSet;
......
......@@ -197,7 +197,7 @@ public:
/*!
* @brief Save PIN settings from QML.
*
* @param[in] pinValue - Pin string.
* @param[in] pinValue Pin string.
*/
Q_INVOKABLE
void updatePinSettings(const QString &pinValue);
......@@ -205,7 +205,7 @@ public:
/*!
* @brief Verify PIN entered by user and emit signal with result.
*
* @param[in] pinValue - Pin string.
* @param[in] pinValue Pin string.
*/
Q_INVOKABLE
void verifyPin(const QString &pinValue);
......@@ -219,8 +219,8 @@ public:
/*!
* @brief Returns new database location string to QML.
*
* @param[in] currentLocation - Current databases location.
* @param[in] setDefaultLocation - Default databases location.
* @param[in] currentLocation Current databases location.
* @param[in] setDefaultLocation Default databases location.
*/
Q_INVOKABLE
QString changeDbPath(const QString &currentLocation,
......@@ -275,15 +275,15 @@ signals:
/*!
* @brief Send PIN verification result to QML.
*
* @param[in] success - PIN comparison notification to QML.
* @param[in] success PIN comparison notification to QML.
*/
void sendPinReply(bool success);
/*!
* @brief Set new statusbar text and active busy indicator to QML.
*
* @param[in] txt - Text message for statusbar.
* @param[in] busy - True means the statusbar busy indicator is active
* @param[in] txt Text message for statusbar.
* @param[in] busy True means the statusbar busy indicator is active
* and shown, false = disabled and hidden
*/
void statusBarTextChanged(QString txt, bool busy);
......
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