From ed02d9121529beb50a709d50f01bba6b8f578795 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sat, 13 Apr 2019 09:27:45 +0200 Subject: Show 32/64-bit Version intead of release for Arch Linux in System tab Arch Linux is a rolling release distribution. Test: - Backup /etc/os-release file - Replace the content of /etc/os-release file - Launch mate-system-monitor - Select System tab - Close mate-system-monitor - Restore /etc/os-release file $ cat ~/os-release NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="0;36" HOME_URL="https://www.archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://bugs.archlinux.org/" --- src/sysinfo.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp index 91cfee8..5c40a2e 100644 --- a/src/sysinfo.cpp +++ b/src/sysinfo.cpp @@ -72,16 +72,26 @@ namespace { ("" + this->distro_name + "").c_str(), NULL); - - /* Translators: The first string parameter is release version (codename), - * the second one is the architecture, 32 or 64-bit */ + char* markup; #ifdef __linux__ - char* markup = g_strdup_printf(_("Release %s %s"), - this->distro_release.c_str(), - this->get_os_type().c_str()); + if (this->distro_release != "") + { + /* Translators: The first string parameter is release version (codename), + * the second one is the architecture, 32 or 64-bit */ + markup = g_strdup_printf(_("Release %s %s"), + this->distro_release.c_str(), + this->get_os_type().c_str()); + } + else + { + /* Translators: The string parameter is the architecture, 32 or 64-bit */ + markup = g_strdup_printf(_("%s Version"), + this->get_os_type().c_str()); + } #else - char* markup = g_strdup_printf(_("Release %s"), - this->distro_release.c_str()); + /* Translators: The string parameter is release version (codename) */ + markup = g_strdup_printf(_("Release %s"), + this->distro_release.c_str()); #endif g_object_set(G_OBJECT(release), -- cgit v1.2.1