@ -52,21 +52,21 @@
extern " C " {
extern " C " {
KDE_EXPORT KDEDModule * create_tdewalletd ( const TQCString & name ) {
KDE_EXPORT KDEDModule * create_tdewalletd ( const TQCString & name ) {
return new K WalletD( name ) ;
return new TDE WalletD( name ) ;
}
}
}
}
class K WalletTransaction {
class TDE WalletTransaction {
public :
public :
K WalletTransaction( ) {
TDE WalletTransaction( ) {
tType = Unknown ;
tType = Unknown ;
transaction = 0L ;
transaction = 0L ;
client = 0L ;
client = 0L ;
modal = false ;
modal = false ;
}
}
~ K WalletTransaction( ) {
~ TDE WalletTransaction( ) {
// Don't delete these!
// Don't delete these!
transaction = 0L ;
transaction = 0L ;
client = 0L ;
client = 0L ;
@ -84,7 +84,7 @@ class KWalletTransaction {
} ;
} ;
KWalletD: : K WalletD( const TQCString & name )
TDEWalletD: : TDE WalletD( const TQCString & name )
: KDEDModule ( name ) , _failed ( 0 ) {
: KDEDModule ( name ) , _failed ( 0 ) {
srand ( time ( 0 ) ) ;
srand ( time ( 0 ) ) ;
_showingFailureNotify = false ;
_showingFailureNotify = false ;
@ -99,14 +99,14 @@ KWalletD::KWalletD(const TQCString &name)
TQT_SIGNAL ( applicationRemoved ( const TQCString & ) ) ,
TQT_SIGNAL ( applicationRemoved ( const TQCString & ) ) ,
this ,
this ,
TQT_SLOT ( slotAppUnregistered ( const TQCString & ) ) ) ;
TQT_SLOT ( slotAppUnregistered ( const TQCString & ) ) ) ;
_dw = new KDirWatch ( this , " K Wallet Directory Watcher" ) ;
_dw = new KDirWatch ( this , " TDE Wallet Directory Watcher" ) ;
_dw - > addDir ( TDEGlobal : : dirs ( ) - > saveLocation ( " tdewallet " ) ) ;
_dw - > addDir ( TDEGlobal : : dirs ( ) - > saveLocation ( " tdewallet " ) ) ;
_dw - > startScan ( true ) ;
_dw - > startScan ( true ) ;
connect ( _dw , TQT_SIGNAL ( dirty ( const TQString & ) ) , this , TQT_SLOT ( emitWalletListDirty ( ) ) ) ;
connect ( _dw , TQT_SIGNAL ( dirty ( const TQString & ) ) , this , TQT_SLOT ( emitWalletListDirty ( ) ) ) ;
}
}
KWalletD: : ~ K WalletD( ) {
TDEWalletD: : ~ TDE WalletD( ) {
delete _timeouts ;
delete _timeouts ;
_timeouts = 0 ;
_timeouts = 0 ;
@ -115,7 +115,7 @@ KWalletD::~KWalletD() {
}
}
int K WalletD: : generateHandle ( ) {
int TDE WalletD: : generateHandle ( ) {
int rc ;
int rc ;
// ASSUMPTION: RAND_MAX is fairly large.
// ASSUMPTION: RAND_MAX is fairly large.
@ -127,7 +127,7 @@ int KWalletD::generateHandle() {
}
}
void K WalletD: : processTransactions ( ) {
void TDE WalletD: : processTransactions ( ) {
static bool processing = false ;
static bool processing = false ;
if ( processing ) {
if ( processing ) {
@ -137,16 +137,16 @@ void KWalletD::processTransactions() {
processing = true ;
processing = true ;
// Process remaining transactions
// Process remaining transactions
K WalletTransaction * xact ;
TDE WalletTransaction * xact ;
while ( ! _transactions . isEmpty ( ) ) {
while ( ! _transactions . isEmpty ( ) ) {
xact = _transactions . first ( ) ;
xact = _transactions . first ( ) ;
TQCString replyType ;
TQCString replyType ;
int res ;
int res ;
assert ( xact - > tType ! = K WalletTransaction: : Unknown ) ;
assert ( xact - > tType ! = TDE WalletTransaction: : Unknown ) ;
switch ( xact - > tType ) {
switch ( xact - > tType ) {
case K WalletTransaction: : Open :
case TDE WalletTransaction: : Open :
res = doTransactionOpen ( xact - > appid , xact - > wallet , xact - > wId , xact - > modal ) ;
res = doTransactionOpen ( xact - > appid , xact - > wallet , xact - > wId , xact - > modal ) ;
replyType = " int " ;
replyType = " int " ;
if ( ! xact - > returnObject . isEmpty ( ) ) {
if ( ! xact - > returnObject . isEmpty ( ) ) {
@ -157,8 +157,8 @@ void KWalletD::processTransactions() {
// should not produce multiple password
// should not produce multiple password
// dialogs on a failure
// dialogs on a failure
if ( res < 0 ) {
if ( res < 0 ) {
TQPtrListIterator < K WalletTransaction> it ( _transactions ) ;
TQPtrListIterator < TDE WalletTransaction> it ( _transactions ) ;
K WalletTransaction * x ;
TDE WalletTransaction * x ;
while ( ( x = it . current ( ) ) & & x ! = xact ) {
while ( ( x = it . current ( ) ) & & x ! = xact ) {
+ + it ;
+ + it ;
}
}
@ -166,21 +166,21 @@ void KWalletD::processTransactions() {
+ + it ;
+ + it ;
}
}
while ( ( x = it . current ( ) ) ) {
while ( ( x = it . current ( ) ) ) {
if ( xact - > appid = = x - > appid & & x - > tType = = K WalletTransaction: : Open & & x - > wallet = = xact - > wallet & & x - > wId = = xact - > wId ) {
if ( xact - > appid = = x - > appid & & x - > tType = = TDE WalletTransaction: : Open & & x - > wallet = = xact - > wallet & & x - > wId = = xact - > wId ) {
x - > tType = K WalletTransaction: : OpenFail ;
x - > tType = TDE WalletTransaction: : OpenFail ;
}
}
+ + it ;
+ + it ;
}
}
}
}
break ;
break ;
case K WalletTransaction: : OpenFail :
case TDE WalletTransaction: : OpenFail :
res = - 1 ;
res = - 1 ;
replyType = " int " ;
replyType = " int " ;
if ( ! xact - > returnObject . isEmpty ( ) ) {
if ( ! xact - > returnObject . isEmpty ( ) ) {
DCOPRef ( xact - > rawappid , xact - > returnObject ) . send ( " walletOpenResult " , res ) ;
DCOPRef ( xact - > rawappid , xact - > returnObject ) . send ( " walletOpenResult " , res ) ;
}
}
break ;
break ;
case K WalletTransaction: : ChangePassword :
case TDE WalletTransaction: : ChangePassword :
doTransactionChangePassword ( xact - > appid , xact - > wallet , xact - > wId ) ;
doTransactionChangePassword ( xact - > appid , xact - > wallet , xact - > wId ) ;
// fall through - no return
// fall through - no return
default :
default :
@ -188,7 +188,7 @@ void KWalletD::processTransactions() {
continue ;
continue ;
}
}
if ( xact - > returnObject . isEmpty ( ) & & xact - > tType ! = K WalletTransaction: : ChangePassword ) {
if ( xact - > returnObject . isEmpty ( ) & & xact - > tType ! = TDE WalletTransaction: : ChangePassword ) {
TQByteArray replyData ;
TQByteArray replyData ;
TQDataStream stream ( replyData , IO_WriteOnly ) ;
TQDataStream stream ( replyData , IO_WriteOnly ) ;
stream < < res ;
stream < < res ;
@ -201,7 +201,7 @@ void KWalletD::processTransactions() {
}
}
void K WalletD: : openAsynchronous ( const TQString & wallet , const TQCString & returnObject , uint wId ) {
void TDE WalletD: : openAsynchronous ( const TQString & wallet , const TQCString & returnObject , uint wId ) {
DCOPClient * dc = callingDcopClient ( ) ;
DCOPClient * dc = callingDcopClient ( ) ;
if ( ! dc ) {
if ( ! dc ) {
return ;
return ;
@ -216,14 +216,14 @@ void KWalletD::openAsynchronous(const TQString& wallet, const TQCString& returnO
TQCString peerName = friendlyDCOPPeerName ( ) ;
TQCString peerName = friendlyDCOPPeerName ( ) ;
KWalletTransaction * xact = new K WalletTransaction;
TDEWalletTransaction * xact = new TDE WalletTransaction;
xact - > appid = peerName ;
xact - > appid = peerName ;
xact - > rawappid = appid ;
xact - > rawappid = appid ;
xact - > client = callingDcopClient ( ) ;
xact - > client = callingDcopClient ( ) ;
xact - > wallet = wallet ;
xact - > wallet = wallet ;
xact - > wId = wId ;
xact - > wId = wId ;
xact - > tType = K WalletTransaction: : Open ;
xact - > tType = TDE WalletTransaction: : Open ;
xact - > returnObject = returnObject ;
xact - > returnObject = returnObject ;
_transactions . append ( xact ) ;
_transactions . append ( xact ) ;
@ -234,7 +234,7 @@ void KWalletD::openAsynchronous(const TQString& wallet, const TQCString& returnO
}
}
int K WalletD: : openPath ( const TQString & path , uint wId ) {
int TDE WalletD: : openPath ( const TQString & path , uint wId ) {
if ( ! _enabled ) { // guard
if ( ! _enabled ) { // guard
return - 1 ;
return - 1 ;
}
}
@ -245,7 +245,7 @@ int KWalletD::openPath(const TQString& path, uint wId) {
}
}
int K WalletD: : open ( const TQString & wallet , uint wId ) {
int TDE WalletD: : open ( const TQString & wallet , uint wId ) {
if ( ! _enabled ) { // guard
if ( ! _enabled ) { // guard
return - 1 ;
return - 1 ;
}
}
@ -256,7 +256,7 @@ int KWalletD::open(const TQString& wallet, uint wId) {
TQCString appid = friendlyDCOPPeerName ( ) ;
TQCString appid = friendlyDCOPPeerName ( ) ;
KWalletTransaction * xact = new K WalletTransaction;
TDEWalletTransaction * xact = new TDE WalletTransaction;
_transactions . append ( xact ) ;
_transactions . append ( xact ) ;
xact - > appid = appid ;
xact - > appid = appid ;
@ -264,7 +264,7 @@ int KWalletD::open(const TQString& wallet, uint wId) {
xact - > transaction = xact - > client - > beginTransaction ( ) ;
xact - > transaction = xact - > client - > beginTransaction ( ) ;
xact - > wallet = wallet ;
xact - > wallet = wallet ;
xact - > wId = wId ;
xact - > wId = wId ;
xact - > tType = K WalletTransaction: : Open ;
xact - > tType = TDE WalletTransaction: : Open ;
xact - > modal = true ; // mark dialogs as modal, the app has blocking wait
xact - > modal = true ; // mark dialogs as modal, the app has blocking wait
TQTimer : : singleShot ( 0 , this , TQT_SLOT ( processTransactions ( ) ) ) ;
TQTimer : : singleShot ( 0 , this , TQT_SLOT ( processTransactions ( ) ) ) ;
checkActiveDialog ( ) ;
checkActiveDialog ( ) ;
@ -273,7 +273,7 @@ int KWalletD::open(const TQString& wallet, uint wId) {
// Sets up a dialog that will be shown by tdewallet.
// Sets up a dialog that will be shown by tdewallet.
void K WalletD: : setupDialog ( TQWidget * dialog , WId wId , const TQCString & appid , bool modal ) {
void TDE WalletD: : setupDialog ( TQWidget * dialog , WId wId , const TQCString & appid , bool modal ) {
if ( wId ! = 0 )
if ( wId ! = 0 )
KWin : : setMainWindow ( dialog , wId ) ; // correct, set dialog parent
KWin : : setMainWindow ( dialog , wId ) ; // correct, set dialog parent
else {
else {
@ -298,7 +298,7 @@ void KWalletD::setupDialog( TQWidget* dialog, WId wId, const TQCString& appid, b
// KWin properly handles focus changes and so on, but there's currently no support for multiple
// KWin properly handles focus changes and so on, but there's currently no support for multiple
// dialog parents. Hopefully to be done in KDE4, for now just use all kinds of bad hacks to make
// dialog parents. Hopefully to be done in KDE4, for now just use all kinds of bad hacks to make
// sure the user doesn't overlook the active dialog.
// sure the user doesn't overlook the active dialog.
void K WalletD: : checkActiveDialog ( ) {
void TDE WalletD: : checkActiveDialog ( ) {
if ( ! activeDialog | | ! activeDialog - > isShown ( ) )
if ( ! activeDialog | | ! activeDialog - > isShown ( ) )
return ;
return ;
kapp - > updateUserTimestamp ( ) ;
kapp - > updateUserTimestamp ( ) ;
@ -307,10 +307,10 @@ void KWalletD::checkActiveDialog() {
KWin : : forceActiveWindow ( activeDialog - > winId ( ) ) ;
KWin : : forceActiveWindow ( activeDialog - > winId ( ) ) ;
}
}
int K WalletD: : doTransactionOpen ( const TQCString & appid , const TQString & wallet , uint wId , bool modal ) {
int TDE WalletD: : doTransactionOpen ( const TQCString & appid , const TQString & wallet , uint wId , bool modal ) {
if ( _firstUse & & ! wallets ( ) . contains ( K Wallet: : Wallet : : LocalWallet ( ) ) ) {
if ( _firstUse & & ! wallets ( ) . contains ( TDE Wallet: : Wallet : : LocalWallet ( ) ) ) {
// First use wizard
// First use wizard
KWalletWizard * wiz = new K WalletWizard( 0 ) ;
TDEWalletWizard * wiz = new TDE WalletWizard( 0 ) ;
setupDialog ( wiz , wId , appid , modal ) ;
setupDialog ( wiz , wId , appid , modal ) ;
int rc = wiz - > exec ( ) ;
int rc = wiz - > exec ( ) ;
if ( rc = = TQDialog : : Accepted ) {
if ( rc = = TQDialog : : Accepted ) {
@ -329,12 +329,12 @@ int KWalletD::doTransactionOpen(const TQCString& appid, const TQString& wallet,
}
}
// Create the wallet
// Create the wallet
KWallet: : Backend * b = new KWallet : : Backend ( K Wallet: : Wallet : : LocalWallet ( ) ) ;
TDEWallet: : Backend * b = new TDEWallet : : Backend ( TDE Wallet: : Wallet : : LocalWallet ( ) ) ;
TQByteArray p ;
TQByteArray p ;
p . duplicate ( wiz - > _pass1 - > text ( ) . utf8 ( ) , wiz - > _pass1 - > text ( ) . length ( ) ) ;
p . duplicate ( wiz - > _pass1 - > text ( ) . utf8 ( ) , wiz - > _pass1 - > text ( ) . length ( ) ) ;
b - > open ( p ) ;
b - > open ( p ) ;
b - > createFolder ( K Wallet: : Wallet : : PasswordFolder ( ) ) ;
b - > createFolder ( TDE Wallet: : Wallet : : PasswordFolder ( ) ) ;
b - > createFolder ( K Wallet: : Wallet : : FormDataFolder ( ) ) ;
b - > createFolder ( TDE Wallet: : Wallet : : FormDataFolder ( ) ) ;
b - > close ( p ) ;
b - > close ( p ) ;
p . fill ( 0 ) ;
p . fill ( 0 ) ;
delete b ;
delete b ;
@ -355,7 +355,7 @@ int KWalletD::doTransactionOpen(const TQCString& appid, const TQString& wallet,
return rc ;
return rc ;
}
}
int K WalletD: : tryOpen ( const TQString & wallet , const TQCString & password )
int TDE WalletD: : tryOpen ( const TQString & wallet , const TQCString & password )
{
{
if ( isOpen ( wallet ) )
if ( isOpen ( wallet ) )
return 0 ;
return 0 ;
@ -365,10 +365,10 @@ int KWalletD::tryOpen(const TQString& wallet, const TQCString& password)
return - 1 ;
return - 1 ;
}
}
if ( ! K Wallet: : Backend : : exists ( wallet ) )
if ( ! TDE Wallet: : Backend : : exists ( wallet ) )
return - 2 ;
return - 2 ;
KWallet: : Backend * b = new K Wallet: : Backend ( wallet , false /*isPath*/ ) ;
TDEWallet: : Backend * b = new TDE Wallet: : Backend ( wallet , false /*isPath*/ ) ;
int rc = b - > open ( TQByteArray ( ) . duplicate ( password , strlen ( password ) ) ) ;
int rc = b - > open ( TQByteArray ( ) . duplicate ( password , strlen ( password ) ) ) ;
if ( rc = = 0 ) {
if ( rc = = 0 ) {
_wallets . insert ( rc = generateHandle ( ) , b ) ;
_wallets . insert ( rc = generateHandle ( ) , b ) ;
@ -394,7 +394,7 @@ int KWalletD::tryOpen(const TQString& wallet, const TQCString& password)
return rc ;
return rc ;
}
}
int K WalletD: : internalOpen ( const TQCString & appid , const TQString & wallet , bool isPath , WId w , bool modal ) {
int TDE WalletD: : internalOpen ( const TQCString & appid , const TQString & wallet , bool isPath , WId w , bool modal ) {
int rc = - 1 ;
int rc = - 1 ;
bool brandNew = false ;
bool brandNew = false ;
@ -409,7 +409,7 @@ int KWalletD::internalOpen(const TQCString& appid, const TQString& wallet, bool
return - 1 ;
return - 1 ;
}
}
for ( TQIntDictIterator < K Wallet: : Backend > i ( _wallets ) ; i . current ( ) ; + + i ) {
for ( TQIntDictIterator < TDE Wallet: : Backend > i ( _wallets ) ; i . current ( ) ; + + i ) {
if ( i . current ( ) - > walletName ( ) = = wallet ) {
if ( i . current ( ) - > walletName ( ) = = wallet ) {
rc = i . currentKey ( ) ;
rc = i . currentKey ( ) ;
break ;
break ;
@ -422,16 +422,16 @@ int KWalletD::internalOpen(const TQCString& appid, const TQString& wallet, bool
return - 1 ;
return - 1 ;
}
}
KWallet: : Backend * b = new K Wallet: : Backend ( wallet , isPath ) ;
TDEWallet: : Backend * b = new TDE Wallet: : Backend ( wallet , isPath ) ;
KPasswordDialog * kpd = 0L ;
KPasswordDialog * kpd = 0L ;
bool emptyPass = false ;
bool emptyPass = false ;
if ( ( isPath & & TQFile : : exists ( wallet ) ) | | ( ! isPath & & K Wallet: : Backend : : exists ( wallet ) ) ) {
if ( ( isPath & & TQFile : : exists ( wallet ) ) | | ( ! isPath & & TDE Wallet: : Backend : : exists ( wallet ) ) ) {
int pwless = b - > open ( TQByteArray ( ) ) ;
int pwless = b - > open ( TQByteArray ( ) ) ;
if ( 0 ! = pwless | | ! b - > isOpen ( ) ) {
if ( 0 ! = pwless | | ! b - > isOpen ( ) ) {
if ( pwless = = 0 ) {
if ( pwless = = 0 ) {
// release, start anew
// release, start anew
delete b ;
delete b ;
b = new K Wallet: : Backend ( wallet , isPath ) ;
b = new TDE Wallet: : Backend ( wallet , isPath ) ;
}
}
kpd = new KPasswordDialog ( KPasswordDialog : : Password , false , 0 ) ;
kpd = new KPasswordDialog ( KPasswordDialog : : Password , false , 0 ) ;
if ( appid . isEmpty ( ) ) {
if ( appid . isEmpty ( ) ) {
@ -444,8 +444,8 @@ int KWalletD::internalOpen(const TQCString& appid, const TQString& wallet, bool
} else {
} else {
emptyPass = true ;
emptyPass = true ;
}
}
} else if ( wallet = = K Wallet: : Wallet : : LocalWallet ( ) | |
} else if ( wallet = = TDE Wallet: : Wallet : : LocalWallet ( ) | |
wallet = = K Wallet: : Wallet : : NetworkWallet ( ) ) {
wallet = = TDE Wallet: : Wallet : : NetworkWallet ( ) ) {
// Auto create these wallets.
// Auto create these wallets.
kpd = new KPasswordDialog ( KPasswordDialog : : NewPassword , false , 0 ) ;
kpd = new KPasswordDialog ( KPasswordDialog : : NewPassword , false , 0 ) ;
if ( appid . isEmpty ( ) ) {
if ( appid . isEmpty ( ) ) {
@ -479,7 +479,7 @@ int KWalletD::internalOpen(const TQCString& appid, const TQString& wallet, bool
p = kpd - > password ( ) ;
p = kpd - > password ( ) ;
int rc = b - > open ( TQByteArray ( ) . duplicate ( p , strlen ( p ) ) ) ;
int rc = b - > open ( TQByteArray ( ) . duplicate ( p , strlen ( p ) ) ) ;
if ( ! b - > isOpen ( ) ) {
if ( ! b - > isOpen ( ) ) {
kpd - > setPrompt ( i18n ( " <qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3) " ) . arg ( TQStyleSheet : : escape ( wallet ) ) . arg ( rc ) . arg ( K Wallet: : Backend : : openRCToString ( rc ) ) ) ;
kpd - > setPrompt ( i18n ( " <qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3) " ) . arg ( TQStyleSheet : : escape ( wallet ) ) . arg ( rc ) . arg ( TDE Wallet: : Backend : : openRCToString ( rc ) ) ) ;
kpd - > clearPassword ( ) ;
kpd - > clearPassword ( ) ;
}
}
} else {
} else {
@ -510,8 +510,8 @@ int KWalletD::internalOpen(const TQCString& appid, const TQString& wallet, bool
delete kpd ; // don't refactor this!! Argh I hate KPassDlg
delete kpd ; // don't refactor this!! Argh I hate KPassDlg
if ( brandNew ) {
if ( brandNew ) {
createFolder ( rc , K Wallet: : Wallet : : PasswordFolder ( ) ) ;
createFolder ( rc , TDE Wallet: : Wallet : : PasswordFolder ( ) ) ;
createFolder ( rc , K Wallet: : Wallet : : FormDataFolder ( ) ) ;
createFolder ( rc , TDE Wallet: : Wallet : : FormDataFolder ( ) ) ;
}
}
b - > ref ( ) ;
b - > ref ( ) ;
@ -540,7 +540,7 @@ int KWalletD::internalOpen(const TQCString& appid, const TQString& wallet, bool
}
}
bool K WalletD: : isAuthorizedApp ( const TQCString & appid , const TQString & wallet , WId w ) {
bool TDE WalletD: : isAuthorizedApp ( const TQCString & appid , const TQString & wallet , WId w ) {
int response = 0 ;
int response = 0 ;
TQCString thisApp ;
TQCString thisApp ;
@ -592,7 +592,7 @@ bool KWalletD::isAuthorizedApp(const TQCString& appid, const TQString& wallet, W
}
}
int K WalletD: : deleteWallet ( const TQString & wallet ) {
int TDE WalletD: : deleteWallet ( const TQString & wallet ) {
TQString path = TDEGlobal : : dirs ( ) - > saveLocation ( " tdewallet " ) + TQDir : : separator ( ) + wallet + " .kwl " ;
TQString path = TDEGlobal : : dirs ( ) - > saveLocation ( " tdewallet " ) + TQDir : : separator ( ) + wallet + " .kwl " ;
if ( TQFile : : exists ( path ) ) {
if ( TQFile : : exists ( path ) ) {
@ -609,16 +609,16 @@ int KWalletD::deleteWallet(const TQString& wallet) {
}
}
void K WalletD: : changePassword ( const TQString & wallet , uint wId ) {
void TDE WalletD: : changePassword ( const TQString & wallet , uint wId ) {
TQCString appid = friendlyDCOPPeerName ( ) ;
TQCString appid = friendlyDCOPPeerName ( ) ;
KWalletTransaction * xact = new K WalletTransaction;
TDEWalletTransaction * xact = new TDE WalletTransaction;
xact - > appid = appid ;
xact - > appid = appid ;
xact - > client = callingDcopClient ( ) ;
xact - > client = callingDcopClient ( ) ;
xact - > wallet = wallet ;
xact - > wallet = wallet ;
xact - > wId = wId ;
xact - > wId = wId ;
xact - > tType = K WalletTransaction: : ChangePassword ;
xact - > tType = TDE WalletTransaction: : ChangePassword ;
_transactions . append ( xact ) ;
_transactions . append ( xact ) ;
@ -627,9 +627,9 @@ void KWalletD::changePassword(const TQString& wallet, uint wId) {
}
}
void K WalletD: : doTransactionChangePassword ( const TQCString & appid , const TQString & wallet , uint wId ) {
void TDE WalletD: : doTransactionChangePassword ( const TQCString & appid , const TQString & wallet , uint wId ) {
TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
K Wallet: : Backend * w = 0L ;
TDE Wallet: : Backend * w = 0L ;
int handle = - 1 ;
int handle = - 1 ;
bool reclose = false ;
bool reclose = false ;
@ -689,11 +689,11 @@ void KWalletD::doTransactionChangePassword(const TQCString& appid, const TQStrin
}
}
int K WalletD: : close ( const TQString & wallet , bool force ) {
int TDE WalletD: : close ( const TQString & wallet , bool force ) {
int handle = - 1 ;
int handle = - 1 ;
K Wallet: : Backend * w = 0L ;
TDE Wallet: : Backend * w = 0L ;
for ( TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
it . current ( ) ;
it . current ( ) ;
+ + it ) {
+ + it ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
@ -707,7 +707,7 @@ int KWalletD::close(const TQString& wallet, bool force) {
}
}
int KWalletD: : closeWallet ( K Wallet: : Backend * w , int handle , bool force ) {
int TDEWalletD: : closeWallet ( TDE Wallet: : Backend * w , int handle , bool force ) {
if ( w ) {
if ( w ) {
const TQString & wallet = w - > walletName ( ) ;
const TQString & wallet = w - > walletName ( ) ;
assert ( _passwords . contains ( wallet ) ) ;
assert ( _passwords . contains ( wallet ) ) ;
@ -733,9 +733,9 @@ int KWalletD::closeWallet(KWallet::Backend *w, int handle, bool force) {
}
}
int K WalletD: : close ( int handle , bool force ) {
int TDE WalletD: : close ( int handle , bool force ) {
TQCString appid = friendlyDCOPPeerName ( ) ;
TQCString appid = friendlyDCOPPeerName ( ) ;
K Wallet: : Backend * w = _wallets . find ( handle ) ;
TDE Wallet: : Backend * w = _wallets . find ( handle ) ;
bool contains = false ;
bool contains = false ;
if ( w ) { // the handle is valid
if ( w ) { // the handle is valid
@ -775,8 +775,8 @@ int KWalletD::close(int handle, bool force) {
}
}
bool K WalletD: : isOpen ( const TQString & wallet ) const {
bool TDE WalletD: : isOpen ( const TQString & wallet ) const {
for ( TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
it . current ( ) ;
it . current ( ) ;
+ + it ) {
+ + it ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
@ -787,12 +787,12 @@ bool KWalletD::isOpen(const TQString& wallet) const {
}
}
bool K WalletD: : isOpen ( int handle ) {
bool TDE WalletD: : isOpen ( int handle ) {
if ( handle = = 0 ) {
if ( handle = = 0 ) {
return false ;
return false ;
}
}
K Wallet: : Backend * rc = _wallets . find ( handle ) ;
TDE Wallet: : Backend * rc = _wallets . find ( handle ) ;
if ( rc = = 0 & & + + _failed > 5 ) {
if ( rc = = 0 & & + + _failed > 5 ) {
_failed = 0 ;
_failed = 0 ;
@ -805,7 +805,7 @@ bool KWalletD::isOpen(int handle) {
}
}
TQStringList K WalletD: : wallets ( ) const {
TQStringList TDE WalletD: : wallets ( ) const {
TQString path = TDEGlobal : : dirs ( ) - > saveLocation ( " tdewallet " ) ;
TQString path = TDEGlobal : : dirs ( ) - > saveLocation ( " tdewallet " ) ;
TQDir dir ( path , " *.kwl " ) ;
TQDir dir ( path , " *.kwl " ) ;
TQStringList rc ;
TQStringList rc ;
@ -827,8 +827,8 @@ TQStringList KWalletD::wallets() const {
}
}
void K WalletD: : sync ( int handle ) {
void TDE WalletD: : sync ( int handle ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
TQByteArray p ;
TQByteArray p ;
@ -840,8 +840,8 @@ void KWalletD::sync(int handle) {
}
}
TQStringList K WalletD: : folderList ( int handle ) {
TQStringList TDE WalletD: : folderList ( int handle ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
return b - > folderList ( ) ;
return b - > folderList ( ) ;
@ -851,8 +851,8 @@ TQStringList KWalletD::folderList(int handle) {
}
}
bool K WalletD: : hasFolder ( int handle , const TQString & f ) {
bool TDE WalletD: : hasFolder ( int handle , const TQString & f ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
return b - > hasFolder ( f ) ;
return b - > hasFolder ( f ) ;
@ -862,8 +862,8 @@ bool KWalletD::hasFolder(int handle, const TQString& f) {
}
}
bool K WalletD: : removeFolder ( int handle , const TQString & f ) {
bool TDE WalletD: : removeFolder ( int handle , const TQString & f ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
bool rc = b - > removeFolder ( f ) ;
bool rc = b - > removeFolder ( f ) ;
@ -884,8 +884,8 @@ bool KWalletD::removeFolder(int handle, const TQString& f) {
}
}
bool K WalletD: : createFolder ( int handle , const TQString & f ) {
bool TDE WalletD: : createFolder ( int handle , const TQString & f ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
bool rc = b - > createFolder ( f ) ;
bool rc = b - > createFolder ( f ) ;
@ -906,13 +906,13 @@ bool KWalletD::createFolder(int handle, const TQString& f) {
}
}
TQByteArray K WalletD: : readMap ( int handle , const TQString & folder , const TQString & key ) {
TQByteArray TDE WalletD: : readMap ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry * e = b - > readEntry ( key ) ;
TDE Wallet: : Entry * e = b - > readEntry ( key ) ;
if ( e & & e - > type ( ) = = K Wallet: : Wallet : : Map ) {
if ( e & & e - > type ( ) = = TDE Wallet: : Wallet : : Map ) {
return e - > map ( ) ;
return e - > map ( ) ;
}
}
}
}
@ -921,17 +921,17 @@ TQByteArray KWalletD::readMap(int handle, const TQString& folder, const TQString
}
}
TQMap < TQString , TQByteArray > K WalletD: : readMapList ( int handle , const TQString & folder , const TQString & key ) {
TQMap < TQString , TQByteArray > TDE WalletD: : readMapList ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
TQPtrList < K Wallet: : Entry > e = b - > readEntryList ( key ) ;
TQPtrList < TDE Wallet: : Entry > e = b - > readEntryList ( key ) ;
TQMap < TQString , TQByteArray > rc ;
TQMap < TQString , TQByteArray > rc ;
TQPtrListIterator < K Wallet: : Entry > it ( e ) ;
TQPtrListIterator < TDE Wallet: : Entry > it ( e ) ;
K Wallet: : Entry * entry ;
TDE Wallet: : Entry * entry ;
while ( ( entry = it . current ( ) ) ) {
while ( ( entry = it . current ( ) ) ) {
if ( entry - > type ( ) = = K Wallet: : Wallet : : Map ) {
if ( entry - > type ( ) = = TDE Wallet: : Wallet : : Map ) {
rc . insert ( entry - > key ( ) , entry - > map ( ) ) ;
rc . insert ( entry - > key ( ) , entry - > map ( ) ) ;
}
}
+ + it ;
+ + it ;
@ -943,12 +943,12 @@ TQMap<TQString,TQByteArray> KWalletD::readMapList(int handle, const TQString& fo
}
}
TQByteArray K WalletD: : readEntry ( int handle , const TQString & folder , const TQString & key ) {
TQByteArray TDE WalletD: : readEntry ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry * e = b - > readEntry ( key ) ;
TDE Wallet: : Entry * e = b - > readEntry ( key ) ;
if ( e ) {
if ( e ) {
return e - > value ( ) ;
return e - > value ( ) ;
}
}
@ -958,15 +958,15 @@ TQByteArray KWalletD::readEntry(int handle, const TQString& folder, const TQStri
}
}
TQMap < TQString , TQByteArray > K WalletD: : readEntryList ( int handle , const TQString & folder , const TQString & key ) {
TQMap < TQString , TQByteArray > TDE WalletD: : readEntryList ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
TQPtrList < K Wallet: : Entry > e = b - > readEntryList ( key ) ;
TQPtrList < TDE Wallet: : Entry > e = b - > readEntryList ( key ) ;
TQMap < TQString , TQByteArray > rc ;
TQMap < TQString , TQByteArray > rc ;
TQPtrListIterator < K Wallet: : Entry > it ( e ) ;
TQPtrListIterator < TDE Wallet: : Entry > it ( e ) ;
K Wallet: : Entry * entry ;
TDE Wallet: : Entry * entry ;
while ( ( entry = it . current ( ) ) ) {
while ( ( entry = it . current ( ) ) ) {
rc . insert ( entry - > key ( ) , entry - > value ( ) ) ;
rc . insert ( entry - > key ( ) , entry - > value ( ) ) ;
+ + it ;
+ + it ;
@ -978,8 +978,8 @@ TQMap<TQString, TQByteArray> KWalletD::readEntryList(int handle, const TQString&
}
}
TQStringList K WalletD: : entryList ( int handle , const TQString & folder ) {
TQStringList TDE WalletD: : entryList ( int handle , const TQString & folder ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
@ -990,13 +990,13 @@ TQStringList KWalletD::entryList(int handle, const TQString& folder) {
}
}
TQString K WalletD: : readPassword ( int handle , const TQString & folder , const TQString & key ) {
TQString TDE WalletD: : readPassword ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry * e = b - > readEntry ( key ) ;
TDE Wallet: : Entry * e = b - > readEntry ( key ) ;
if ( e & & e - > type ( ) = = K Wallet: : Wallet : : Password ) {
if ( e & & e - > type ( ) = = TDE Wallet: : Wallet : : Password ) {
return e - > password ( ) ;
return e - > password ( ) ;
}
}
}
}
@ -1005,17 +1005,17 @@ TQString KWalletD::readPassword(int handle, const TQString& folder, const TQStri
}
}
TQMap < TQString , TQString > K WalletD: : readPasswordList ( int handle , const TQString & folder , const TQString & key ) {
TQMap < TQString , TQString > TDE WalletD: : readPasswordList ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
TQPtrList < K Wallet: : Entry > e = b - > readEntryList ( key ) ;
TQPtrList < TDE Wallet: : Entry > e = b - > readEntryList ( key ) ;
TQMap < TQString , TQString > rc ;
TQMap < TQString , TQString > rc ;
TQPtrListIterator < K Wallet: : Entry > it ( e ) ;
TQPtrListIterator < TDE Wallet: : Entry > it ( e ) ;
K Wallet: : Entry * entry ;
TDE Wallet: : Entry * entry ;
while ( ( entry = it . current ( ) ) ) {
while ( ( entry = it . current ( ) ) ) {
if ( entry - > type ( ) = = K Wallet: : Wallet : : Password ) {
if ( entry - > type ( ) = = TDE Wallet: : Wallet : : Password ) {
rc . insert ( entry - > key ( ) , entry - > password ( ) ) ;
rc . insert ( entry - > key ( ) , entry - > password ( ) ) ;
}
}
+ + it ;
+ + it ;
@ -1027,15 +1027,15 @@ TQMap<TQString, TQString> KWalletD::readPasswordList(int handle, const TQString&
}
}
int K WalletD: : writeMap ( int handle , const TQString & folder , const TQString & key , const TQByteArray & value ) {
int TDE WalletD: : writeMap ( int handle , const TQString & folder , const TQString & key , const TQByteArray & value ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry e ;
TDE Wallet: : Entry e ;
e . setKey ( key ) ;
e . setKey ( key ) ;
e . setValue ( value ) ;
e . setValue ( value ) ;
e . setType ( K Wallet: : Wallet : : Map ) ;
e . setType ( TDE Wallet: : Wallet : : Map ) ;
b - > writeEntry ( & e ) ;
b - > writeEntry ( & e ) ;
// write changes to disk immediately
// write changes to disk immediately
TQByteArray p ;
TQByteArray p ;
@ -1051,15 +1051,15 @@ int KWalletD::writeMap(int handle, const TQString& folder, const TQString& key,
}
}
int K WalletD: : writeEntry ( int handle , const TQString & folder , const TQString & key , const TQByteArray & value , int entryType ) {
int TDE WalletD: : writeEntry ( int handle , const TQString & folder , const TQString & key , const TQByteArray & value , int entryType ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry e ;
TDE Wallet: : Entry e ;
e . setKey ( key ) ;
e . setKey ( key ) ;
e . setValue ( value ) ;
e . setValue ( value ) ;
e . setType ( K Wallet: : Wallet : : EntryType ( entryType ) ) ;
e . setType ( TDE Wallet: : Wallet : : EntryType ( entryType ) ) ;
b - > writeEntry ( & e ) ;
b - > writeEntry ( & e ) ;
// write changes to disk immediately
// write changes to disk immediately
TQByteArray p ;
TQByteArray p ;
@ -1075,15 +1075,15 @@ int KWalletD::writeEntry(int handle, const TQString& folder, const TQString& key
}
}
int K WalletD: : writeEntry ( int handle , const TQString & folder , const TQString & key , const TQByteArray & value ) {
int TDE WalletD: : writeEntry ( int handle , const TQString & folder , const TQString & key , const TQByteArray & value ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry e ;
TDE Wallet: : Entry e ;
e . setKey ( key ) ;
e . setKey ( key ) ;
e . setValue ( value ) ;
e . setValue ( value ) ;
e . setType ( K Wallet: : Wallet : : Stream ) ;
e . setType ( TDE Wallet: : Wallet : : Stream ) ;
b - > writeEntry ( & e ) ;
b - > writeEntry ( & e ) ;
// write changes to disk immediately
// write changes to disk immediately
TQByteArray p ;
TQByteArray p ;
@ -1099,15 +1099,15 @@ int KWalletD::writeEntry(int handle, const TQString& folder, const TQString& key
}
}
int K WalletD: : writePassword ( int handle , const TQString & folder , const TQString & key , const TQString & value ) {
int TDE WalletD: : writePassword ( int handle , const TQString & folder , const TQString & key , const TQString & value ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
K Wallet: : Entry e ;
TDE Wallet: : Entry e ;
e . setKey ( key ) ;
e . setKey ( key ) ;
e . setValue ( value ) ;
e . setValue ( value ) ;
e . setType ( K Wallet: : Wallet : : Password ) ;
e . setType ( TDE Wallet: : Wallet : : Password ) ;
b - > writeEntry ( & e ) ;
b - > writeEntry ( & e ) ;
// write changes to disk immediately
// write changes to disk immediately
TQByteArray p ;
TQByteArray p ;
@ -1123,12 +1123,12 @@ int KWalletD::writePassword(int handle, const TQString& folder, const TQString&
}
}
int K WalletD: : entryType ( int handle , const TQString & folder , const TQString & key ) {
int TDE WalletD: : entryType ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ! b - > hasFolder ( folder ) ) {
if ( ! b - > hasFolder ( folder ) ) {
return K Wallet: : Wallet : : Unknown ;
return TDE Wallet: : Wallet : : Unknown ;
}
}
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
if ( b - > hasEntry ( key ) ) {
if ( b - > hasEntry ( key ) ) {
@ -1136,12 +1136,12 @@ int KWalletD::entryType(int handle, const TQString& folder, const TQString& key)
}
}
}
}
return K Wallet: : Wallet : : Unknown ;
return TDE Wallet: : Wallet : : Unknown ;
}
}
bool K WalletD: : hasEntry ( int handle , const TQString & folder , const TQString & key ) {
bool TDE WalletD: : hasEntry ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ! b - > hasFolder ( folder ) ) {
if ( ! b - > hasFolder ( folder ) ) {
@ -1155,8 +1155,8 @@ bool KWalletD::hasEntry(int handle, const TQString& folder, const TQString& key)
}
}
int K WalletD: : removeEntry ( int handle , const TQString & folder , const TQString & key ) {
int TDE WalletD: : removeEntry ( int handle , const TQString & folder , const TQString & key ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ! b - > hasFolder ( folder ) ) {
if ( ! b - > hasFolder ( folder ) ) {
@ -1178,12 +1178,12 @@ int KWalletD::removeEntry(int handle, const TQString& folder, const TQString& ke
}
}
void K WalletD: : slotAppUnregistered ( const TQCString & app ) {
void TDE WalletD: : slotAppUnregistered ( const TQCString & app ) {
if ( _handles . contains ( app ) ) {
if ( _handles . contains ( app ) ) {
TQValueList < int > l = _handles [ app ] ;
TQValueList < int > l = _handles [ app ] ;
for ( TQValueList < int > : : Iterator i = l . begin ( ) ; i ! = l . end ( ) ; + + i ) {
for ( TQValueList < int > : : Iterator i = l . begin ( ) ; i ! = l . end ( ) ; + + i ) {
_handles [ app ] . remove ( * i ) ;
_handles [ app ] . remove ( * i ) ;
K Wallet: : Backend * w = _wallets . find ( * i ) ;
TDE Wallet: : Backend * w = _wallets . find ( * i ) ;
if ( w & & ! _leaveOpen & & 0 = = w - > deref ( ) ) {
if ( w & & ! _leaveOpen & & 0 = = w - > deref ( ) ) {
close ( w - > walletName ( ) , true ) ;
close ( w - > walletName ( ) , true ) ;
}
}
@ -1193,7 +1193,7 @@ void KWalletD::slotAppUnregistered(const TQCString& app) {
}
}
void K WalletD: : invalidateHandle ( int handle ) {
void TDE WalletD: : invalidateHandle ( int handle ) {
for ( TQMap < TQCString , TQValueList < int > > : : Iterator i = _handles . begin ( ) ;
for ( TQMap < TQCString , TQValueList < int > > : : Iterator i = _handles . begin ( ) ;
i ! = _handles . end ( ) ;
i ! = _handles . end ( ) ;
+ + i ) {
+ + i ) {
@ -1202,12 +1202,12 @@ void KWalletD::invalidateHandle(int handle) {
}
}
KWallet: : Backend * K WalletD: : getWallet ( const TQCString & appid , int handle ) {
TDEWallet: : Backend * TDE WalletD: : getWallet ( const TQCString & appid , int handle ) {
if ( handle = = 0 ) {
if ( handle = = 0 ) {
return 0L ;
return 0L ;
}
}
K Wallet: : Backend * w = _wallets . find ( handle ) ;
TDE Wallet: : Backend * w = _wallets . find ( handle ) ;
if ( w ) { // the handle is valid
if ( w ) { // the handle is valid
if ( _handles . contains ( appid ) ) { // we know this app
if ( _handles . contains ( appid ) ) { // we know this app
@ -1231,7 +1231,7 @@ KWallet::Backend *KWalletD::getWallet(const TQCString& appid, int handle) {
}
}
void K WalletD: : notifyFailures ( ) {
void TDE WalletD: : notifyFailures ( ) {
if ( ! _showingFailureNotify ) {
if ( ! _showingFailureNotify ) {
_showingFailureNotify = true ;
_showingFailureNotify = true ;
KMessageBox : : information ( 0 , i18n ( " There have been repeated failed attempts to gain access to a wallet. An application may be misbehaving. " ) , i18n ( " TDE Wallet Service " ) ) ;
KMessageBox : : information ( 0 , i18n ( " There have been repeated failed attempts to gain access to a wallet. An application may be misbehaving. " ) , i18n ( " TDE Wallet Service " ) ) ;
@ -1240,7 +1240,7 @@ void KWalletD::notifyFailures() {
}
}
void K WalletD: : doCloseSignals ( int handle , const TQString & wallet ) {
void TDE WalletD: : doCloseSignals ( int handle , const TQString & wallet ) {
TQByteArray data ;
TQByteArray data ;
TQDataStream ds ( data , IO_WriteOnly ) ;
TQDataStream ds ( data , IO_WriteOnly ) ;
ds < < handle ;
ds < < handle ;
@ -1257,8 +1257,8 @@ void KWalletD::doCloseSignals(int handle, const TQString& wallet) {
}
}
int K WalletD: : renameEntry ( int handle , const TQString & folder , const TQString & oldName , const TQString & newName ) {
int TDE WalletD: : renameEntry ( int handle , const TQString & folder , const TQString & oldName , const TQString & newName ) {
K Wallet: : Backend * b ;
TDE Wallet: : Backend * b ;
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
if ( ( b = getWallet ( friendlyDCOPPeerName ( ) , handle ) ) ) {
b - > setFolder ( folder ) ;
b - > setFolder ( folder ) ;
@ -1277,10 +1277,10 @@ int KWalletD::renameEntry(int handle, const TQString& folder, const TQString& ol
}
}
TQStringList K WalletD: : users ( const TQString & wallet ) const {
TQStringList TDE WalletD: : users ( const TQString & wallet ) const {
TQStringList rc ;
TQStringList rc ;
for ( TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
it . current ( ) ;
it . current ( ) ;
+ + it ) {
+ + it ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
@ -1297,8 +1297,8 @@ TQStringList KWalletD::users(const TQString& wallet) const {
}
}
bool K WalletD: : disconnectApplication ( const TQString & wallet , const TQCString & application ) {
bool TDE WalletD: : disconnectApplication ( const TQString & wallet , const TQCString & application ) {
for ( TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
it . current ( ) ;
it . current ( ) ;
+ + it ) {
+ + it ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
@ -1328,7 +1328,7 @@ bool KWalletD::disconnectApplication(const TQString& wallet, const TQCString& ap
}
}
void K WalletD: : emitFolderUpdated ( const TQString & wallet , const TQString & folder ) {
void TDE WalletD: : emitFolderUpdated ( const TQString & wallet , const TQString & folder ) {
TQByteArray data ;
TQByteArray data ;
TQDataStream ds ( data , IO_WriteOnly ) ;
TQDataStream ds ( data , IO_WriteOnly ) ;
ds < < wallet ;
ds < < wallet ;
@ -1337,12 +1337,12 @@ void KWalletD::emitFolderUpdated(const TQString& wallet, const TQString& folder)
}
}
void K WalletD: : emitWalletListDirty ( ) {
void TDE WalletD: : emitWalletListDirty ( ) {
emitDCOPSignal ( " walletListDirty() " , TQByteArray ( ) ) ;
emitDCOPSignal ( " walletListDirty() " , TQByteArray ( ) ) ;
}
}
void K WalletD: : reconfigure ( ) {
void TDE WalletD: : reconfigure ( ) {
TDEConfig cfg ( " tdewalletrc " ) ;
TDEConfig cfg ( " tdewalletrc " ) ;
cfg . setGroup ( " Wallet " ) ;
cfg . setGroup ( " Wallet " ) ;
_firstUse = cfg . readBoolEntry ( " First Use " , true ) ;
_firstUse = cfg . readBoolEntry ( " First Use " , true ) ;
@ -1365,14 +1365,14 @@ void KWalletD::reconfigure() {
// Handle idle changes
// Handle idle changes
if ( _closeIdle ) {
if ( _closeIdle ) {
if ( _idleTime ! = timeSave ) { // Timer length changed
if ( _idleTime ! = timeSave ) { // Timer length changed
TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
for ( ; it . current ( ) ; + + it ) {
for ( ; it . current ( ) ; + + it ) {
_timeouts - > resetTimer ( it . currentKey ( ) , _idleTime ) ;
_timeouts - > resetTimer ( it . currentKey ( ) , _idleTime ) ;
}
}
}
}
if ( ! idleSave ) { // add timers for all the wallets
if ( ! idleSave ) { // add timers for all the wallets
TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
for ( ; it . current ( ) ; + + it ) {
for ( ; it . current ( ) ; + + it ) {
_timeouts - > addTimer ( it . currentKey ( ) , _idleTime ) ;
_timeouts - > addTimer ( it . currentKey ( ) , _idleTime ) ;
}
}
@ -1400,7 +1400,7 @@ void KWalletD::reconfigure() {
// Update if wallet was enabled/disabled
// Update if wallet was enabled/disabled
if ( ! _enabled ) { // close all wallets
if ( ! _enabled ) { // close all wallets
while ( ! _wallets . isEmpty ( ) ) {
while ( ! _wallets . isEmpty ( ) ) {
TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ;
TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ;
if ( ! it . current ( ) ) { // necessary?
if ( ! it . current ( ) ) { // necessary?
break ;
break ;
}
}
@ -1410,23 +1410,23 @@ void KWalletD::reconfigure() {
}
}
bool K WalletD: : isEnabled ( ) const {
bool TDE WalletD: : isEnabled ( ) const {
return _enabled ;
return _enabled ;
}
}
bool K WalletD: : folderDoesNotExist ( const TQString & wallet , const TQString & folder ) {
bool TDE WalletD: : folderDoesNotExist ( const TQString & wallet , const TQString & folder ) {
if ( ! wallets ( ) . contains ( wallet ) ) {
if ( ! wallets ( ) . contains ( wallet ) ) {
return true ;
return true ;
}
}
for ( TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ; it . current ( ) ; + + it ) {
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ; it . current ( ) ; + + it ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
return it . current ( ) - > folderDoesNotExist ( folder ) ;
return it . current ( ) - > folderDoesNotExist ( folder ) ;
}
}
}
}
KWallet: : Backend * b = new K Wallet: : Backend ( wallet ) ;
TDEWallet: : Backend * b = new TDE Wallet: : Backend ( wallet ) ;
b - > open ( TQByteArray ( ) ) ;
b - > open ( TQByteArray ( ) ) ;
bool rc = b - > folderDoesNotExist ( folder ) ;
bool rc = b - > folderDoesNotExist ( folder ) ;
delete b ;
delete b ;
@ -1434,18 +1434,18 @@ bool KWalletD::folderDoesNotExist(const TQString& wallet, const TQString& folder
}
}
bool K WalletD: : keyDoesNotExist ( const TQString & wallet , const TQString & folder , const TQString & key ) {
bool TDE WalletD: : keyDoesNotExist ( const TQString & wallet , const TQString & folder , const TQString & key ) {
if ( ! wallets ( ) . contains ( wallet ) ) {
if ( ! wallets ( ) . contains ( wallet ) ) {
return true ;
return true ;
}
}
for ( TQIntDictIterator < K Wallet: : Backend > it ( _wallets ) ; it . current ( ) ; + + it ) {
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( _wallets ) ; it . current ( ) ; + + it ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
if ( it . current ( ) - > walletName ( ) = = wallet ) {
return it . current ( ) - > entryDoesNotExist ( folder , key ) ;
return it . current ( ) - > entryDoesNotExist ( folder , key ) ;
}
}
}
}
KWallet: : Backend * b = new K Wallet: : Backend ( wallet ) ;
TDEWallet: : Backend * b = new TDE Wallet: : Backend ( wallet ) ;
b - > open ( TQByteArray ( ) ) ;
b - > open ( TQByteArray ( ) ) ;
bool rc = b - > entryDoesNotExist ( folder , key ) ;
bool rc = b - > entryDoesNotExist ( folder , key ) ;
delete b ;
delete b ;
@ -1453,17 +1453,17 @@ bool KWalletD::keyDoesNotExist(const TQString& wallet, const TQString& folder, c
}
}
bool K WalletD: : implicitAllow ( const TQString & wallet , const TQCString & app ) {
bool TDE WalletD: : implicitAllow ( const TQString & wallet , const TQCString & app ) {
return _implicitAllowMap [ wallet ] . contains ( TQString : : fromLocal8Bit ( app ) ) ;
return _implicitAllowMap [ wallet ] . contains ( TQString : : fromLocal8Bit ( app ) ) ;
}
}
bool K WalletD: : implicitDeny ( const TQString & wallet , const TQCString & app ) {
bool TDE WalletD: : implicitDeny ( const TQString & wallet , const TQCString & app ) {
return _implicitDenyMap [ wallet ] . contains ( TQString : : fromLocal8Bit ( app ) ) ;
return _implicitDenyMap [ wallet ] . contains ( TQString : : fromLocal8Bit ( app ) ) ;
}
}
TQCString K WalletD: : friendlyDCOPPeerName ( ) {
TQCString TDE WalletD: : friendlyDCOPPeerName ( ) {
DCOPClient * dc = callingDcopClient ( ) ;
DCOPClient * dc = callingDcopClient ( ) ;
if ( ! dc ) {
if ( ! dc ) {
return " " ;
return " " ;
@ -1472,18 +1472,18 @@ TQCString KWalletD::friendlyDCOPPeerName() {
}
}
void K WalletD: : timedOut ( int id ) {
void TDE WalletD: : timedOut ( int id ) {
K Wallet: : Backend * w = _wallets . find ( id ) ;
TDE Wallet: : Backend * w = _wallets . find ( id ) ;
if ( w ) {
if ( w ) {
closeWallet ( w , id , true ) ;
closeWallet ( w , id , true ) ;
}
}
}
}
void K WalletD: : closeAllWallets ( ) {
void TDE WalletD: : closeAllWallets ( ) {
TQIntDict < K Wallet: : Backend > tw = _wallets ;
TQIntDict < TDE Wallet: : Backend > tw = _wallets ;
for ( TQIntDictIterator < K Wallet: : Backend > it ( tw ) ; it . current ( ) ; + + it ) {
for ( TQIntDictIterator < TDE Wallet: : Backend > it ( tw ) ; it . current ( ) ; + + it ) {
closeWallet ( it . current ( ) , it . currentKey ( ) , true ) ;
closeWallet ( it . current ( ) , it . currentKey ( ) , true ) ;
}
}
@ -1501,13 +1501,13 @@ void KWalletD::closeAllWallets() {
}
}
TQString K WalletD: : networkWallet ( ) {
TQString TDE WalletD: : networkWallet ( ) {
return K Wallet: : Wallet : : NetworkWallet ( ) ;
return TDE Wallet: : Wallet : : NetworkWallet ( ) ;
}
}
TQString K WalletD: : localWallet ( ) {
TQString TDE WalletD: : localWallet ( ) {
return K Wallet: : Wallet : : LocalWallet ( ) ;
return TDE Wallet: : Wallet : : LocalWallet ( ) ;
}
}