Bump up filename length limit to 50

The usual limit seems to be 255 bytes, so even when assuming 5-byte
UTF-8 chars for every letter, 50 should be fine.

http://serverfault.com/questions/9546/filename-length-limits-on-linux/9548#9548
This commit is contained in:
Florian Bruhin 2016-08-02 16:12:09 +02:00
parent b8ef6fa44e
commit a3047008dd

View File

@ -1334,8 +1334,8 @@ class TempDownloadManager(QObject):
encoding = sys.getfilesystemencoding()
suggested_name = utils.force_encoding(suggested_name, encoding)
# Make sure that the filename is not too long
if len(suggested_name) > 20:
suggested_name = suggested_name[:10] + '...' + suggested_name[-10:]
if len(suggested_name) > 50:
suggested_name = suggested_name[:25] + '...' + suggested_name[-25:]
fobj = tempfile.NamedTemporaryFile(dir=tmpdir.name, delete=False,
suffix=suggested_name)
self.files.append(fobj)