From 5a16f0ee53fc57970bc74567c993159cd0ea75f9 Mon Sep 17 00:00:00 2001 From: kate Date: Wed, 26 Jan 2022 01:06:06 +0800 Subject: [PATCH] fix(openWith): locale name --- mimetype/xdgdesktopfile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mimetype/xdgdesktopfile.cpp b/mimetype/xdgdesktopfile.cpp index 104928a..75c743e 100644 --- a/mimetype/xdgdesktopfile.cpp +++ b/mimetype/xdgdesktopfile.cpp @@ -21,6 +21,7 @@ #include #include #include +#include XdgDesktopFile::XdgDesktopFile(const QString &fileName) : m_isValid(false) @@ -111,11 +112,10 @@ QString XdgDesktopFile::localeName() const { QString localeKey = QString("Name[%1]").arg(QLocale::system().name()); - if (m_items.contains(localeKey)) { - return XdgDesktopFile::value("Name").toString(); - } + if (XdgDesktopFile::value(localeKey).toString().isEmpty()) + return XdgDesktopFile::value("Name").toString();; - return XdgDesktopFile::value("Name").toString(); + return XdgDesktopFile::value(localeKey).toString(); } QString XdgDesktopFile::prefix() const