D21155: Truncate long filname before creating a link

2019-05-14 Thread David Faure
dfaure added a comment.


  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

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D21155

To: chinmoyr, dfaure, ngraham
Cc: bruns, kde-frameworks-devel, michaelh, ngraham


D21155: Truncate long filname before creating a link

2019-05-14 Thread Stefan BrĂ¼ns
bruns added a comment.


  This has several issues:
  
  - 255 is only a typical value, it can be more or less, see 
https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits
- exFAT can store 255 UTF-16 characters
- eCryptFS can only use ~140 bytes (remainder is used for mangling/prefix)
  - for most FS on Linux, 255 is in **bytes**, not characters

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D21155

To: chinmoyr, dfaure, ngraham
Cc: bruns, kde-frameworks-devel, michaelh, ngraham


D21155: Truncate long filname before creating a link

2019-05-14 Thread Chinmoy Ranjan Pradhan
This revision was automatically updated to reflect the committed changes.
Closed by commit R241:092beaf6fbab: Truncate long filname before creating a 
link (authored by chinmoyr).

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21155?vs=57929=58069

REVISION DETAIL
  https://phabricator.kde.org/D21155

AFFECTED FILES
  src/core/copyjob.cpp

To: chinmoyr, dfaure, ngraham
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D21155: Truncate long filname before creating a link

2019-05-13 Thread Nathaniel Graham
ngraham accepted this revision.

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D21155

To: chinmoyr, dfaure, ngraham
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D21155: Truncate long filname before creating a link

2019-05-12 Thread David Faure
dfaure accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D21155

To: chinmoyr, dfaure
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D21155: Truncate long filname before creating a link

2019-05-12 Thread Chinmoy Ranjan Pradhan
chinmoyr created this revision.
chinmoyr added a reviewer: dfaure.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
chinmoyr requested review of this revision.

REVISION SUMMARY
  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

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D21155

AFFECTED FILES
  src/core/copyjob.cpp

To: chinmoyr, dfaure
Cc: kde-frameworks-devel, michaelh, ngraham, bruns