kioslave/mbox
27 UrlInfo::UrlInfo(
const KUrl& url,
const UrlType type )
29 m_filename( new QString ),
32 calculateInfo( url, type );
41 QString UrlInfo::mimetype()
const
46 return "message/rfc822";
48 return "inode/directory";
55 QString UrlInfo::filename()
const
60 QString UrlInfo::id()
const
65 QString UrlInfo::url()
const
67 return *m_filename +
'/' + *m_id;
71 void UrlInfo::calculateInfo(
const KUrl& url,
const UrlType type )
75 if( !found && type & UrlInfo::message )
76 found = isMessage( url );
77 if( !found && type & UrlInfo::directory )
78 found = isDirectory( url );
87 bool UrlInfo::isDirectory(
const KUrl& url )
90 QString filename = url.path();
94 while( filename.length() > 1 && filename.right( 1 ) ==
"/" )
95 filename.remove( filename.length()-2, 1 );
98 info.setFile( filename );
103 *m_filename = filename;
106 kDebug() <<
"urlInfo::isDirectory(" << url <<
" )";
110 bool UrlInfo::isMessage(
const KUrl& url )
112 QString path = url.path();
114 int cutindex = path.lastIndexOf(
'/' );
121 info.setFile( path.left( cutindex ) );
126 kDebug() <<
"urlInfo::isMessage(" << url <<
" )";
128 *m_id = path.right( path.length() - cutindex - 1 );
129 *m_filename = path.left( cutindex );
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:25:32 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.