The problem is in `FileNameMutex::lockFileName()` which uses
fileInfo.completeSuffix()[0] to understand where put the number, which
returns all letters that are at right of the first dot.

Now, this makes sense, because we do not want to break the file (so we
do not want to append the number) but at the same time we don't want
just to insert the number at the left of the last dot, because there are
extensions with two dots (as .tar.gz)

We should check if we know the type of the file and add the number
between the filename and the extension (Chromium does that, it creates
something like "file (1).extension", otherwise do something else (left
of the last dot?).

I think we need to investigate how other download managers take care of
this.

https://doc.qt.io/qt-5/qfileinfo.html#completeSuffix

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-download-manager in
Ubuntu.
https://bugs.launchpad.net/bugs/1298346

Title:
  Non-unique names get ($number) added before the first dot instead of
  the last one

Status in ubuntu-download-manager package in Ubuntu:
  Confirmed

Bug description:
  $ ls .local/share/ubuntu-download-manager/Downloads/
  com.ubuntu.developer.mzanetti.xbmcremote_1.4.1.0_armhf.click
  com (1).ubuntu.developer.mzanetti.xbmcremote_1.4.1.0_armhf.click
  com (2).ubuntu.developer.mzanetti.xbmcremote_1.4.1.0_armhf.click

  Feels like those should be added at the end instead.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: ubuntu-download-manager 0.3+14.04.20140321-0ubuntu1
  Uname: Linux 3.4.0-5-mako armv7l
  ApportVersion: 2.13.3-0ubuntu1
  Architecture: armhf
  Date: Thu Mar 27 12:23:09 2014
  InstallationDate: Installed on 2014-03-26 (1 days ago)
  InstallationMedia: Ubuntu Trusty Tahr (development branch) - armhf (20140326)
  SourcePackage: ubuntu-download-manager
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-download-manager/+bug/1298346/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to