return dir;
}
-QString Cache::subDir( const QString& host )
-{
- int l = host.length();
- for ( int i = 0; i < l; i++ ) {
- if ( host[ i ].isLetter() && ( host[ i ] != 'w' ) ) {
- return QString( host[ i ] );
- }
- }
- return "0";
-}
-
-QString Cache::hashString( const KURL& url )
-{
- unsigned long hash = 0x00000000;
- QCString u = url.url().latin1();
- for ( int i = u.length(); i--; ) {
- hash = ( hash * 12211 + u[ i ] ) % 2147483563;
- }
-
- QString ret;
- ret.sprintf( "%08lx", hash );
-
- return ret;
-}
-
-// original is in http.cc
QString Cache::getPath( const KURL& url )
{
- QString path = url.path();
- path.replace( QChar( '/' ), QChar( '_' ) );
-
- QString host = url.host().lower();
-
return baseDir( url ) + Kita::datToCache( url.url() );
-// return baseDir( url ) + subDir( host ) + "/" + host + path + '_' + hashString( url );
}
*/
class Cache
{
- public:
static QString baseDir( const KURL& url );
- static QString subDir( const QString& host );
- static QString hashString( const KURL& url );
+ public:
static QString getPath( const KURL& url );
};