D13315: Detect mime type of local files based on their contents

2018-09-19 Thread Nathaniel Graham
ngraham added a comment. In D13315#328252 , @miklosm wrote: > There may be an other solution to the problem I was trying to solve with this patch series: remove the jpeg thumbnailer, and let the generic image thumbnailer handle jpeg as well.

D13315: Detect mime type of local files based on their contents

2018-09-19 Thread Ben Cooksley
bcooksley added a comment. Please note that any CMS that isn't serving files for download properly (ie. not using Content-Disposition and telling the client the name the file should be called) is broken and isn't something we can fix. REPOSITORY R241 KIO REVISION DETAIL

D13315: Detect mime type of local files based on their contents

2018-09-19 Thread David Faure
dfaure added a comment. I agree, extensions are not reliable over HTTP, which is why mimeTypeForUrl doesn't use them for HTTP urls. But here we're in KFileItem, so much more likely talking about local files or FTP/SFTP/FISH/SMB/etc. where the *.php issue doesn't happen. > The case of

D13315: Detect mime type of local files based on their contents

2018-09-18 Thread Miklós Máté
miklosm added a comment. In D13315#327933 , @dfaure wrote: > No, no. Too unreliable and against the MIME spec. > > You're testing it for the ideal case, images, which have proper headers. > But there's no reliable "magic" (determination

D13315: Detect mime type of local files based on their contents

2018-09-18 Thread David Faure
dfaure added a comment. (BTW thanks for what you said about FUSE, I agree 100% and it makes me glad to see some people from the opposite camp, when so many people are trying to convince me that network mounts via FUSE is the solution to all problems on earth, see bug 75324) >

D13315: Detect mime type of local files based on their contents

2018-09-18 Thread David Faure
dfaure requested changes to this revision. dfaure added a comment. This revision now requires changes to proceed. No, no. Too unreliable and against the MIME spec. You're testing it for the ideal case, images, which have proper headers. But there's no reliable "magic" (determination

D13315: Detect mime type of local files based on their contents

2018-09-17 Thread Nathaniel Graham
ngraham added a reviewer: broulik. ngraham added a comment. @broulik, given your recent crusade against blocking calls, can you think of a better way to do this? REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D13315 To: miklosm, #frameworks, dfaure, broulik Cc:

D13315: Detect mime type of local files based on their contents

2018-09-17 Thread Nathaniel Graham
ngraham edited the summary of this revision. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D13315 To: miklosm, #frameworks, dfaure Cc: broulik, ngraham, apol, kde-frameworks-devel, michaelh, bruns

D13315: Detect mime type of local files based on their contents

2018-06-04 Thread Miklós Máté
miklosm added inline comments. INLINE COMMENTS > broulik wrote in kfileitem.cpp:730 > That and also (broken) NFS mounts. We have that in quite a few places where > seemingly innocent local files can freeze the entire UI, so I'd rather not > introduce another place where this may happen. >

D13315: Detect mime type of local files based on their contents

2018-06-04 Thread Kai Uwe Broulik
broulik added inline comments. INLINE COMMENTS > apol wrote in kfileitem.cpp:730 > I'm not sure that makes sense. The fact that it's a local url doesn't mean it > will be fast to read. > FUSE appears as local urls and it's slow. That and also (broken) NFS mounts. We have that in quite a few

D13315: Detect mime type of local files based on their contents

2018-06-03 Thread Aleix Pol Gonzalez
apol added inline comments. INLINE COMMENTS > kfileitem.cpp:730 > const QUrl url = mostLocalUrl(); > -d->m_mimeType = db.mimeTypeForUrl(url); > +if (isLocalUrl) { > +qDebug() << "determine for local " << url.toLocalFile(); I'm not sure that

D13315: Detect mime type of local files based on their contents

2018-06-03 Thread Elvis Angelaccio
elvisangelaccio added a reviewer: dfaure. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D13315 To: miklosm, #frameworks, dfaure Cc: kde-frameworks-devel, michaelh, ngraham, bruns

D13315: Detect mime type of local files based on their contents

2018-06-03 Thread Nathaniel Graham
ngraham added a reviewer: Frameworks. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D13315 To: miklosm, #frameworks Cc: kde-frameworks-devel, michaelh, ngraham, bruns

D13315: Detect mime type of local files based on their contents

2018-06-03 Thread Miklós Máté
miklosm created this revision. Restricted Application added a project: Frameworks. Restricted Application added a subscriber: kde-frameworks-devel. miklosm requested review of this revision. REVISION SUMMARY KFileItem::determineMimeType() is an explicit order to thoroughly detect the file