fix(openWith): locale name

This commit is contained in:
kate 2022-01-26 01:06:06 +08:00
parent 5c450d527a
commit 5a16f0ee53

View file

@ -21,6 +21,7 @@
#include <QTextStream> #include <QTextStream>
#include <QFile> #include <QFile>
#include <QLocale> #include <QLocale>
#include <QDebug>
XdgDesktopFile::XdgDesktopFile(const QString &fileName) XdgDesktopFile::XdgDesktopFile(const QString &fileName)
: m_isValid(false) : m_isValid(false)
@ -111,11 +112,10 @@ QString XdgDesktopFile::localeName() const
{ {
QString localeKey = QString("Name[%1]").arg(QLocale::system().name()); QString localeKey = QString("Name[%1]").arg(QLocale::system().name());
if (m_items.contains(localeKey)) { if (XdgDesktopFile::value(localeKey).toString().isEmpty())
return XdgDesktopFile::value("Name").toString(); return XdgDesktopFile::value("Name").toString();;
}
return XdgDesktopFile::value("Name").toString(); return XdgDesktopFile::value(localeKey).toString();
} }
QString XdgDesktopFile::prefix() const QString XdgDesktopFile::prefix() const