summaryrefslogtreecommitdiffstats
path: root/kcontrol/info
diff options
context:
space:
mode:
Diffstat (limited to 'kcontrol/info')
-rw-r--r--kcontrol/info/CMakeLists.txt6
-rw-r--r--kcontrol/info/ConfigureChecks.cmake21
-rw-r--r--kcontrol/info/info_solaris.cpp38
-rw-r--r--kcontrol/info/main.cpp26
-rw-r--r--kcontrol/info/memory.cpp4
-rw-r--r--kcontrol/info/memory.h2
-rw-r--r--kcontrol/info/memory_fbsd.cpp5
7 files changed, 63 insertions, 39 deletions
diff --git a/kcontrol/info/CMakeLists.txt b/kcontrol/info/CMakeLists.txt
index dbedbfe4d..35064b574 100644
--- a/kcontrol/info/CMakeLists.txt
+++ b/kcontrol/info/CMakeLists.txt
@@ -39,10 +39,14 @@ tde_create_translated_desktop(
)
+##### configure checks ##########################
+
+include( ConfigureChecks.cmake )
+
##### kcm_info (module) #########################
tde_add_kpart( kcm_info AUTOMOC
SOURCES main.cpp memory.cpp ${OPENGL_SOURCES}
- LINK tdeui-shared ${GL_LIBRARIES} ${GLU_LIBRARIES}
+ LINK tdeui-shared ${GL_LIBRARIES} ${GLU_LIBRARIES} ${KSTAT_LIBRARIES} ${DEVINFO_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR}
)
diff --git a/kcontrol/info/ConfigureChecks.cmake b/kcontrol/info/ConfigureChecks.cmake
new file mode 100644
index 000000000..ec881f0f2
--- /dev/null
+++ b/kcontrol/info/ConfigureChecks.cmake
@@ -0,0 +1,21 @@
+#################################################
+#
+# (C) 2023 DilOS Team
+# denis (AT) tambov (DOT) ru
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+# devinfo
+check_library_exists( devinfo di_init "" HAVE_DEVINFO )
+if( HAVE_DEVINFO )
+ set( DEVINFO_LIBRARIES devinfo )
+else()
+ if( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
+ tde_message_fatal( "libdevinfo not found on SunOS platform!" )
+ endif()
+ set( DEVINFO_LIBRARIES "" )
+endif( )
diff --git a/kcontrol/info/info_solaris.cpp b/kcontrol/info/info_solaris.cpp
index 9f2b17e1b..f6ab922ea 100644
--- a/kcontrol/info/info_solaris.cpp
+++ b/kcontrol/info/info_solaris.cpp
@@ -45,9 +45,9 @@ bool GetInfo_CPU( TQListView *lBox ) {
char *ptr;
uint32_t i, ncpus;
unsigned long state_begin;
- QString state;
- QString mhz;
- QString inst;
+ TQString state;
+ TQString mhz;
+ TQString inst;
/*
* get a kstat handle first and update the user's kstat chain
@@ -167,8 +167,8 @@ bool GetInfo_Partitions( TQListView *lBox ) {
struct mnttab mnt;
struct statvfs statbuf;
fsblkcnt_t tmp;
- QString total;
- QString avail;
+ TQString total;
+ TQString avail;
time_t mnttime;
char *timetxt;
char *ptr;
@@ -315,7 +315,7 @@ bool GetInfo_XServer_and_Video( TQListView *lBox ) {
*/
TQListViewItem *mktree( TQListViewItem *top, const char *path ) {
- QListViewItem *parent,
+ TQListViewItem *parent,
*previous,
*result;
char *str = strdup( path ),
@@ -380,7 +380,7 @@ TQListViewItem *mktree( TQListViewItem *top, const char *path ) {
/*
* prop_type_str() -- return the property type as a string
*/
-char *prop_type_str( di_prop_t prop ) {
+const char *prop_type_str( di_prop_t prop ) {
switch( di_prop_type( prop )) {
case DI_PROP_TYPE_UNDEF_IT:
@@ -448,8 +448,8 @@ int prop_type_guess( uchar_t *data, int len ) {
*/
int dump_minor_node( di_node_t node, di_minor_t minor, void *arg ) {
- QListViewItem *item;
- QString majmin;
+ TQListViewItem *item;
+ TQString majmin;
char *type;
dev_t dev;
@@ -466,7 +466,7 @@ int dump_minor_node( di_node_t node, di_minor_t minor, void *arg ) {
(type == NULL) ? "NULL" : type );
if( (dev = di_minor_devt( minor )) != DDI_DEV_T_NONE ) {
- majmin.sprintf( "%ld/%ld", major( dev ), minor( dev ));
+ majmin.sprintf( "%u/%u", major( dev ), minor( dev ));
new TQListViewItem( item, i18n( "Major/Minor:" ), majmin );
}
@@ -486,7 +486,7 @@ TQString propvalue( di_prop_t prop ) {
char *strp;
int *intp;
uchar_t *bytep;
- QString result;
+ TQString result;
/*
* Since a lot of printable strings seem to be tagged as 'byte',
@@ -562,14 +562,14 @@ TQString propvalue( di_prop_t prop ) {
*/
int dump_node( di_node_t node, void *arg ) {
- QListViewItem *top = (TQListViewItem *) arg,
+ TQListViewItem *top = (TQListViewItem *) arg,
*parent,
*previous;
- char *path;
- char *drivername;
- char *names;
- QString compatnames;
- int i, n;
+ char *path;
+ char *drivername;
+ char *names;
+ TQString compatnames;
+ int i, n;
di_prop_t prop;
path = di_devfs_path( node );
@@ -641,7 +641,7 @@ int dump_node( di_node_t node, void *arg ) {
/*
* property type & value
*/
- QListViewItem *tmp,
+ TQListViewItem *tmp,
*prev;
tmp = new TQListViewItem( previous, di_prop_name( prop ));
tmp->setExpandable( true );
@@ -668,7 +668,7 @@ int dump_node( di_node_t node, void *arg ) {
bool GetInfo_Devices( TQListView *lBox ) {
- QListViewItem *top;
+ TQListViewItem *top;
di_node_t root_node;
/*
diff --git a/kcontrol/info/main.cpp b/kcontrol/info/main.cpp
index 780b6532e..85ef53687 100644
--- a/kcontrol/info/main.cpp
+++ b/kcontrol/info/main.cpp
@@ -34,7 +34,7 @@
extern "C"
{
- KDE_EXPORT TDECModule *create_cpu(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_cpu(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_CPU_AVAILABLE
return new KInfoListWidget(i18n("Processor(s)"), parent, "kcminfo", GetInfo_CPU);
@@ -43,7 +43,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_irq(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_irq(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_IRQ_AVAILABLE
return new KInfoListWidget(i18n("Interrupt"), parent, "kcminfo", GetInfo_IRQ);
@@ -52,7 +52,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_pci(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_pci(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_PCI_AVAILABLE
return new KInfoListWidget(i18n("PCI"), parent, "kcminfo", GetInfo_PCI);
@@ -61,7 +61,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_dma(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_dma(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_DMA_AVAILABLE
return new KInfoListWidget(i18n("DMA-Channel"), parent, "kcminfo", GetInfo_DMA);
@@ -70,7 +70,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_ioports(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_ioports(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_IOPORTS_AVAILABLE
return new KInfoListWidget(i18n("I/O-Port"), parent, "kcminfo", GetInfo_IO_Ports);
@@ -79,7 +79,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_sound(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_sound(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_SOUND_AVAILABLE
return new KInfoListWidget(i18n("Soundcard"), parent, "kcminfo", GetInfo_Sound);
@@ -88,7 +88,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_scsi(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_scsi(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_SCSI_AVAILABLE
return new KInfoListWidget(i18n("SCSI"), parent, "kcminfo", GetInfo_SCSI);
@@ -97,7 +97,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_devices(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_devices(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_DEVICES_AVAILABLE
return new KInfoListWidget(i18n("Devices"), parent, "kcminfo", GetInfo_Devices);
@@ -106,7 +106,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_partitions(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_partitions(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_PARTITIONS_AVAILABLE
return new KInfoListWidget(i18n("Partitions"), parent, "kcminfo", GetInfo_Partitions);
@@ -115,7 +115,7 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_xserver(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_xserver(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_XSERVER_AVAILABLE
return new KInfoListWidget(i18n("X-Server"), parent, "kcminfo", GetInfo_XServer_and_Video);
@@ -124,12 +124,12 @@ extern "C"
#endif
}
- KDE_EXPORT TDECModule *create_memory(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_memory(TQWidget *parent, const char * /*name*/)
{
return new KMemoryWidget(parent, "kcminfo");
}
- KDE_EXPORT TDECModule *create_opengl(TQWidget *parent, const char * )
+ TDE_EXPORT TDECModule *create_opengl(TQWidget *parent, const char * )
{
#ifdef INFO_OPENGL_AVAILABLE
return new KInfoListWidget(i18n("OpenGL"), parent, "kcminfo", GetInfo_OpenGL);
@@ -139,7 +139,7 @@ extern "C"
}
/* create_cdinfo function for CD-ROM Info ~Jahshan */
- KDE_EXPORT TDECModule *create_cdinfo(TQWidget *parent, const char * /*name*/)
+ TDE_EXPORT TDECModule *create_cdinfo(TQWidget *parent, const char * /*name*/)
{
#ifdef INFO_CD_ROM_AVAILABLE
return new KInfoListWidget(i18n("CD-ROM Info"), parent, "kcminfo", GetInfo_CD_ROM);
diff --git a/kcontrol/info/memory.cpp b/kcontrol/info/memory.cpp
index 76d68d675..93da5ea20 100644
--- a/kcontrol/info/memory.cpp
+++ b/kcontrol/info/memory.cpp
@@ -252,8 +252,8 @@ KMemoryWidget::KMemoryWidget(TQWidget * parent, const char *name)
timer = new TQTimer(this);
timer->start(100);
- TQObject::connect(timer, TQT_SIGNAL(timeout()), this,
- TQT_SLOT(update_Values()));
+ TQObject::connect(timer, TQ_SIGNAL(timeout()), this,
+ TQ_SLOT(update_Values()));
update();
}
diff --git a/kcontrol/info/memory.h b/kcontrol/info/memory.h
index 6fd2cd093..7e6285dee 100644
--- a/kcontrol/info/memory.h
+++ b/kcontrol/info/memory.h
@@ -28,7 +28,7 @@ typedef unsigned long t_memsize;
#define COLOR_FREE_MEMORY TQColor(127,255,212)
class KMemoryWidget:public TDECModule {
- Q_OBJECT
+ TQ_OBJECT
public:
KMemoryWidget(TQWidget * parent, const char *name = 0);
diff --git a/kcontrol/info/memory_fbsd.cpp b/kcontrol/info/memory_fbsd.cpp
index 80a28749e..f307563f3 100644
--- a/kcontrol/info/memory_fbsd.cpp
+++ b/kcontrol/info/memory_fbsd.cpp
@@ -11,9 +11,9 @@
void KMemoryWidget::update()
{
- char blah[10], buf[80], *used_str, *total_str;
+ char buf[80], *used_str, *total_str;
/* Stuff for sysctl */
- int memory;
+ unsigned long memory;
size_t len;
/* Stuff for swap display */
int used, total, _free;
@@ -22,7 +22,6 @@ void KMemoryWidget::update()
len=sizeof(memory);
sysctlbyname("hw.physmem", &memory, &len, NULL, 0);
- snprintf(blah, 10, "%d", memory);
// Numerical values
// total physical memory (without swap space)