@ -76,10 +76,9 @@ public:
~ KPasswordEdit ( ) ;
~ KPasswordEdit ( ) ;
/**
/**
* Returns the password . The memory is freed in the destructor
* Returns the password .
* so you should make a copy .
*/
*/
const char * password ( ) const ;
TQString password ( ) const ;
/**
/**
* Erases the current password .
* Erases the current password .
@ -129,7 +128,7 @@ private:
* < b > Usage example < / b > \ n
* < b > Usage example < / b > \ n
*
*
* \ code
* \ code
* TQ C String password ;
* TQ String password ;
* int result = KPasswordDialog : : getPassword ( password , i18n ( " Prompt message " ) ) ;
* int result = KPasswordDialog : : getPassword ( password , i18n ( " Prompt message " ) ) ;
* if ( result = = KPasswordDialog : : Accepted )
* if ( result = = KPasswordDialog : : Accepted )
* use ( password ) ;
* use ( password ) ;
@ -146,14 +145,6 @@ private:
* Core dumps are dangerous because they are an image of the process memory ,
* Core dumps are dangerous because they are an image of the process memory ,
* and thus include any passwords that were in memory .
* and thus include any passwords that were in memory .
*
*
* @ li You should delete passwords as soon as they are not needed anymore .
* The functions getPassword ( ) and getNewPassword ( ) return the
* password as a TQCString . I believe this is safer than a TQString . A QString
* stores its characters internally as 16 - bit wide values , so conversions are
* needed , both for creating the TQString and by using it . The temporary
* memory used for these conversion is probably not erased . This could lead
* to stray passwords in memory , even if you think you erased all of them .
*
* @ author Geert Jansen < jansen @ kde . org >
* @ author Geert Jansen < jansen @ kde . org >
*/
*/
@ -327,10 +318,9 @@ public:
int passwordStrengthWarningLevel ( ) const ;
int passwordStrengthWarningLevel ( ) const ;
/**
/**
* Returns the password entered . The memory is freed in the destructor ,
* Returns the password entered .
* so you should make a copy .
*/
*/
const char * password ( ) const { return m_pEdit - > password ( ) ; }
TQString password ( ) const { return m_pEdit - > password ( ) ; }
/**
/**
* Clears the password input field . You might want to use this after the
* Clears the password input field . You might want to use this after the
@ -356,7 +346,7 @@ public:
* is shown and the result is stored in * keep .
* is shown and the result is stored in * keep .
* @ return Result code : Accepted or Rejected .
* @ return Result code : Accepted or Rejected .
*/
*/
static int getPassword ( TQ C String & password , TQString prompt , int * keep = 0L ) ;
static int getPassword ( TQ String & password , TQString prompt , int * keep = 0L ) ;
/**
/**
* Pops up the dialog , asks the user for a password and returns it . The
* Pops up the dialog , asks the user for a password and returns it . The
@ -368,7 +358,7 @@ public:
* information . The text is word broken to fit nicely in the dialog .
* information . The text is word broken to fit nicely in the dialog .
* @ return Result code : Accepted or Rejected .
* @ return Result code : Accepted or Rejected .
*/
*/
static int getNewPassword ( TQ C String & password , TQString prompt ) ;
static int getNewPassword ( TQ String & password , TQString prompt ) ;
/**
/**
* Static helper function that disables core dumps .
* Static helper function that disables core dumps .
@ -388,7 +378,7 @@ protected:
* checking in derived classes . It should return @ p true if the
* checking in derived classes . It should return @ p true if the
* password is valid , @ p false otherwise .
* password is valid , @ p false otherwise .
*/
*/
virtual bool checkPassword ( const char * ) { return true ; }
virtual bool checkPassword ( const TQString & ) { return true ; }
private slots :
private slots :
void enableOkBtn ( ) ;
void enableOkBtn ( ) ;