diff options
author | Denis Kozadaev <[email protected]> | 2023-05-18 21:41:25 +0300 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-05-23 10:14:51 +0900 |
commit | d984205f2e2e53941bce2efb99252feb6a4c046e (patch) | |
tree | 71092a76f19990d9072233a2c02e687ee518da64 /kpersonalizer | |
parent | f3f71a018f383fe1cdf2d7e402c95325ba81c6a3 (diff) | |
download | tdebase-d984205f2e2e53941bce2efb99252feb6a4c046e.tar.gz tdebase-d984205f2e2e53941bce2efb99252feb6a4c046e.zip |
SunOS specific patches
Signed-off-by: Denis Kozadaev <[email protected]>
(cherry picked from commit 4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685)
Diffstat (limited to 'kpersonalizer')
-rw-r--r-- | kpersonalizer/CMakeLists.txt | 2 | ||||
-rw-r--r-- | kpersonalizer/ksysinfo.cpp | 30 |
2 files changed, 30 insertions, 2 deletions
diff --git a/kpersonalizer/CMakeLists.txt b/kpersonalizer/CMakeLists.txt index 19c3a6698..6fe020c82 100644 --- a/kpersonalizer/CMakeLists.txt +++ b/kpersonalizer/CMakeLists.txt @@ -40,6 +40,6 @@ tde_add_executable( kpersonalizer AUTOMOC kpersonalizer.cpp main.cpp kfindlanguage.cpp kcountrypagedlg.ui kospagedlg.ui keyecandypagedlg.ui tdestylepagedlg.ui krefinepagedlg.ui ksysinfo.cpp - LINK tdeio-shared + LINK tdeio-shared ${KSTAT_LIBRARIES} DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/kpersonalizer/ksysinfo.cpp b/kpersonalizer/ksysinfo.cpp index 20a089b8f..551dad3f8 100644 --- a/kpersonalizer/ksysinfo.cpp +++ b/kpersonalizer/ksysinfo.cpp @@ -235,8 +235,36 @@ TQFont KSysInfo::getFixedWidthFont(){ /////////////////// /////////////////// -//#elif defined(__svr4__) && defined(sun) +#elif defined(Q_OS_SOLARIS) /////////////////// +#include <kstat.h> + + void KSysInfo::initHWInfo() { + kstat_ctl_t *kctl; + kstat_t *ksp; + kstat_named_t *kdata; + + m_cpu_speed = 0; + /* cpu_info:0:cpu_info0:current_clock_Hz */ + + kctl = kstat_open(); + if (kctl == NULL) + return; + if (kstat_chain_update(kctl) != 0) + goto out; + ksp = kstat_lookup(kctl, "cpu_info", 0, "cpu_info0"); + if (ksp == NULL) + goto out; + if (kstat_read(kctl, ksp, NULL) == -1 ) + goto out; + + kdata = (kstat_named_t *)kstat_data_lookup(ksp, + "clock_Hz"); + if (kdata != NULL) + m_cpu_speed = kdata->value.ui64; + out: + kstat_close(kctl); + } /////////////////// //#elif __svr4__ |