60 lines
1.4 KiB
C++
60 lines
1.4 KiB
C++
#include "mainwindow.h"
|
|
#include "password.h"
|
|
#include <qt5keychain/keychain.h>
|
|
#include <qt5keychain/qkeychain_export.h>
|
|
|
|
using namespace std;
|
|
|
|
/*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()))
|
|
}
|
|
|
|
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)
|
|
{
|
|
|
|
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
*/
|