Adapted to new KPasswordEdit::password() signature. This relates to bug 2961.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/4/head
Michele Calgaro 5 years ago
parent d65b672dce
commit 358d9e899a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -114,7 +114,7 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
int keep = 1;
while ( !pdfdoc->isOk() && pdfdoc->getErrorCode() == errEncrypted )
{
TQCString password;
TQString password;
// 1.A. try to retrieve the first password from the kde wallet system
if ( !triedWallet )
@ -131,7 +131,7 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
// look for the pass in that folder
TQString retrievedPass;
if ( !wallet->readPassword( filePath.section('/', -1, -1), retrievedPass ) )
password = retrievedPass.local8Bit();
password = retrievedPass;
}
triedWallet = true;
}
@ -152,7 +152,7 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
}
// 2. reopen the document using the password
GString * pwd2 = new GString( TQString(TQString::fromLocal8Bit(password.data())).latin1() );
GString * pwd2 = new GString( password.utf8() );
delete pdfdoc;
pdfdoc = new PDFDoc( new GString( TQFile::encodeName( filePath ) ), pwd2, pwd2 );
delete pwd2;
@ -160,7 +160,7 @@ bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPa
// 3. if the password is correct and the user chose to remember it, store it to the wallet
if ( pdfdoc->isOk() && wallet && /*safety check*/ wallet->isOpen() && keep > 0 )
{
TQString goodPass = TQString::fromLocal8Bit( password.data() );
TQString goodPass = password;
wallet->writePassword( filePath.section('/', -1, -1), goodPass );
}
}

Loading…
Cancel
Save