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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1298346

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

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to