From 89ab55b44b0fe0bbc5dfc6e93fde664ed74d8285 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 25 Jul 2021 21:51:35 +0200 Subject: [PATCH] LibDesktop: Add an optional "Description" field to .af files --- Userland/Libraries/LibDesktop/AppFile.cpp | 5 +++++ Userland/Libraries/LibDesktop/AppFile.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibDesktop/AppFile.cpp b/Userland/Libraries/LibDesktop/AppFile.cpp index f97030b78d..17fb52b2ac 100644 --- a/Userland/Libraries/LibDesktop/AppFile.cpp +++ b/Userland/Libraries/LibDesktop/AppFile.cpp @@ -77,6 +77,11 @@ String AppFile::executable() const return executable; } +String AppFile::description() const +{ + return m_config->read_entry("App", "Description").trim_whitespace(); +} + String AppFile::category() const { return m_config->read_entry("App", "Category").trim_whitespace(); diff --git a/Userland/Libraries/LibDesktop/AppFile.h b/Userland/Libraries/LibDesktop/AppFile.h index 1952c0e690..ffcbc5fde9 100644 --- a/Userland/Libraries/LibDesktop/AppFile.h +++ b/Userland/Libraries/LibDesktop/AppFile.h @@ -26,6 +26,7 @@ public: String name() const; String executable() const; String category() const; + String description() const; bool run_in_terminal() const; Vector launcher_file_types() const; Vector launcher_protocols() const;