testing password encryption
This commit is contained in:
+45
-8
@@ -1,22 +1,59 @@
|
||||
#include "mainwindow.h"
|
||||
#include "password.h"
|
||||
#include <qt5keychain/keychain.h>
|
||||
#include <qt5keychain/qkeychain_export.h>
|
||||
|
||||
/*password::password("RsyncUI")
|
||||
{
|
||||
using namespace std;
|
||||
|
||||
}*/
|
||||
|
||||
void password::store (QString account, QString password)
|
||||
/*Password::Password()
|
||||
{
|
||||
this->passwdJob->setObjectName(this->appName);
|
||||
this->passwdJob->setAutoDelete(false);
|
||||
this->passwdJob->connect(this->passwdJob, SIGNAL(finished(QKeychain::Job*)), this, SLOT(finished(QKeychain::Job*)));
|
||||
//this->readPass->connect(this->readPass, SIGNAL(finished()))
|
||||
}
|
||||
|
||||
QString password::read(QString)
|
||||
void Password::store (QString account, QString password)
|
||||
{
|
||||
this->passwdJob->setKey(account);
|
||||
this->passwdJob->setTextData(password);
|
||||
this->passwdJob->start();
|
||||
}
|
||||
|
||||
QString Password::read(QString account)
|
||||
{
|
||||
this->readPass->setObjectName("");
|
||||
this->readPass->setKey(account);
|
||||
this->readPass->start();
|
||||
}
|
||||
|
||||
bool Password::remove(QString)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool password::remove(QString)
|
||||
void Password::finished(QKeychain::Job * passwdJob)
|
||||
{
|
||||
|
||||
if(passwdJob->error()) {
|
||||
QMessageBox::warning(
|
||||
NULL,
|
||||
"RsyncUI",
|
||||
QString(this->mw->tr("Error: Unable to save password!")) + QString(passwdJob->error()));
|
||||
}
|
||||
}
|
||||
|
||||
void Password::readReturn()
|
||||
{
|
||||
if(this->readPass->error())
|
||||
{
|
||||
QMessageBox::warning(
|
||||
NULL,
|
||||
"RsyncUI",
|
||||
QString(this->mw->tr("Error: Unable to read password!")) + QString(readPass->error()));
|
||||
}else
|
||||
{
|
||||
this->password = readPass->textData();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user