URL of a website can exceed 255 characters. Consequently we cannot create a link to such URL.
In such cases try to truncate the filename to 255 characters.
BUG: 342247
dfaure | |
ngraham |
URL of a website can exceed 255 characters. Consequently we cannot create a link to such URL.
In such cases try to truncate the filename to 255 characters.
BUG: 342247
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
This has several issues:
The first issue is solved by the use of NAME_MAX (the code doesn't actually hardcode 255), but indeed those are bytes, so this has to use QFile::encodeName() (to get to QByteArray), truncate, then QFile::decodeName() (to get back to QString). But what if this cuts in the middle of a utf-8 sequence....