PDA

View Full Version : Save password to *.db file



sliverTwist
6th March 2013, 10:13
Hello i have this nap of code which is mentioned to save the password to a .db file but it dosen't seem to work because it always got to passwdJob.error() .Could you please help me to fix this out


QKeychain::WritePasswordJob passwdJob(_OCS_APP_NAME);

passwdJob.setAutoDelete(false);

passwdJob.setKey( mAccountName );

passwdJob.setTextData(mPassword);

QEventLoop passwdLoop;

passwdLoop.connect( &passwdJob, SIGNAL(finished(QKeychain::Job*)),
&passwdLoop,SLOT(quit()));
passwdJob.start();
passwdLoop.exec();
if(passwdJob.error()) {
syncDebug() << "Error: Unable to save password!"<< passwdJob.error();

}

ChrisW67
6th March 2013, 23:35
Your question reads: I am using an undisclosed third-party piece of software on an undisclosed operating system and it is returning an error. What is wrong?

I suggest you start by looking at, and understanding, the error message.