add wxGetLinuxDistributionInfo() and wxPlatformInfo::GetLinuxDistribution() functions; also add to wxPlatformInfo the GetOperatingSystemDescription(), GetDesktopEnvironment(), GetOperatingSystemDirectory() functions to group in the same class (wxPlatformInfo) all available platform-detection functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -873,6 +873,25 @@ bool wxIsPlatform64Bit()
|
||||
machine.Contains(wxT("alpha"));
|
||||
}
|
||||
|
||||
#ifdef __LINUX__
|
||||
wxLinuxDistributionInfo wxGetLinuxDistributionInfo()
|
||||
{
|
||||
const wxString id = wxGetCommandOutput(wxT("lsb_release --id"));
|
||||
const wxString desc = wxGetCommandOutput(wxT("lsb_release --description"));
|
||||
const wxString rel = wxGetCommandOutput(wxT("lsb_release --release"));
|
||||
const wxString codename = wxGetCommandOutput(wxT("lsb_release --codename"));
|
||||
|
||||
wxLinuxDistributionInfo ret;
|
||||
|
||||
id.StartsWith("Distributor ID:\t", &ret.Id);
|
||||
desc.StartsWith("Description:\t", &ret.Description);
|
||||
rel.StartsWith("Release:\t", &ret.Release);
|
||||
codename.StartsWith("Codename:\t", &ret.CodeName);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
// these functions are in src/osx/utilsexc_base.cpp for wxMac
|
||||
#ifndef __WXMAC__
|
||||
|
||||
|
Reference in New Issue
Block a user