From ea60274a43eb6586d5f8283be90b465a7c4ce775 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 3 Oct 2011 16:33:53 +0200 Subject: Fix UAs description This patch from Andrea Di Menna fixes UA description visualization in the UI. I changed it in two lines: fixed an empty string call using QL1S and removed i18n as we are in string freeze. Will need proper string translation after 0.8 stable release. REVIEW:102712 --- src/useragent/useragentinfo.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/useragent/useragentinfo.cpp b/src/useragent/useragentinfo.cpp index 82871108..d7defd59 100644 --- a/src/useragent/useragentinfo.cpp +++ b/src/useragent/useragentinfo.cpp @@ -41,6 +41,8 @@ #include +// Qt includes +#include UserAgentInfo::UserAgentInfo() { @@ -128,10 +130,17 @@ QString UserAgentInfo::userAgentDescription(int i) return QL1S("Default"); } - QString tmp = m_providers.at(i)->property("Name").toString(); - tmp.remove(QL1S("UADescription (")); - tmp.remove(QL1C(')')); - return tmp; + QString systemName = m_providers.at(i)->property("X-KDE-UA-SYSNAME").toString(); + QString systemRelease = m_providers.at(i)->property("X-KDE-UA-SYSRELEASE").toString(); + QString systemSummary = QL1S(""); + + if (!systemName.isEmpty() && !systemRelease.isEmpty()) + { + // FIXME: needs a proper translation after stable release + systemSummary = " " % QL1S("on") % " " % systemName % " " % systemRelease; + } + + return userAgentName(i) % " " % userAgentVersion(i) % systemSummary; } -- cgit v1.2.1