summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorscito <info@scito.ch>2021-12-30 13:25:38 +0100
committerEike Rathke <erack@redhat.com>2022-01-01 16:52:20 +0100
commit4d0d4fb11f7251e0437ec8e6fe7b7693f3a31800 (patch)
tree71388fbfd306611d5b6f09f42ecb783fe13d8c15 /vcl/source/app
parent6b85c0adf8050c1eba89f2115dc5151a7507369f (diff)
tdf#140286 fix INFO("OSVERSION") for Linux: return kernel version
If LibreOffice Calc is running on Linux, the Linux version as shown in about dialog is returned, e.g. "Linux 5.3". MacOS and Windows parts are prepared, but not implemented. (I develop only on Linux.) Change-Id: I2b266a257e5c01c0fde7d076385ded4a6413d3c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127756 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/svapp.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 66c030dd5501..f5e84b94bbd1 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1152,9 +1152,19 @@ static OUString Localize(TranslateId aId, const bool bLocalize)
return Translate::get(aId, Translate::Create("vcl", LanguageTag("en-US")));
}
-OUString Application::GetHWOSConfInfo(const int bSelection, const bool bLocalize)
+OUString Application::GetOSVersion()
{
ImplSVData* pSVData = ImplGetSVData();
+ OUString aVersion;
+ if (pSVData && pSVData->mpDefInst)
+ aVersion = pSVData->mpDefInst->getOSVersion();
+ else
+ aVersion = "-";
+ return aVersion;
+}
+
+OUString Application::GetHWOSConfInfo(const int bSelection, const bool bLocalize)
+{
OUStringBuffer aDetails;
const auto appendDetails = [&aDetails](std::u16string_view sep, auto&& val) {
@@ -1167,11 +1177,7 @@ OUString Application::GetHWOSConfInfo(const int bSelection, const bool bLocalize
appendDetails(u"; ", Localize(SV_APP_CPUTHREADS, bLocalize)
+ OUString::number(std::thread::hardware_concurrency()));
- OUString aVersion;
- if ( pSVData && pSVData->mpDefInst )
- aVersion = pSVData->mpDefInst->getOSVersion();
- else
- aVersion = "-";
+ OUString aVersion = GetOSVersion();
appendDetails(u"; ", Localize(SV_APP_OSVERSION, bLocalize) + aVersion);
}