From kde-commits Sat Jul 31 22:47:39 2004 From: Nicolas Goutte Date: Sat, 31 Jul 2004 22:47:39 +0000 To: kde-commits Subject: koffice/lib/kofficecore Message-Id: <20040731224739.CDEF39A00 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109131407810535 CVS commit by goutte: Use KMimeType::findByPath to avoid an implicit conversion from QString to KURL (Not sure if it coud be backported to KOffice 1.3.x, as I do not know if KDE 3.1.x had already that member function.) M +3 -1 koPictureImage.cc 1.21 --- koffice/lib/kofficecore/koPictureImage.cc #1.20:1.21 @@ -168,5 +168,7 @@ QString KoPictureImage::getMimeType(cons QString fileName("/tmp/temp."); fileName+=extension; - QString mimetype=KMimeType::findByURL(fileName,0,true,true)->name(); + // Find the mimetype only by the extension, not by file content (as the file is empty!) + const QString mimetype( KMimeType::findByPath( fileName, 0 ,true )->name() ); + // ### TODO: use KMimeType::findByContent (but then the mimetype probably need to be cached) kdDebug(30003) << "Image is mime type: " << mimetype << endl; return mimetype;