D8208: [WIP] Add Duplicate feature

Fabian Vogt noreply at phabricator.kde.org
Sat Jan 11 11:23:39 GMT 2020


fvogt added a comment.


  In D8208#591704 <https://phabricator.kde.org/D8208#591704>, @ngraham wrote:
  
  > @fvogt "test.foo" becoming "test.foo copy" is intentional because .foo isn't a known valid extension, and it's valid for files to have dots in their names. In general the approach of using `QMimeDatabase` supports this, solves the problems of using `QFileInfo` that @pino pointed out, and also allows seamless support for filename extensions with two dots in them (e.g. `tar.gz`).
  >
  > If I go back to using `QFileInfo` to chop up the file into filename + extension, then there's the difficult choice of what kind of file to fail on: If I use `QFileInfo::suffix()`, it will fail for extensions with two dots like `.tar.gz`; if I use `QFileInfo::completeSuffix()`, that fails for files with dots in their names outside of the extension.
  >
  > Each approach has drawbacks. Which would you find acceptable?
  
  
  The case preserving issue is more severe than the issue with unknown extensions, so if that's fixed, using `QMimeDatabase` is IMO fine. Maybe with a fallback to `completeSuffix` if it didn't have an entry.

REPOSITORY
  R318 Dolphin

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

To: ngraham, #dolphin, #kde_applications, elvisangelaccio, dfaure, broulik, davidedmundson, fvogt
Cc: fvogt, pino, mthw, kfm-devel, meven, markg, fazevedo, cfeck, #dolphin, pberestov, iasensio, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200111/10ef6c59/attachment.htm>


More information about the kfm-devel mailing list