void Settings::setDBServerUserPassword(const QString &userPassword){ QByteArray *destination = new QByteArray(); Cryptography cryptography; cryptography.teaCrypto(destination, userPassword.toUtf8(), key, true); setValue("Database/Password", *destination); delete destination; }
void Settings::setRecentUserPassword(const QString &password){ QByteArray *destination = new QByteArray(); Cryptography cryptography; cryptography.teaCrypto(destination, password.toUtf8(), key, true); setValue("MainWindow/RecentUserPassword", *destination); delete destination; }
QString Settings::getDBServerUserName() const{ QString userName = ""; QByteArray userNameArray = value("Database/UserName").toByteArray(); if(userNameArray.isEmpty()){ userName = REMOTE_SITOY_COMPUTERS_DB_USER_NAME; }else{ QByteArray *destination = new QByteArray(); Cryptography cryptography; cryptography.teaCrypto(destination, userNameArray, key, false); userName = QString(*destination); delete destination; } return userName; }
QString Settings::getDBServerUserPassword() const{ QString password = ""; QByteArray passwordArray = value("Database/Password").toByteArray(); if(passwordArray.isEmpty()){ password = REMOTE_SITOY_COMPUTERS_DB_USER_PASSWORD; }else{ QByteArray *destination = new QByteArray(); Cryptography cryptography; cryptography.teaCrypto(destination, passwordArray, key, false); password = QString(*destination); delete destination; } return password; }
QString Settings::getRecentUserPassword() const{ QByteArray passwordArray = value("MainWindow/RecentUserPassword").toByteArray(); if(!passwordArray.isEmpty()){ QByteArray *destination = new QByteArray(); Cryptography cryptography; cryptography.teaCrypto(destination, passwordArray, key, false); passwordArray = *destination; delete destination; } return QString(passwordArray); }