95
96
kdDebug() << "kio_msits::get: parseLoadAndLookup returned " << fileName << endl;
97
if ( isDirectory (fileName) )
99
error( KIO::ERR_IS_DIRECTORY, url.prettyURL() );
103
if ( !ResolveObject ( fileName, &ui) )
105
kdDebug() << "kio_msits::get: could not resolve filename " << fileName << endl;
106
error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
110
QByteArray buf (ui.length);
112
if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 )
114
kdDebug() << "kio_msits::get: could not retrieve filename " << fileName << endl;
115
error( KIO::ERR_NO_CONTENT, url.prettyURL() );
119
totalSize( ui.length );
98
if ( handleFileType( url.path(), htmdata ) )
100
buf = htmdata.utf8();
101
kdDebug() << "Using special handling for image pages: " << htmdata << endl;
105
if ( isDirectory (fileName) )
107
error( KIO::ERR_IS_DIRECTORY, url.prettyURL() );
111
if ( !ResolveObject ( fileName, &ui) )
113
kdDebug() << "kio_msits::get: could not resolve filename " << fileName << endl;
114
error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
118
buf.resize( ui.length );
120
if ( RetrieveObject (&ui, (unsigned char*) buf.data(), 0, ui.length) == 0 )
122
kdDebug() << "kio_msits::get: could not retrieve filename " << fileName << endl;
123
error( KIO::ERR_NO_CONTENT, url.prettyURL() );
128
totalSize( buf.size() );
120
129
KMimeMagicResult * result = KMimeMagic::self()->findBufferFileType( buf, fileName );
121
130
kdDebug() << "Emitting mimetype " << result->mimeType() << endl;
123
132
mimeType( result->mimeType() );
125
processedSize( ui.length );
134
processedSize( buf.size() );