Bug 379526 - Inconsistent separator use in mime setup
Summary: Inconsistent separator use in mime setup
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Views (show other bugs)
Version: 5.6.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-04 22:21 UTC by Simon
Modified: 2017-08-10 10:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.6.0


Attachments
Separate extesions on both spaces and semicolons in mime setup (3.78 KB, patch)
2017-05-04 22:21 UTC, Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2017-05-04 22:21:57 UTC
Created attachment 105353 [details]
Separate extesions on both spaces and semicolons in mime setup

The test in the GUI for the mime setup says, that one should use spaces to separate extensions. The actual parsing function accepts either semicolons or spaces (but not both). When the input fields are populated from database, the extensions are separated by semicolons.

This can lead to the following problem:
1. Existing extensions: "ex1;ex2"
2. Add new extension separated by space as told: "ex1;ex2 ex3"

Result:
This is parsed to the extensions "ex1" and "ex2 ex3".

Expected:
Recognise  "ex1", "ex2" and "ex3" separately.

Patch:
Separate string from user on both spaces and semicolons. Adjust the text in the GUI to that.
Comment 1 caulier.gilles 2017-05-06 05:56:26 UTC
Hi Simon, 

There is extension of file with space separator ?

I never seen something as "foo.jpg tar.gz". This will not work in source code which handle files.

I understand well your description ? In my example "jpg tar.gz" is the expected extension. This is exactly what you want to manage with your patch ?

The scheme for multiple extension is to use dot separator. exemple : jpg.tar.gz. This one is well supported by Qt de facto.

Gilles

Gilles
Comment 2 Simon 2017-05-06 06:43:03 UTC
Hi Gilles,

There was a misunderstanding. This is not about "composed" extensions like ".jpg.tar.gz" at all.
This is about a present bug in the mime setup. When you enter "ex1;ex2 ex3" the internal result is a list containing "ex1" and "ex2 ex3" while it should be "ex1", "ex2" and "ex3".
Comment 3 caulier.gilles 2017-05-06 06:55:46 UTC
Ah right, it's clear now. 

Patch is fine well (:=)))...

Gilles
Comment 4 Simon 2017-05-06 08:02:11 UTC
Git commit 8a8aeacc954671fe2c52f5e3672b4566a638d781 by Simon Frei.
Committed on 06/05/2017 at 08:01.
Pushed by sfrei into branch 'master'.

Handle both semicolon and spaces in mime setup and use colored mime icons
FIXED-IN: 5.6.0

M  +2    -2    NEWS
M  +14   -5    libs/database/coredb/coredb.cpp
M  +7    -6    utilities/setup/album/setupmime.cpp

https://commits.kde.org/digikam/8a8aeacc954671fe2c52f5e3672b4566a638d781