Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.6, 5.5.1, 5.6.0 Alpha
-
None
-
Ubuntu 15.10
Description
The way a raw url string is parsed into a QUrl instance can create an invalid url!
Example
QUrl("afp://Admin@Hetty-MacLeods-MacBook-Pro.local/admin/Pictures/Scan.jpeg");
will create an url of the form:
afp://Admin@hetty-macleods-macbook-pro.local/admin/Pictures/Scan.jpeg
Notice the change to lower case in the host!
Fortunately this is no longer a valid URL and for instance this call will fail to create a valid file:
g_file_new_for_uri(QUrl("afp://Admin@Hetty-MacLeods-MacBook-Pro.local/admin/Pictures/Scan.jpeg").toEncoded());
g_file_query_exists on the result will report false.
g_file_get_path will even return an empty string!
This issue obviously breaks Drag And Drop for network paths, at least for afp
(smb is fine, because it is lowercase already)
Debugging
The code which breaks the URL is:
File: qurlidna.cpp
Func: qt_ACE_do
Line: 2509
if (uc >= 'A' && uc <= 'Z') *out = QChar(uc | 0x20);
Note, the issue was present in 4.x as well!