homescreen: Use generic app name when X-KDE-PlasmaMobile-UseGenericName is set in a .desktop file

This commit adds support for using the generic app name when the "X-KDE-PlasmaMobile-UseGenericName" .desktop key is set.

This allows us to have applications that we consider "system apps" to have a generic name, without needing to change the "Name" tag itself when used in other desktop environments (ex. Plasma Desktop).
This commit is contained in:
Devin Lin 2025-06-17 14:04:25 -04:00
parent 4cd1dfaf04
commit 47a886988f
2 changed files with 8 additions and 0 deletions

View file

@ -16,6 +16,10 @@ FolioApplication::FolioApplication(HomeScreen *parent, KService::Ptr service)
, m_icon{service->icon()}
, m_storageId{service->storageId()}
{
if (service->property<bool>(QStringLiteral("X-KDE-PlasmaMobile-UseGenericName"))) {
m_name = service->genericName();
}
auto windows = WindowListener::instance()->windowsFromStorageId(m_storageId);
if (windows.empty()) {
m_window = nullptr;

View file

@ -15,6 +15,10 @@ Application::Application(QObject *parent, KService::Ptr service)
, m_icon{service->icon()}
, m_storageId{service->storageId()}
{
if (service->property<bool>(QStringLiteral("X-KDE-PlasmaMobile-UseGenericName"))) {
m_name = service->genericName();
}
auto windows = WindowListener::instance()->windowsFromStorageId(m_storageId);
if (windows.empty()) {
m_window = nullptr;