Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
meta-nemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
meta-nemo
Commits
0350c459
Commit
0350c459
authored
Nov 30, 2017
by
Florent Revest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlite: Allow dynamic locale switch in MDesktopEntry
parent
ee4e8b9f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
0001-MDesktopEntry-Allow-dynamic-locale-switch-by-disabli.patch
...DesktopEntry-Allow-dynamic-locale-switch-by-disabli.patch
+56
-0
mlite_git.bb
recipes-nemomobile/mlite/mlite_git.bb
+2
-1
No files found.
recipes-nemomobile/mlite/mlite/0001-MDesktopEntry-Allow-dynamic-locale-switch-by-disabli.patch
0 → 100644
View file @
0350c459
From 0ec6c5c9751557907a93ee755ba1e5a891352dc5 Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
Date: Thu, 30 Nov 2017 22:02:48 +0100
Subject: [PATCH] MDesktopEntry: Allow dynamic locale switch by disabling some
of the asumptions made when using glib's conf files functions
---
src/mdesktopentry.cpp | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/mdesktopentry.cpp b/src/mdesktopentry.cpp
index cca6af0..628eaab 100644
--- a/src/mdesktopentry.cpp
+++ b/src/mdesktopentry.cpp
@@ -66,7 +66,7 @@
bool GKeyFileWrapper::load(QIODevice &device)
QByteArray contents = device.readAll();
GError *err = NULL;
- if (!g_key_file_load_from_data(m_key_file, contents.constData(), contents.size(), G_KEY_FILE_NONE, &err)) {
+ if (!g_key_file_load_from_data(m_key_file, contents.constData(), contents.size(), G_KEY_FILE_KEEP_TRANSLATIONS, &err)) {
qWarning() << "Could not load .desktop file:" << QString::fromUtf8(err->message);
g_clear_error(&err);
return false;
@@ -129,9 +129,10 @@
QString GKeyFileWrapper::localizedValue(const QString §ion, const QString &k
QByteArray section_utf8 = section.toUtf8();
QByteArray key_utf8 = key.toUtf8();
+ QByteArray locale_utf8 = QLocale().bcp47Name().toUtf8();
GError *err = NULL;
- gchar *value = g_key_file_get_locale_string(m_key_file, section_utf8.constData(), key_utf8.constData(), NULL, &err);
+ gchar *value = g_key_file_get_locale_string(m_key_file, section_utf8.constData(), key_utf8.constData(), locale_utf8.constData(), &err);
if (!value) {
qWarning() << "Could not read value:" << QString::fromUtf8(err->message);
g_clear_error(&err);
@@ -408,9 +409,6 @@
QString MDesktopEntry::name() const
{
Q_D(const MDesktopEntry);
- if (!d->translatedName.isNull())
- return d->translatedName;
-
QString name;
if (contains(DesktopEntrySection, LogicalIdKey)) {
@@ -432,7 +430,6 @@
QString MDesktopEntry::name() const
name = d->keyFile.localizedValue(DesktopEntrySection, NameKey);
}
- d->translatedName = name;
return name;
}
--
2.14.3
recipes-nemomobile/mlite/mlite_git.bb
View file @
0350c459
...
...
@@ -3,7 +3,8 @@ HOMEPAGE = "https://git.merproject.org/mer-core/mlite"
LICENSE = "LGPL-2.1+"
LIC_FILES_CHKSUM = "file://src/mnotification.cpp;beginline=1;endline=18;md5=5dd5d73b0225b3099a82e6ad93283ea1"
SRC_URI = "git://git.merproject.org/mer-core/mlite.git;protocol=https"
SRC_URI = "git://git.merproject.org/mer-core/mlite.git;protocol=https \
file://0001-MDesktopEntry-Allow-dynamic-locale-switch-by-disabli.patch"
SRCREV = "144086d5f6c83abc721c8de503a83d4d1bb26fde"
PR = "r1"
PV = "+git${SRCPV}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment