Bug 358658 - .desktop files of agents are read in the incorrect encoding
Summary: .desktop files of agents are read in the incorrect encoding
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: server (show other bugs)
Version: GIT (master)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-27 23:02 UTC by Alexey Chernov
Modified: 2016-02-29 11:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Sample screenshot of the issue. (23.32 KB, image/png)
2016-01-27 23:02 UTC, Alexey Chernov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Chernov 2016-01-27 23:02:10 UTC
It turned out that .desktop files which hold settings of Akonadi agents are read in the incorrect encoding which leads to broken strings in applications (e.g. KMail or Akonadiconsole) when using localized version of KDE (see the screenshots).

There's a fix for that, so the review request link is about to be applied.

Reproducible: Always

Steps to Reproduce:
1. Set some non-English locale in System settings.
2. Start e.g. Akonadiconsole.
3. Notice type string of agent summary.
4. Click "Add" button and notice descriptions of agents are with broken symbols.
Comment 1 Alexey Chernov 2016-01-27 23:02:57 UTC
Created attachment 96876 [details]
Sample screenshot of the issue.
Comment 2 Alexey Chernov 2016-01-27 23:12:07 UTC
Here's a review request link: https://git.reviewboard.kde.org/r/126911/
Comment 3 Alexey Chernov 2016-01-28 13:37:13 UTC
Git commit 1e164ae8d50b38c361595390543ebdeb45231777 by Alexey Chernov.
Committed on 28/01/2016 at 11:52.
Pushed by chernov into branch 'master'.

Fix encoding of reading *.desktop files of Akonadi agents

Explicitly set UTF-8 encoding of QSettings when reading *.desktop
files of agents to prevent any encoding issues. Code parts of string
conversion are also removed as now it's done in QSettings internally.
REVIEW: 126911

M  +3    -8    src/akonadicontrol/agenttype.cpp

http://commits.kde.org/akonadi/1e164ae8d50b38c361595390543ebdeb45231777
Comment 4 Alexey Chernov 2016-01-28 13:38:36 UTC
Git commit de588dc7fd459449ccc1d29fb30cee1774837140 by Alexey Chernov.
Committed on 28/01/2016 at 12:00.
Pushed by chernov into branch 'Applications/15.12'.

Fix encoding of reading *.desktop files of Akonadi agents

Explicitly set UTF-8 encoding of QSettings when reading *.desktop
files of agents to prevent any encoding issues. Code parts of string
conversion are also removed as now it's done in QSettings internally.
REVIEW: 126911

M  +3    -8    src/akonadicontrol/agenttype.cpp

http://commits.kde.org/akonadi/de588dc7fd459449ccc1d29fb30cee1774837140
Comment 5 Elvis Angelaccio 2016-02-29 11:00:52 UTC
Git commit 393a20b6f9e154069da09c2a2f929f1a4e886d3d by Elvis Angelaccio.
Committed on 29/02/2016 at 10:51.
Pushed by elvisangelaccio into branch 'master'.

Parse .desktop files using KDesktopFile

This replaces the parsing done by QSettings. Since KConfig supports localized
entries out of the box, there is no need anymore for custom code like the overloads
with a language string as argument.
Related: bug 330010

Differential Revision: D994

M  +1    -0    autotests/akonadicontrol/CMakeLists.txt
M  +8    -14   autotests/akonadicontrol/agenttypetest.cpp
M  +2    -5    autotests/akonadicontrol/data/googlecontactsresource.desktop
M  +1    -0    src/akonadicontrol/CMakeLists.txt
M  +6    -9    src/akonadicontrol/agentmanager.cpp
M  +5    -7    src/akonadicontrol/agentmanager.h
M  +21   -46   src/akonadicontrol/agenttype.cpp
M  +2    -2    src/akonadicontrol/agenttype.h
M  +2    -8    src/core/agentmanager.cpp
M  +0    -15   src/interfaces/org.freedesktop.Akonadi.AgentManager.xml

http://commits.kde.org/akonadi/393a20b6f9e154069da09c2a2f929f1a4e886d3d