summaryrefslogtreecommitdiffstats
path: root/kpersonalizer
diff options
context:
space:
mode:
authorDenis Kozadaev <denis@dilos.org>2023-05-18 21:41:25 +0300
committerSlávek Banko <slavek.banko@axis.cz>2023-05-22 20:07:54 +0200
commit4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685 (patch)
tree564b7622f7025d976f0a0ac1cd9ed82ea14239dd /kpersonalizer
parentbd5494bc81ed0034cde41a34e6a6e8b813b7814b (diff)
downloadtdebase-4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685.tar.gz
tdebase-4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685.zip
SunOS specific patches
Signed-off-by: Denis Kozadaev <denis@dilos.org>
Diffstat (limited to 'kpersonalizer')
-rw-r--r--kpersonalizer/CMakeLists.txt2
-rw-r--r--kpersonalizer/ksysinfo.cpp30
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__