Bug 749213
Summary: | QUrl.toLocalFile behavior change, regression | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Rex Dieter <rdieter> |
Component: | qt | Assignee: | Than Ngo <than> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | itamar, jreznik, kevin, ltinkl, rdieter, rnovacek, smparrish, than |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | qt-4.8.0-0.23.rc1.fc16 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-10-29 06:30:38 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 712881 |
Description
Rex Dieter
2011-10-26 13:47:16 UTC
Filed upstream, https://bugreports.qt.nokia.com/browse/QTBUG-22380 sorry, closed the older one too quick, cloned/re-opened as https://bugreports.qt.nokia.com/browse/QTBUG-22382 and tracking KUrl impact upstream, http://bugs.kde.org/285028 Pretty sure this is the upstream Qt commit the introduced this: http://qt.gitorious.org/qt/qt/commit/a2f797b52c4274a62a7cf1f0939aca1429afe211 Easiest fix (reverting the logic change only without reverting the API addition and the cleanups): In the (new) isLocalFile function, before: if (d->scheme.compare(QLatin1String("file"), Qt::CaseInsensitive) != 0) add the following: // Treat URLs with no scheme as local for backwards compatibility if (d->scheme.isEmpty()) return true; (Not tested yet, but looking at the offending commit, it should fix this.) It turns out that the behavior of the new QUrl::isLocalFile() is consistent with the existing KUrl::isLocalFile() and Q3Url::isLocalFile() functions, so an alternative easy fix: In the toLocalFile function, change: if (!isLocalFile()) to: // Treat URLs with no scheme as local for backwards compatibility if (!d->scheme.isEmpty() && !isLocalFile()) (Again, not tested yet, but should work based on my proofreading, and fix this regression in the least invasive way possible.) Actually, please use: // Treat URLs with no scheme as local for backwards compatibility if (!isLocalFile() && !d->scheme.isEmpty()) in this order, because isLocalFile() also ensures the URL is parsed (as written in the comment above the line we're changing). Actually, please use: // Treat URLs with no scheme as local for backwards compatibility if (!isLocalFile() && (!d || !d->scheme.isEmpty())) Some code (e.g. in Digikam) is calling isLocalFile() on a null QUrl(), without the added !d check, it crashes trying to check !d->scheme.isEmpty(). (I use !d || rather than d && because if d is NULL, we really SHOULD return a QString() (what else?).) qt-4.8.0-0.21.rc1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/qt-4.8.0-0.21.rc1.fc16 qt-4.8.0-0.23.rc1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/qt-4.8.0-0.23.rc1.fc16 qt-4.8.0-0.23.rc1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. Removing external tracker bug with the id '22380' as it is not valid for this tracker Removing external tracker bug with the id '22382' as it is not valid for this tracker |