D8084: KAutoSaveFile breaks if source file name contains a space!

Jean-Baptiste Mardelle noreply at phabricator.kde.org
Sun Oct 1 09:25:51 UTC 2017


mardelle created this revision.
mardelle added reviewers: Frameworks, shaforostoff.
Restricted Application added a project: Frameworks.

REVISION SUMMARY
  KAutoSaveFile does not correctly handle simple characters like spaces in file names!!!
  When creating a stale file (backup file) , to determine the file name it uses:
  in tempFileName(), line 83:
  return QString::fromLatin1(QUrl::toPercentEncoding(name).constData());
  
  So the filename is encoded using percent encoding. But when checking for an existing backup file, it does:
  in extractManagedFilePath, line 180:
  managedFileName.setPath(QUrl::fromPercentEncoding(encodedPath) + QLatin1Char('/') + QFileInfo(staleFileName.left(sepPos)).fileName());
  
  So the path part is correctly restored from percent encoding, but the filename part is not decoded.
  So we end up comparing "my file" with "my%20file" and the stale file is not correctly identified!

TEST PLAN
  Project files with space in their name in Kdenlive now have crash recovery working

REPOSITORY
  R244 KCoreAddons

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

AFFECTED FILES
  src/lib/io/kautosavefile.cpp

To: mardelle, #frameworks, shaforostoff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171001/db06d906/attachment.html>


More information about the Kde-frameworks-devel mailing list