Commit 43cd7a26 authored by Harald Sitter's avatar Harald Sitter 🏳🌈
Browse files

remove all platform conditionals not pertaining to linux or *bsd

Summary:
we do not support plasma on anything else, nor do we CI on other platforms,
so all these conditionals were unnecessary complexity and code nobody needs

Test Plan: still builds on linux

Reviewers: broulik, nicolasfella

Reviewed By: nicolasfella

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27030
parent 7f3185e9
......@@ -65,18 +65,14 @@ set_package_properties(KF5Wayland PROPERTIES
)
add_feature_info("KF5Wayland" KF5Wayland_FOUND "Required for Wayland Compositor Information Module")
if(NOT APPLE)
find_package(X11)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
URL "https://www.x.org"
TYPE OPTIONAL
PURPOSE "Required for building the X11 based workspace"
)
if(X11_FOUND)
set(HAVE_X11 TRUE)
endif()
else()
set(X11_FOUND False)
find_package(X11)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
URL "https://www.x.org"
TYPE OPTIONAL
PURPOSE "Required for building the X11 based workspace"
)
if(X11_FOUND)
set(HAVE_X11 TRUE)
endif()
ecm_find_qmlmodule(org.kde.kirigami 2.5)
......
......@@ -5,7 +5,6 @@ add_subdirectory( memory )
add_subdirectory( devinfo )
add_subdirectory( info )
if(NOT WIN32)
add_subdirectory( samba )
add_subdirectory( nics )
......@@ -29,13 +28,11 @@ if(${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL "GLESv2")
add_feature_info("OpenGL/ES support" KCM_ENABLE_OPENGLES "View OpenGL ES2.0 details in kinfocenter." )
endif()
if(NOT APPLE)
if(KCM_ENABLE_OPENGL OR KCM_ENABLE_OPENGLES)
add_subdirectory( opengl )
else()
message(STATUS "OpenGL/ES2.0 information module has been disabled.")
endif()
endif()
if(KCM_ENABLE_OPENGL OR KCM_ENABLE_OPENGLES)
add_subdirectory( opengl )
else()
message(STATUS "OpenGL/ES2.0 information module has been disabled.")
endif()
find_package(PCIUTILS MODULE)
set_package_properties(PCIUTILS PROPERTIES DESCRIPTION "PciUtils is a library for direct access to PCI slots"
......@@ -47,9 +44,7 @@ set_package_properties(PCIUTILS PROPERTIES DESCRIPTION "PciUtils is a library fo
# PCI module doesn't work on Linux arm64, nor on MacOS, but does on
# FreeBSD arm64, so this is a bit of a tangle of what-is-supported.
set(_want_pci ON)
if(APPLE)
set(_want_pci OFF)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
if (${CMAKE_SYSTEM} MATCHES "FreeBSD")
message(STATUS "FreeBSD arm64 pci support enabled.")
else()
......@@ -60,7 +55,6 @@ endif()
if(_want_pci)
add_subdirectory( pci )
endif()
endif()
find_package(RAW1394 MODULE)
set_package_properties(RAW1394 PROPERTIES DESCRIPTION "library for direct access to IEEE 1394 bus"
......
# TODO: HAVE_LIBDEVINFO_H (for Solaris 7 and later)
# to be set if both -ldevinfo and libdevinfo.h exist
include(CheckIncludeFiles)
check_include_files(devinfo.h HAVE_DEVINFO_H) # info_fbsd.cpp
......
/*
Copyright 2010 Reza Arbab <arbab@austin.ibm.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cf.h>
#define class _class
#include <odmi.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>
#undef class
#include <nl_types.h>
#include <string.h>
#include <QDebug>
#include <stdlib.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <sys/utsname.h>
char * device_description(struct CuDv *cudv) {
char *desc= NULL;
struct PdDv *pddv = cudv->PdDvLn; /* link to Predefined Devices database */
nl_catd cat;
cat = catopen("/usr/lib/methods/devices.cat", NL_CAT_LOCALE);
if ((int)cat == -1)
return NULL;
desc = strdup(catgets(cat, pddv->setno, pddv->msgno, "N/A") );
catclose(cat);
return desc;
}
bool list_devices(QListView *lBox, char *criteria) {
struct CuDv *cudv; /* Customized Devices */
struct listinfo info;
int i;
char *cudv_desc;
QString cudv_status;
QListViewItem *lastitem= NULL;
lBox->addColumn(i18n("Name"));
lBox->addColumn(i18n("Status"));
lBox->addColumn(i18n("Location"));
lBox->addColumn(i18n("Description"));
if (odm_initialize() == -1) {
kError(0) << "odm_initialize() failed: odmerrno = " << odmerrno << endl;
return (false);
}
cudv = (struct CuDv *) odm_get_list(CuDv_CLASS, criteria, &info, 100, 2);
if ((int)cudv == -1) {
odm_terminate();
kError(0) << "odm_get_list() failed: odmerrno = " << odmerrno << endl;
return (false);
} else if (!cudv) /* empty list */
{
odm_terminate();
return (true);
}
for (i=0; i<info.num; i++) {
switch (cudv[i].status) {
case DEFINED:
cudv_status = QString("Defined");
break;
case AVAILABLE:
cudv_status = QString("Available");
break;
case STOPPED:
cudv_status = QString("Stopped");
break;
default:
cudv_status = QString("Unknown");
}
cudv_desc = device_description(&cudv[i]);
lastitem = new QListViewItem(lBox, lastitem,
QString(cudv[i].name),
cudv_status,
QString(cudv[i].location),
QString(cudv_desc ? cudv_desc : "N/A") );
if (cudv_desc)
free(cudv_desc);
}
if (odm_free_list(cudv, &info) == -1) {
odm_terminate();
kError(0) << "odm_free_list() failed: odmerrno = " << odmerrno << endl;
return (false);
}
odm_terminate();
return true;
}
enum CHIP
{
P2SC, Power, Power2, Power3, Power3_II, PowerPC,
PowerPC_604e, PowerPersonal, RD64_II, RS_III, RS64, RS64_II,
RS64_III, RS64_IV, RSC, ThinkPad, unknown,
NUM_CHIPS
};
static const char chip_name[NUM_CHIPS][16] = { "P2SC", "Power", "Power2", "Power3", "Power3-II", "PowerPC", "PowerPC 604e", "PowerPersonal", "RD64-II", "RS-III", "RS64", "RS64-II", "RS64-III", "RS64-IV", "RSC", "ThinkPad", "unknown" };
struct model {
char model_ID[21];
char machine_type[21];
char processor_speed[21];
unsigned short architecture; /* enum CHIP */
};
const
struct model _models[] = { { "02", "7015-930", "25", Power }, { "10", "7013-530", "25", Power }, { "10", "7016-730", "25", Power }, { "11", "7013-540", "30", Power }, { "14", "7013-540", "30", Power }, { "18", "7013-53H", "33", Power }, { "1C", "7013-550", "41.6", Power }, { "20", "7015-930", "25",
Power }, { "2E", "7015-950", "41", Power }, { "30", "7013-520", "20", Power }, { "31", "7012-320", "20", Power }, { "34", "7013-52H", "25", Power }, { "35", "7012-32H", "25", Power }, { "37", "7012-340", "33", Power }, { "38", "7012-350", "41", Power }, { "41", "7011-20", "33", PowerPC }, {
"45", "7011-220", "33", PowerPC }, { "42", "7006-41T/41W", "80", PowerPC }, { "43", "7008-M20", "33", Power }, { "43", "7008-M2A", "33", Power }, { "46", "7011-250", "66", PowerPC }, { "47", "7011-230", "45", RSC }, { "48", "7009-C10", "80", PowerPC },
/* 4C models use a different table -- see below */
{ "4C", "70XX", "(unknown)", unknown }, { "57", "7012-390", "67", Power2 }, { "57", "7030-3BT", "67", Power2 }, { "57", "9076-SP2 Thin", "67", Power2 }, { "58", "7012-380", "59", Power2 }, { "58", "7030-3AT", "59", Power2 }, { "59", "7012-39H", "67", Power2 }, { "59", "9076-SP2 Thin w/L2", "67",
Power2 }, { "5C", "7013-560", "50", Power }, { "63", "7015-970", "50", Power }, { "63", "7015-97B", "50", Power }, { "64", "7015-980", "62.5", Power }, { "64", "7015-98B", "62.5", Power }, { "66", "7013-580", "62.5", Power }, { "67", "7013-570", "50", Power }, { "67", "7015-R10", "50",
Power }, { "70", "7013-590", "66", Power2 }, { "70", "9076-SP2 Wide", "66", Power2 }, { "71", "7013-58H", "55", Power2 }, { "72", "7013-59H", "66", Power2 }, { "72", "7015-R20", "66", Power2 }, { "72", "9076-SP2 Wide", "66", Power2 }, { "75", "7012-370", "62", Power }, { "75", "7012-375",
"62", Power }, { "75", "9076-SP1 Thin", "62", Power }, { "76", "7012-360", "50", Power }, { "76", "7012-365", "50", Power }, { "77", "7012-350", "41", Power }, { "77", "7012-355", "41", Power }, { "77", "7013-55L", "41.6", Power }, { "79", "7013-591", "77", Power2 }, { "79",
"9076-SP2 Wide", "77", Power2 }, { "80", "7015-990", "71.5", Power2 }, { "81", "7015-R24", "71.5", P2SC }, { "89", "7013-595", "135", P2SC }, { "89", "9076-SP2 Wide", "135", P2SC }, { "90", "7009-C20", "120", PowerPC }, { "91", "7006-42W/42T", "120", PowerPC }, { "94", "7012-397", "160",
P2SC }, { "94", "9076-SP2 Thin", "160", P2SC }, { "A0", "7013-J30", "75", PowerPC }, { "A1", "7013-J40", "112", PowerPC }, { "A3", "7015-R30", "(unknown)", PowerPC }, { "A4", "7015-R40", "(unknown)", PowerPC }, { "A4", "7015-R50", "(unknown)", PowerPC }, { "A4", "9076-SP2 High",
"(unknown)", PowerPC }, { "A6", "7012-G30", "(unknown)", PowerPC }, { "A7", "7012-G40", "(unknown)", PowerPC }, { "C0", "7024-E20", "(unknown)", PowerPC }, { "C0", "7024-E30", "(unknown)", PowerPC }, { "C4", "7025-F30", "(unknown)", PowerPC }, { "F0", "7007-N40", "50", ThinkPad }, { "", "",
"0", 0 } };
const
struct model _4C_models[] = { { "IBM,7017-S70", "7017-S70", "125", RS64 }, { "IBM,7017-S7A", "7017-S7A", "262", RD64_II }, { "IBM,7017-S80", "7017-S80", "450", RS_III }, { "IBM,7017-S85", "pSeries 680", "600", RS64_IV }, { "IBM,7025-F40", "7025-F40", "166/233", PowerPC_604e }, { "IBM,7025-F50",
"7025-F50", "(unknown)", PowerPC_604e }, { "IBM,7025-F80", "7025-F80", "(unknown)", RS64_III }, { "IBM,7026-H10", "7025-H10", "166/233", PowerPC_604e }, { "IBM,7026-H50", "7025-H50", "(unknown)", PowerPC_604e }, { "IBM,7026-H80", "7025-H80", "(unknown)", RS64_III }, { "IBM,7026-M80",
"7026-M80", "500", RS64_III }, { "IBM,7025-F40", "7025-F40", "166/233", PowerPC }, { "IBM,7025-F50", "7025-F50", "(unknown)", PowerPC }, { "IBM,7025-F80", "7025-F80", "450", PowerPC }, { "IBM,7026-B80", "pSeries 640", "375", Power3_II }, { "IBM,7026-H10", "7026-H10", "166/233", PowerPC }, {
"IBM,7026-H50", "7026-H50", "(unknown)", PowerPC }, { "IBM,7026-H70", "7026-H70", "340", RS64_II }, { "IBM,7026-H80", "7026-H80", "450", PowerPC }, { "IBM,7026-M80", "7026-M80", "500", PowerPC }, { "IBM,7042-140", "7043-140", "166/200/233/332", PowerPC }, { "IBM,7042-150", "7043-150",
"375", PowerPC }, { "IBM,7042-240", "7043-240", "166/233", PowerPC }, { "IBM,7043-140", "7043-140", "166/200/233/332", PowerPC }, { "IBM,7043-150", "7043-150", "375", PowerPC }, { "IBM,7043-240", "7043-240", "166/233", PowerPC }, { "IBM,7043-260", "7043-260", "200", Power3 }, { "IBM,7248",
"7248-100", "100", PowerPersonal }, { "IBM,7248", "7248-120", "120", PowerPersonal }, { "IBM,7248", "7248-132", "132", PowerPersonal }, { "IBM,9076-270", "9076-SP Silver Node", "(unknown)", PowerPC }, { "", "", "", 0 },
};
/* all GetInfo_ functions should return true, when the Information
was filled into the lBox-Widget.
returning false indicates, that information was not available.
*/
bool GetInfo_XServer_and_Video(QListView *lBox) {
return GetInfo_XServer_Generic(lBox);
}
bool GetInfo_IRQ(QListView *) {
return false;
}
bool GetInfo_DMA(QListView *) {
return false;
}
bool GetInfo_PCI(QTreeWidget* tree) {
return list_devices(tree, (char *)"PdDvLn like '*/pci/*'");
}
bool GetInfo_IO_Ports(QListView *) {
return false;
}
/* Parts taken from fsusage.c from the Midnight Commander (mc)
Copyright (C) 1991, 1992 Free Software Foundation, In
Return the number of TOSIZE-byte blocks used by
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
static long fs_adjust_blocks(long blocks, int fromsize, int tosize) {
if (tosize <= 0)
abort();
if (fromsize <= 0)
return -1;
if (fromsize == tosize) /* E.g., from 512 to 512. */
return blocks;
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
return blocks * (fromsize / tosize);
else
/* E.g., from 256 to 512. */
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
}
/* Fill in the fields of FSP with information about space usage for
the filesystem on which PATH resides.
Return 0 if successful, -1 if not. */
#define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_bsize, 512)
static int get_fs_usage(char *path, long *l_total, long *l_avail) {
struct statfs fsd; /* 4.3BSD, SunOS 4, HP-UX, AIX. */
unsigned long fsu_blocks, fsu_bfree, fsu_bavail;
*l_total = *l_avail = 0;
if (statfs(path, &fsd) < 0)
return -1;
fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
*l_avail = getuid() ? fsu_bavail/2 : fsu_bfree/2;
*l_total = fsu_blocks/2;
return 0;
}
/*
Copyright 1998 Helge Deller deller@gmx.de
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/pstat.h>
#include <sys/utsname.h>
#include <sys/statvfs.h>
#include <sys/vfs.h>
#include <fstab.h>
#include <stdlib.h>
#include <QFile>
# define INFO_PCI "" // Please, who know it ????
# define INFO_PCI_EISA "/etc/eisa/system.sci" // File !
# define INFO_IOPORTS_1 "/etc/dmesg" // as pipe !
# define INFO_IOPORTS_2 "/usr/sbin/dmesg" // as pipe !
# define INFO_DEVICES "/etc/ioscan" // as pipe !!
/* The following table is from an HP-UX 10.20 System
build out of the files
"/usr/lib/sched.models"
or
"/opt/langtools/lib/sched.models"
If you have more entries, then please add them or send them to me!
*/
// entries for PA_REVISION[]
enum V_ENTRIES
{ V_1x0,
V_1x1, V_1x1a, V_1x1b, V_1x1c, V_1x1d, V_1x1e,
V_2x0,
V_LAST};
static const char PA_REVISION[V_LAST][7] = { "1.0", "1.1", "1.1a", "1.1b", "1.1c", "1.1d", "1.1e", "2.0" };
// entries for PA_NAME[]
enum PA_ENTRIES
{ PA7000,
PA7100, PA7100LC, PA7200, PA7300,
PA8000, PA8200, PA8500,
PARISC_PA_LAST};
static const char PA_NAME[PARISC_PA_LAST][11] = { "PA7000", "PA7100", "PA7100LC", "PA7200", "PA7300", "PA8000", "PA8200", "PA8500" };
struct _type_LOOKUPTABLE {
char Name[8];
unsigned short parisc_rev; // = enum V_ENTRIES
unsigned short parisc_name; // = enum PA_ENTRIES
};
static const struct _type_LOOKUPTABLE PA_LOOKUPTABLE[] = {
/* VERSION A.00.07
(there seems to exist several different files with same version-number !)*/
{ "600", V_1x0, PA7000 }, { "635", V_1x0, PA7000 }, { "645", V_1x0, PA7000 }, { "700", V_1x1, PA7000 }, { "705", V_1x1a, PA7000 }, { "710", V_1x1a, PA7000 }, { "712", V_1x1c, PA7100LC }, { "715", V_1x1c, PA7100LC }, { "720", V_1x1a, PA7000 }, { "722", V_1x1c, PA7100LC },
{ "725", V_1x1c, PA7100LC }, { "728", V_1x1d, PA7200 }, { "730", V_1x1a, PA7000 }, { "735", V_1x1b, PA7100 },
{ "742", V_1x1b, PA7100 },
{ "743", V_1x1b, PA7100 }, // or a 1.1c,PA7100LC !!
{ "744", V_1x1e, PA7300 }, { "745", V_1x1b, PA7100 }, { "747", V_1x1b, PA7100 }, { "750", V_1x1a, PA7000 }, { "755", V_1x1b, PA7100 }, { "770", V_1x1d, PA7200 }, { "777", V_1x1d, PA7200 }, { "778", V_1x1e, PA7300 }, { "779", V_1x1e, PA7300 }, { "780", V_2x0, PA8000 },
{ "781", V_2x0, PA8000 }, { "782", V_2x0, PA8200 }, { "783", V_2x0, PA8500 }, { "785", V_2x0, PA8500 },
{ "800", V_1x0, PA7000 }, // and one with: 2.0 / PA8000
{ "801", V_1x1c, PA7100LC }, { "802", V_2x0, PA8000 }, { "803", V_1x1e, PA7300 }, { "804", V_2x0, PA8000 }, { "806", V_1x1c, PA7100LC }, { "807", V_1x1a, PA7000 }, { "808", V_1x0, PA7000 }, { "809", V_1x1d, PA7200 }, { "810", V_2x0, PA8000 }, { "811", V_1x1c, PA7100LC }, { "813", V_1x1e,
PA7300 }, { "815", V_1x0, PA7000 }, { "816", V_1x1c, PA7100LC }, { "817", V_1x1a, PA7000 }, { "819", V_1x1d, PA7200 }, { "820", V_2x0, PA8000 }, { "821", V_1x1d, PA7200 }, { "822", V_1x0, PA7000 }, { "825", V_1x0, PA7000 }, { "826", V_1x1c, PA7100LC }, { "827", V_1x1a, PA7000 }, {
"829", V_1x1d, PA7200 }, { "831", V_1x1d, PA7200 }, { "832", V_1x0, PA7000 }, { "834", V_1x0, PA7000 }, { "835", V_1x0, PA7000 }, { "837", V_1x1a, PA7000 }, { "839", V_1x1d, PA7200 }, { "840", V_1x0, PA7000 }, { "841", V_1x1d, PA7200 }, { "842", V_1x0, PA7000 }, { "845", V_1x0,
PA7000 }, { "847", V_1x1a, PA7000 }, { "849", V_1x1d, PA7200 }, { "850", V_1x0, PA7000 }, { "851", V_1x1d, PA7200 }, { "852", V_1x0, PA7000 }, { "855", V_1x0, PA7000 }, { "856", V_1x1c, PA7100LC }, { "857", V_1x1a, PA7000 }, { "859", V_1x1d, PA7200 }, { "860", V_1x0, PA7000 }, {
"861", V_2x0, PA8000 }, { "865", V_1x0, PA7000 }, { "869", V_1x1d, PA7200 }, { "870", V_1x0, PA7000 }, { "871", V_2x0, PA8000 }, { "877", V_1x1a, PA7000 }, { "879", V_2x0, PA8000 }, { "887", V_1x1b, PA7100 }, { "889", V_2x0, PA8000 }, { "890", V_1x0, PA7000 }, { "891", V_1x1b,
PA7100 }, { "892", V_1x1b, PA7100 }, { "893", V_2x0, PA8000 }, { "895", V_2x0, PA8000 }, { "896", V_2x0, PA8000 }, { "897", V_1x1b, PA7100 }, { "898", V_2x0, PA8200 }, { "899", V_2x0, PA8200 }, { "900", V_1x0, PA7000 }, { "B115", V_1x1e, PA7300 }, { "B120", V_1x1e, PA7300 }, {
"B132L", V_1x1e, PA7300 }, { "B160L", V_1x1e, PA7300 }, { "B180L", V_1x1e, PA7300 }, { "C100", V_1x1d, PA7200 }, { "C110", V_1x1d, PA7200 }, { "C115", V_1x1e, PA7300 }, { "C120", V_1x1e, PA7300 }, { "C130", V_2x0, PA8000 }, { "C140", V_2x0, PA8000 }, { "C160L", V_1x1e, PA7300 }, {
"C160", V_2x0, PA8000 }, { "C180L", V_1x1e, PA7300 }, { "C180-XP", V_2x0, PA8000 }, { "C180", V_2x0, PA8000 }, { "C200+", V_2x0, PA8200 }, { "C230+", V_2x0, PA8200 }, { "C240+", V_2x0, PA8200 }, { "CB260", V_2x0, PA8200 },
{ "D200", V_1x1d, PA7200 }, // or: 1.1c, PA7100LC
{ "D210", V_1x1d, PA7200 }, // or: 1.1c, PA7100LC
{ "D220", V_1x1e, PA7300 }, { "D230", V_1x1e, PA7300 }, { "D250", V_1x1d, PA7200 }, { "D260", V_1x1d, PA7200 }, { "D270", V_2x0, PA8000 }, { "D280", V_2x0, PA8000 }, { "D310", V_1x1c, PA7100LC }, { "D320", V_1x1e, PA7300 }, { "D330", V_1x1e, PA7300 }, { "D350", V_1x1d, PA7200 }, { "D360",
V_1x1d, PA7200 }, { "D370", V_2x0, PA8000 }, { "D380", V_2x0, PA8000 }, { "D400", V_1x1d, PA7200 }, { "D410", V_1x1d, PA7200 }, { "D650", V_2x0, PA8000 }, { "DX0", V_1x1c, PA7100LC }, { "DX5", V_1x1c, PA7100LC }, { "DXO", V_1x1c, PA7100LC }, { "E25", V_1x1c, PA7100LC }, { "E35",
V_1x1c, PA7100LC }, { "E45", V_1x1c, PA7100LC }, { "E55", V_1x1c, PA7100LC }, { "F10", V_1x1a, PA7000 }, { "F20", V_1x1a, PA7000 }, { "F30", V_1x1a, PA7000 }, { "G30", V_1x1a, PA7000 }, { "G40", V_1x1a, PA7000 }, { "G50", V_1x1b, PA7100 }, { "G60", V_1x1b, PA7100 }, { "G70", V_1x1b,
PA7100 }, { "H20", V_1x1a, PA7000 }, { "H30", V_1x1a, PA7000 }, { "H40", V_1x1a, PA7000 }, { "H50", V_1x1b, PA7100 }, { "H60", V_1x1b, PA7100 }, { "H70", V_1x1b, PA7100 }, { "I30", V_1x1a, PA7000 }, { "I40", V_1x1a, PA7000 }, { "I50", V_1x1b, PA7100 }, { "I60", V_1x1b, PA7100 }, {
"I70", V_1x1b, PA7100 }, { "J200", V_1x1d, PA7200 }, { "J210XC", V_1x1d, PA7200 }, { "J210", V_1x1d, PA7200 }, { "J220", V_2x0, PA8000 }, { "J2240", V_2x0, PA8200 }, { "J280", V_2x0, PA8000 }, { "J282", V_2x0, PA8000 }, { "J400", V_2x0, PA8000 }, { "J410", V_2x0, PA8000 }, { "K100",
V_1x1d, PA7200 }, { "K200", V_1x1d, PA7200 }, { "K210", V_1x1d, PA7200 }, { "K230", V_1x1d, PA7200 }, { "K250", V_2x0, PA8000 }, { "K260", V_2x0, PA8000 }, { "K370", V_2x0, PA8200 }, { "K380", V_2x0, PA8200 }, { "K400", V_1x1d, PA7200 }, { "K410", V_1x1d, PA7200 }, { "K420", V_1x1d,
PA7200 }, { "K430", V_1x1d, PA7200 }, { "K450", V_2x0, PA8000 }, { "K460", V_2x0, PA8000 }, { "K470", V_2x0, PA8200 }, { "K570", V_2x0, PA8200 }, { "K580", V_2x0, PA8200 }, { "S700i", V_1x1e, PA7300 }, { "S715", V_1x1e, PA7300 }, { "S744", V_1x1e, PA7300 },
{ "S760", V_1x1e, PA7300 }, { "T500", V_1x1c, PA7100LC }, // or: 1.1b, PA7100
{ "T520", V_1x1b, PA7100 }, { "T540", V_2x0, PA8000 }, { "T600", V_2x0, PA8000 }, { "V2000", V_2x0, PA8000 }, { "V2200", V_2x0, PA8200 }, { "V2250", V_2x0, PA8200 }, { "V2500", V_2x0, PA8500 },
{ "", 0, 0 } /* Last Entry has to be empty. */
};
/* Helper-Functions */
// Value() is defined in info.cpp !!!
static bool Find_in_LOOKUPTABLE(QListView *lBox, char *machine) {
char *Machine;
int len;
const struct _type_LOOKUPTABLE *Entry = PA_LOOKUPTABLE;
QString str;
QListViewItem* olditem = 0;
Machine = machine; // machine is like: "9000/715/D"
while ((*Machine) && (*Machine!='/'))
++Machine;
if (*Machine)
++Machine;
else
Machine=machine;
len = strlen(Machine);
while (Entry->Name[0]) {
if (strncmp(Entry->Name, Machine, len)==0) {
olditem = new QListViewItem(lBox, olditem, i18n("PA-RISC Processor"),
QString(PA_NAME[Entry->parisc_name]));
olditem = new QListViewItem(lBox, olditem, i18n("PA-RISC Revision"),
QString("PA-RISC ") + QString(PA_REVISION[Entry->parisc_rev]));
return true;
} else
++Entry; // next Entry !
}
return false;
}
/* all following functions should return true, when the Information
was filled into the lBox-Widget.
returning false indicates, that information was not available.
*/
bool GetInfo_ReadfromFile(QListView *lBox, const char *Name) {
char buf[2048];
QFile *file = new QFile(Name);
QListViewItem* olditem = 0;
if (!file->open(QIODevice::ReadOnly)) {
delete file;
return false;
}
while (file->readLine(buf, sizeof(buf)-1) >= 0) {
if (strlen(buf))
olditem = new QListViewItem(lBox, olditem, QString::fromLocal8Bit(buf));
}
file->close();
delete file;
return (lBox->childCount());
}
bool GetInfo_IRQ(QListView *) {
return false;
}
bool GetInfo_DMA(QListView *) {
return false;
}
bool GetInfo_PCI(QTreeWidget* tree) {
return (GetInfo_ReadfromFile(tree, INFO_PCI) + GetInfo_ReadfromFile(tree, INFO_PCI_EISA) );
}
bool GetInfo_IO_Ports(QListView *lBox) {
if (GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_1, false))
return true;
else
return GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_2, false);
}
/* Parts taken from fsusage.c from the Midnight Commander (mc)
Copyright (C) 1991, 1992 Free Software Foundation, In
Return the number of TOSIZE-byte blocks used by
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
static long fs_adjust_blocks(long blocks, int fromsize, int tosize) {
if (tosize <= 0)
abort();
if (fromsize <= 0)
return -1;
if (fromsize == tosize) /* E.g., from 512 to 512. */
return blocks;
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
return blocks * (fromsize / tosize);
else
/* E.g., from 256 to 512. */
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
}
/* Fill in the fields of FSP with information about space usage for
the filesystem on which PATH resides.
Return 0 if successful, -1 if not. */
#define CONVERT_BLOCKS(b) fs_adjust_blocks ((b), fsd.f_bsize, 512)
static int get_fs_usage(char *path, long *l_total, long *l_avail) {
struct statfs fsd; /* 4.3BSD, SunOS 4, HP-UX, AIX. */
unsigned long fsu_blocks, fsu_bfree, fsu_bavail;
*l_total = *l_avail = 0;
if (statfs(path, &fsd) < 0)
return -1;
fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
*l_avail = getuid() ? fsu_bavail/2 : fsu_bfree/2;
*l_total = fsu_blocks/2;
return 0;
}
bool GetInfo_XServer_and_Video(QListView *lBox) {
lBox = lBox;
return GetInfo_XServer_Generic(lBox);
}
/*
* Copyright (c) 2003 Benjamin Reed <ranger@befunk.com>
*
* info_osx.cpp is part of the KDE program kcminfo. Copied wholesale
* from info_fbsd.cpp =)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*
* all following functions should return true, when the Information
* was filled into the lBox-Widget. Returning false indicates that
* information was not available.
*/
#include <sys/types.h>