Пример #1
0
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;
}
Пример #2
0
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;

}
Пример #3
0
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;
}
Пример #4
0
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;
}
Пример #5
0
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);

}