|
|
@ -556,27 +556,32 @@ TQString KFileItem::mimetype() const
|
|
|
|
|
|
|
|
|
|
|
|
TQString KFileItem::mimetypeFast() const
|
|
|
|
TQString KFileItem::mimetypeFast() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (isMimeTypeKnown()) {
|
|
|
|
if (isMimeTypeKnown()) {
|
|
|
|
return mimetype();
|
|
|
|
return mimetype();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
return m_pMimeType->name();
|
|
|
|
return m_pMimeType->name();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KMimeType::Ptr KFileItem::mimeTypePtrFast()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return m_pMimeType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KMimeType::Ptr KFileItem::determineMimeType()
|
|
|
|
KMimeType::Ptr KFileItem::determineMimeType()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !m_pMimeType || !m_bMimeTypeKnown )
|
|
|
|
if ( !m_pMimeType || !m_bMimeTypeKnown )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool isLocalURL;
|
|
|
|
bool isLocalURL;
|
|
|
|
KURL url = mostLocalURL(isLocalURL);
|
|
|
|
KURL url = mostLocalURL(isLocalURL);
|
|
|
|
|
|
|
|
|
|
|
|
m_pMimeType = KMimeType::findByURL( url, m_fileMode, isLocalURL );
|
|
|
|
m_pMimeType = KMimeType::findByURL( url, m_fileMode, isLocalURL );
|
|
|
|
//kdDebug() << "finding mimetype for " << url.url() << " : " << m_pMimeType->name() << endl;
|
|
|
|
//kdDebug() << "finding mimetype for " << url.url() << " : " << m_pMimeType->name() << endl;
|
|
|
|
m_bMimeTypeKnown = true;
|
|
|
|
m_bMimeTypeKnown = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return m_pMimeType;
|
|
|
|
return m_pMimeType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KFileItem::isMimeTypeKnown() const
|
|
|
|
bool KFileItem::isMimeTypeKnown() const
|
|
|
|