Skip to content

Commit

Permalink
QMimeDatabase::mimeTypeForUrl: skip content check for remote URLs
Browse files Browse the repository at this point in the history
The code was trying to open a local file with the same path
as the remote URL, which is unnecessary and wrong in the unlikely
case where such a file would exist.

Spotted by Christoph Feck when reading the code.

Change-Id: I1d77e5781cf606b025d2877f48a9914dd1e36b1d
Reviewed-by: Giuseppe D'Angelo <[email protected]>
  • Loading branch information
dfaure-kdab committed Jul 3, 2017
1 parent f2df5c6 commit df06926
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/corelib/mimetypes/qmimedatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ QMimeType QMimeDatabase::mimeTypeForUrl(const QUrl &url) const
if (scheme.startsWith(QLatin1String("http")) || scheme == QLatin1String("mailto"))
return mimeTypeForName(d->defaultMimeType());

return mimeTypeForFile(url.path());
return mimeTypeForFile(url.path(), MatchExtension);
}

/*!
Expand Down

0 comments on commit df06926

Please sign in to comment.