--- branches/KDE/3.5/kdenetwork/kopete/libkopete/kopetepassword.cpp	2006/08/17 13:37:13	573903
+++ branches/KDE/3.5/kdenetwork/kopete/libkopete/kopetepassword.cpp	2007/05/17 06:53:22	665563
@@ -35,22 +35,7 @@
 #include <kmessagebox.h>
 #include <kiconloader.h>
 #include <kpassdlg.h>
-
-/**
- * Function for symmetrically (en/de)crypting strings for config file,
- * taken from KMail.
- *
- * @author Stefan Taferner <taferner@alpin.or.at>
- */
-static QString cryptStr( const QString &aStr )
-{
-	//Once Kopete depends on 3.2 just remove this function and use KStringHandler::obscure
-	QString result;
-	for ( uint i = 0; i < aStr.length(); i++ )
-		result += ( aStr[ i ].unicode() < 0x20) ? aStr[ i ] : QChar( 0x1001F - aStr[ i ].unicode() );
-
-	return result;
-}
+#include <kstringhandler.h>
 
 class Kopete::Password::Private
 {
@@ -402,7 +387,7 @@
 	if ( passwordCrypted.isNull() )
 		d->passwordFromKConfig = QString::null;
 	else
-		d->passwordFromKConfig = cryptStr( passwordCrypted );
+		d->passwordFromKConfig = KStringHandler::obscure( passwordCrypted );
 
 	d->remembered = config->readBoolEntry( "RememberPassword", false );
 	d->isWrong = config->readBoolEntry( "PasswordIsWrong", false );
@@ -425,7 +410,7 @@
 	config->setGroup( d->configGroup );
 
 	if ( d->remembered && !d->passwordFromKConfig.isNull() )
-		config->writeEntry( "Password", cryptStr( d->passwordFromKConfig ) );
+		config->writeEntry( "Password", KStringHandler::obscure( d->passwordFromKConfig ) );
 	else
 		config->deleteEntry( "Password" );