diff --git a/kdecore/tests/kstringhandlertest.cpp b/kdecore/tests/kstringhandlertest.cpp index 7e7da216..c47c2a13 100644 --- a/kdecore/tests/kstringhandlertest.cpp +++ b/kdecore/tests/kstringhandlertest.cpp @@ -141,16 +141,6 @@ void KStringHandlerTest::naturalCompare() QCOMPARE(KStringHandler::naturalCompare("abc.jpg", "abc_a.jpg", Qt::CaseInsensitive), -1); } -void KStringHandlerTest::obscure() -{ - // See bug 167900, obscure() produced chars that could not properly be converted to and from - // UTF8. The result was that storing passwords with '!' in them did not work. - QString test = "!TEST!"; - QString obscured = KStringHandler::obscure( test ); - QByteArray obscuredBytes = obscured.toUtf8(); - QCOMPARE( KStringHandler::obscure( QString::fromUtf8( obscuredBytes ) ), test ); -} - void KStringHandlerTest::preProcessWrap_data() { const QChar zwsp(0x200b); diff --git a/kdecore/tests/kstringhandlertest.h b/kdecore/tests/kstringhandlertest.h index dc0f8b28..54c6b383 100644 --- a/kdecore/tests/kstringhandlertest.h +++ b/kdecore/tests/kstringhandlertest.h @@ -12,7 +12,6 @@ private Q_SLOTS: void tagURLs(); void perlSplit(); void naturalCompare(); - void obscure(); void preProcessWrap_data(); void preProcessWrap(); diff --git a/kdecore/text/kstringhandler.cpp b/kdecore/text/kstringhandler.cpp index 10c10eb6..df62cdd2 100644 --- a/kdecore/text/kstringhandler.cpp +++ b/kdecore/text/kstringhandler.cpp @@ -185,20 +185,6 @@ QString KStringHandler::tagUrls( const QString& text ) return richText; } -QString KStringHandler::obscure( const QString &str ) -{ - QString result; - const QChar *unicode = str.unicode(); - for ( int i = 0; i < str.length(); ++i ) - // yes, no typo. can't encode ' ' or '!' because - // they're the unicode BOM. stupid scrambling. stupid. - result += ( unicode[ i ].unicode() <= 0x21 ) ? unicode[ i ] : - QChar( 0x1001F - unicode[ i ].unicode() ); - - return result; -} - - bool KStringHandler::isUtf8( const char *buf ) { int i, n; diff --git a/kdecore/text/kstringhandler.h b/kdecore/text/kstringhandler.h index a3e1242c..ede8daf2 100644 --- a/kdecore/text/kstringhandler.h +++ b/kdecore/text/kstringhandler.h @@ -165,21 +165,6 @@ namespace KStringHandler */ KDECORE_EXPORT QString tagUrls( const QString& text ); - /** - Obscure string by using a simple symmetric encryption. Applying the - function to a string obscured by this function will result in the original - string. - - The function can be used to obscure passwords stored to configuration - files. Note that this won't give you any more security than preventing - that the password is directly copied and pasted. - - @param str string to be obscured - @return obscured string - */ - KDECORE_EXPORT QString obscure( const QString &str ); - - /** Guess whether a string is UTF8 encoded.