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

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 6 years ago
parent 25c9b22503
commit f2b042c804
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -97,11 +97,11 @@ KisPDFImport::ConversionStatus KisPDFImport::convert(const TQCString& , const TQ
while( pdoc->isLocked() ) while( pdoc->isLocked() )
{ {
TQCString password; TQString password;
int result = KPasswordDialog::getPassword(password, i18n("A password is required to read that pdf")); int result = KPasswordDialog::getPassword(password, i18n("A password is required to read that pdf"));
if (result == KPasswordDialog::Accepted) if (result == KPasswordDialog::Accepted)
{ {
pdoc->unlock(password); pdoc->unlock(password.utf8());
} else { } else {
kdDebug(41008) << "Password canceled" << endl; kdDebug(41008) << "Password canceled" << endl;
return KoFilter::StorageCreationError; return KoFilter::StorageCreationError;

@ -176,7 +176,7 @@ KexiDBPasswordDialog::~KexiDBPasswordDialog()
void KexiDBPasswordDialog::done(int r) void KexiDBPasswordDialog::done(int r)
{ {
if (r == TQDialog::Accepted) { if (r == TQDialog::Accepted) {
m_cdata->password = TQString::fromLatin1(password()); m_cdata->password = password();
} }
// if (d->showConnectionDetailsExecuted || ret == TQDialog::Accepted) { // if (d->showConnectionDetailsExecuted || ret == TQDialog::Accepted) {
/* } else { /* } else {
@ -330,11 +330,11 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (qstrcmp("--password",argv[i])==0 if (qstrcmp("--password",argv[i])==0
|| qstrcmp("-password",argv[i])==0) || qstrcmp("-password",argv[i])==0)
{ {
TQCString pwd(argv[i+1]); TQString pwd(argv[i+1]);
if (!pwd.isEmpty()) { if (!pwd.isEmpty()) {
pwd.fill(' '); pwd.fill(' ');
pwd[0]='x'; pwd[0]='x';
qstrcpy(argv[i+1], (const char*)pwd); qstrcpy(argv[i+1], (const char*)pwd.utf8().data());
} }
break; break;
} }
@ -394,7 +394,7 @@ tristate KexiStartupHandler::init(int /*argc*/, char ** /*argv*/)
if (d->passwordDialog->showConnectionDetailsRequested() || ret == TQDialog::Accepted) { if (d->passwordDialog->showConnectionDetailsRequested() || ret == TQDialog::Accepted) {
// if ( ret == TQDialog::Accepted ) { // if ( ret == TQDialog::Accepted ) {
// if (TQDialog::Accepted == KPasswordDialog::getPassword(pwd, msg)) { // if (TQDialog::Accepted == KPasswordDialog::getPassword(pwd, msg)) {
//moved cdata.password = TQString(pwd); //moved cdata.password = pwd;
// } // }
} else { } else {
m_action = Exit; m_action = Exit;

@ -5148,10 +5148,10 @@ void View::toggleProtectDoc( bool mode )
if ( !doc() || !doc()->map() ) if ( !doc() || !doc()->map() )
return; return;
TQCString passwd; TQString password;
if ( mode ) if ( mode )
{ {
int result = KPasswordDialog::getNewPassword( passwd, i18n( "Protect Document" ) ); int result = KPasswordDialog::getNewPassword( password, i18n( "Protect Document" ) );
if ( result != KPasswordDialog::Accepted ) if ( result != KPasswordDialog::Accepted )
{ {
d->actions->protectDoc->setChecked( false ); d->actions->protectDoc->setChecked( false );
@ -5159,14 +5159,13 @@ void View::toggleProtectDoc( bool mode )
} }
TQCString hash( "" ); TQCString hash( "" );
TQString password( passwd );
if ( password.length() > 0 ) if ( password.length() > 0 )
SHA1::getHash( password, hash ); SHA1::getHash( password, hash );
doc()->map()->setProtected( hash ); doc()->map()->setProtected( hash );
} }
else else
{ {
int result = KPasswordDialog::getPassword( passwd, i18n( "Unprotect Document" ) ); int result = KPasswordDialog::getPassword( password, i18n( "Unprotect Document" ) );
if ( result != KPasswordDialog::Accepted ) if ( result != KPasswordDialog::Accepted )
{ {
d->actions->protectDoc->setChecked( true ); d->actions->protectDoc->setChecked( true );
@ -5174,7 +5173,6 @@ void View::toggleProtectDoc( bool mode )
} }
TQCString hash( "" ); TQCString hash( "" );
TQString password( passwd );
if ( password.length() > 0 ) if ( password.length() > 0 )
SHA1::getHash( password, hash ); SHA1::getHash( password, hash );
if ( !doc()->map()->checkPassword( hash ) ) if ( !doc()->map()->checkPassword( hash ) )
@ -5196,10 +5194,10 @@ void View::toggleProtectSheet( bool mode )
if ( !d->activeSheet ) if ( !d->activeSheet )
return; return;
TQCString passwd; TQString password;
if ( mode ) if ( mode )
{ {
int result = KPasswordDialog::getNewPassword( passwd, i18n( "Protect Sheet" ) ); int result = KPasswordDialog::getNewPassword( password, i18n( "Protect Sheet" ) );
if ( result != KPasswordDialog::Accepted ) if ( result != KPasswordDialog::Accepted )
{ {
d->actions->protectSheet->setChecked( false ); d->actions->protectSheet->setChecked( false );
@ -5207,7 +5205,6 @@ void View::toggleProtectSheet( bool mode )
} }
TQCString hash( "" ); TQCString hash( "" );
TQString password( passwd );
if ( password.length() > 0 ) if ( password.length() > 0 )
SHA1::getHash( password, hash ); SHA1::getHash( password, hash );
@ -5215,7 +5212,7 @@ void View::toggleProtectSheet( bool mode )
} }
else else
{ {
int result = KPasswordDialog::getPassword( passwd, i18n( "Unprotect Sheet" ) ); int result = KPasswordDialog::getPassword( password, i18n( "Unprotect Sheet" ) );
if ( result != KPasswordDialog::Accepted ) if ( result != KPasswordDialog::Accepted )
{ {
d->actions->protectSheet->setChecked( true ); d->actions->protectSheet->setChecked( true );
@ -5223,7 +5220,6 @@ void View::toggleProtectSheet( bool mode )
} }
TQCString hash( "" ); TQCString hash( "" );
TQString password( passwd );
if ( password.length() > 0 ) if ( password.length() > 0 )
SHA1::getHash( password, hash ); SHA1::getHash( password, hash );

@ -75,7 +75,7 @@ bool KWQtSqlSerialDataSourceBase::showConfigDialog(TQWidget *par,int action)
bool KWQtSqlSerialDataSourceBase::openDatabase() bool KWQtSqlSerialDataSourceBase::openDatabase()
{ {
TQCString pwd; TQString pwd;
TQSqlDatabase::removeDatabase(DataBaseConnection); TQSqlDatabase::removeDatabase(DataBaseConnection);
database=TQSqlDatabase::addDatabase(driver,DataBaseConnection); database=TQSqlDatabase::addDatabase(driver,DataBaseConnection);
if (database) if (database)

Loading…
Cancel
Save