Changeset View
Changeset View
Standalone View
Standalone View
x11/kde4-workspace/files/patch-kinfocenter
Clean up info_fbsd.cpp. | Clean up info_fbsd.cpp. | ||||
Use libpci for pci access if possible - on FreeBSD it requires root | Use libpci for pci access if possible - on FreeBSD it requires root | ||||
privileges (rw access to /dev/pci), therefore leave old method | privileges (rw access to /dev/pci), therefore leave old method | ||||
as a fallback. | as a fallback. | ||||
Improve GetInfo_ReadfromPipe function to use Qt types, pass program name | Improve GetInfo_ReadfromPipe function to use Qt types, pass program name | ||||
and its parameters as separate arguments. | and its parameters as separate arguments. | ||||
--- /dev/null | --- cmake/modules/FindBSDDevinfo.cmake.orig 2016-12-13 11:26:31 UTC | ||||
+++ cmake/modules/FindBSDDevinfo.cmake | +++ cmake/modules/FindBSDDevinfo.cmake | ||||
@@ -0,0 +1,15 @@ | @@ -0,0 +1,15 @@ | ||||
+# Find FreeBSD devinfo library | +# Find FreeBSD devinfo library | ||||
+# Once done this will define | +# Once done this will define | ||||
+# | +# | ||||
+# BSDDEVINFO_FOUND - system has devinfo | +# BSDDEVINFO_FOUND - system has devinfo | ||||
+# BSDDEVINFO_INCLUDE_DIR - devinfo include directory | +# BSDDEVINFO_INCLUDE_DIR - devinfo include directory | ||||
+# BSDDEVINFO_LIBRARY - devinfo library | +# BSDDEVINFO_LIBRARY - devinfo library | ||||
+ | + | ||||
+find_path(BSDDEVINFO_INCLUDE_DIR devinfo.h) | +find_path(BSDDEVINFO_INCLUDE_DIR devinfo.h) | ||||
+ | + | ||||
+find_library(BSDDEVINFO_LIBRARY NAMES devinfo) | +find_library(BSDDEVINFO_LIBRARY NAMES devinfo) | ||||
+ | + | ||||
+include(FindPackageHandleStandardArgs) | +include(FindPackageHandleStandardArgs) | ||||
+find_package_handle_standard_args(BSDDEVINFO DEFAULT_MSG BSDDEVINFO_LIBRARY BSDDEVINFO_INCLUDE_DIR) | +find_package_handle_standard_args(BSDDEVINFO DEFAULT_MSG BSDDEVINFO_LIBRARY BSDDEVINFO_INCLUDE_DIR) | ||||
+ | + | ||||
+mark_as_advanced(BSDDEVINFO_INCLUDE_DIR BSDDEVINFO_LIBRARY) | +mark_as_advanced(BSDDEVINFO_INCLUDE_DIR BSDDEVINFO_LIBRARY) | ||||
--- kinfocenter/Modules/base/CMakeLists.txt | --- kinfocenter/Modules/base/CMakeLists.txt.orig 2015-06-26 03:17:21 UTC | ||||
+++ kinfocenter/Modules/base/CMakeLists.txt | +++ kinfocenter/Modules/base/CMakeLists.txt | ||||
@@ -1,6 +1,7 @@ | @@ -1,6 +1,7 @@ | ||||
# TODO: HAVE_LIBDEVINFO_H (for Solaris 7 and later) | # TODO: HAVE_LIBDEVINFO_H (for Solaris 7 and later) | ||||
# to be set if both -ldevinfo and libdevinfo.h exist | # to be set if both -ldevinfo and libdevinfo.h exist | ||||
-check_include_files(devinfo.h HAVE_DEVINFO_H) # info_fbsd.cpp | -check_include_files(devinfo.h HAVE_DEVINFO_H) # info_fbsd.cpp | ||||
+macro_optional_find_package(BSDDevinfo) # info_fbsd.cpp | +macro_optional_find_package(BSDDevinfo) # info_fbsd.cpp | ||||
+macro_bool_to_01(BSDDEVINFO_FOUND HAVE_DEVINFO_H) | +macro_bool_to_01(BSDDEVINFO_FOUND HAVE_DEVINFO_H) | ||||
configure_file (../base/config-infocenter.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-infocenter.h ) | configure_file (../base/config-infocenter.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-infocenter.h ) | ||||
--- kinfocenter/Modules/base/info_fbsd.cpp.orig 2014-11-06 22:36:58.000000000 +0000 | --- kinfocenter/Modules/base/info_fbsd.cpp.orig 2015-06-26 03:17:21 UTC | ||||
+++ kinfocenter/Modules/base/info_fbsd.cpp 2015-02-20 22:40:53.380666149 +0000 | +++ kinfocenter/Modules/base/info_fbsd.cpp | ||||
@@ -15,8 +15,6 @@ | @@ -15,8 +15,6 @@ | ||||
*/ | */ | ||||
#include "config-infocenter.h" // HAVE_DEVINFO_H | #include "config-infocenter.h" // HAVE_DEVINFO_H | ||||
-#include <sys/types.h> | -#include <sys/types.h> | ||||
-#include <sys/sysctl.h> | -#include <sys/sysctl.h> | ||||
#ifdef HAVE_DEVINFO_H | #ifdef HAVE_DEVINFO_H | ||||
extern "C" { | extern "C" { | ||||
@@ -24,13 +22,16 @@ | @@ -24,13 +22,16 @@ extern "C" { | ||||
} | } | ||||
#endif | #endif | ||||
-#include <string.h> | -#include <string.h> | ||||
+#ifdef HAVE_PCIUTILS | +#ifdef HAVE_PCIUTILS | ||||
+#include "kpci.h" | +#include "kpci.h" | ||||
+#endif | +#endif | ||||
-#include <QMap> | -#include <QMap> | ||||
#include <QFileInfo> | #include <QFileInfo> | ||||
- | - | ||||
+#include <QStringList> | +#include <QStringList> | ||||
#include <QTextStream> | #include <QTextStream> | ||||
+#include <KGlobalSettings> | +#include <KGlobalSettings> | ||||
+ | + | ||||
void ProcessChildren(QString name); | void ProcessChildren(QString name); | ||||
#ifdef HAVE_DEVINFO_H | #ifdef HAVE_DEVINFO_H | ||||
@@ -44,13 +45,12 @@ | @@ -44,13 +45,12 @@ extern "C" { | ||||
bool GetInfo_IRQ(QTreeWidget* tree) { | bool GetInfo_IRQ(QTreeWidget* tree) { | ||||
#ifdef HAVE_DEVINFO_H | #ifdef HAVE_DEVINFO_H | ||||
- /* systat lists the interrupts assigned to devices as well as how many were | - /* systat lists the interrupts assigned to devices as well as how many were | ||||
- generated. Parsing its output however is about as fun as a sandpaper | - generated. Parsing its output however is about as fun as a sandpaper | ||||
- enema. The best idea would probably be to rip out the guts of systat. | - enema. The best idea would probably be to rip out the guts of systat. | ||||
- Too bad it's not very well commented */ | - Too bad it's not very well commented */ | ||||
- /* Oh neat, current now has a neat little utility called devinfo */ | - /* Oh neat, current now has a neat little utility called devinfo */ | ||||
if (devinfo_init()) | if (devinfo_init()) | ||||
- return false; | - return false; | ||||
+ return false; | + return false; | ||||
+ | + | ||||
+ QStringList headers; | + QStringList headers; | ||||
+ headers << i18n("IRQ") << i18n("Used By"); | + headers << i18n("IRQ") << i18n("Used By"); | ||||
+ tree->setHeaderLabels(headers); | + tree->setHeaderLabels(headers); | ||||
devinfo_foreach_rman(print_irq, tree); | devinfo_foreach_rman(print_irq, tree); | ||||
return true; | return true; | ||||
#else | #else | ||||
@@ -60,9 +60,13 @@ | @@ -60,9 +60,13 @@ bool GetInfo_IRQ(QTreeWidget* tree) { | ||||
bool GetInfo_DMA(QTreeWidget* tree) { | bool GetInfo_DMA(QTreeWidget* tree) { | ||||
#ifdef HAVE_DEVINFO_H | #ifdef HAVE_DEVINFO_H | ||||
- /* Oh neat, current now has a neat little utility called devinfo */ | - /* Oh neat, current now has a neat little utility called devinfo */ | ||||
if (devinfo_init()) | if (devinfo_init()) | ||||
- return false; | - return false; | ||||
+ return false; | + return false; | ||||
+ | + | ||||
+ QStringList headers; | + QStringList headers; | ||||
+ headers << i18n("DMA-Channel") << i18n("Used By"); | + headers << i18n("DMA-Channel") << i18n("Used By"); | ||||
+ tree->setHeaderLabels(headers); | + tree->setHeaderLabels(headers); | ||||
+ | + | ||||
devinfo_foreach_rman(print_dma, tree); | devinfo_foreach_rman(print_dma, tree); | ||||
return true; | return true; | ||||
#else | #else | ||||
@@ -72,9 +76,12 @@ | @@ -72,9 +76,12 @@ bool GetInfo_DMA(QTreeWidget* tree) { | ||||
bool GetInfo_IO_Ports(QTreeWidget* tree) { | bool GetInfo_IO_Ports(QTreeWidget* tree) { | ||||
#ifdef HAVE_DEVINFO_H | #ifdef HAVE_DEVINFO_H | ||||
- /* Oh neat, current now has a neat little utility called devinfo */ | - /* Oh neat, current now has a neat little utility called devinfo */ | ||||
if (devinfo_init()) | if (devinfo_init()) | ||||
- return false; | - return false; | ||||
+ return false; | + return false; | ||||
+ | + | ||||
+ QStringList headers; | + QStringList headers; | ||||
+ headers << i18n("I/O-Range") << i18n("Used By"); | + headers << i18n("I/O-Range") << i18n("Used By"); | ||||
+ tree->setHeaderLabels(headers); | + tree->setHeaderLabels(headers); | ||||
devinfo_foreach_rman(print_ioports, tree); | devinfo_foreach_rman(print_ioports, tree); | ||||
return true; | return true; | ||||
#else | #else | ||||
@@ -83,50 +90,28 @@ | @@ -83,50 +90,28 @@ bool GetInfo_IO_Ports(QTreeWidget* tree) | ||||
} | } | ||||
bool GetInfo_SCSI(QTreeWidget* tree) { | bool GetInfo_SCSI(QTreeWidget* tree) { | ||||
- FILE *pipe; | - FILE *pipe; | ||||
- QTextStream *t; | - QTextStream *t; | ||||
- QString s; | - QString s; | ||||
- | - | ||||
if (!QFileInfo(QLatin1String("/sbin/camcontrol")).exists()) { | if (!QFileInfo(QLatin1String("/sbin/camcontrol")).exists()) { | ||||
- s = i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be found"); | - s = i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be found"); | ||||
QStringList list; | - QStringList list; | ||||
- list << s; | - list << s; | ||||
+ list << i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be found"); | - new QTreeWidgetItem(tree, list); | ||||
new QTreeWidgetItem(tree, list); | |||||
- } else if ((pipe = popen("/sbin/camcontrol devlist 2>&1", "r")) == NULL) { | - } else if ((pipe = popen("/sbin/camcontrol devlist 2>&1", "r")) == NULL) { | ||||
- s = i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be executed"); | - s = i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be executed"); | ||||
- QStringList list; | QStringList list; | ||||
- list << s; | - list << s; | ||||
- new QTreeWidgetItem(tree, list); | + list << i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be found"); | ||||
new QTreeWidgetItem(tree, list); | |||||
- } else { | - } else { | ||||
- | - | ||||
- /* This prints out a list of all the scsi devies, perhaps eventually we could | - /* This prints out a list of all the scsi devies, perhaps eventually we could | ||||
- parse it as opposed to schlepping it into a listbox */ | - parse it as opposed to schlepping it into a listbox */ | ||||
- | - | ||||
- t = new QTextStream(pipe, QIODevice::ReadOnly); | - t = new QTextStream(pipe, QIODevice::ReadOnly); | ||||
- | - | ||||
- while (true) { | - while (true) { | ||||
Show All 30 Lines | |||||
+ if ( GetInfo_PCIUtils(tree)) { | + if ( GetInfo_PCIUtils(tree)) { | ||||
+ return true; | + return true; | ||||
+ } | + } | ||||
+ } | + } | ||||
+#endif //HAVE_PCIUTILS | +#endif //HAVE_PCIUTILS | ||||
const QStringList headers(i18nc("@title:column Column name for PCI information", "Information")); | const QStringList headers(i18nc("@title:column Column name for PCI information", "Information")); | ||||
tree->setHeaderLabels(headers); | tree->setHeaderLabels(headers); | ||||
@@ -136,40 +121,11 @@ | @@ -136,40 +121,11 @@ bool GetInfo_PCI(QTreeWidget* tree) { | ||||
list << i18n("Could not find any programs with which to query your system's PCI information"); | list << i18n("Could not find any programs with which to query your system's PCI information"); | ||||
new QTreeWidgetItem(tree, list); | new QTreeWidgetItem(tree, list); | ||||
return true; | return true; | ||||
- } else { | - } else { | ||||
- cmd = "/usr/sbin/pciconf -l -v 2>&1"; | - cmd = "/usr/sbin/pciconf -l -v 2>&1"; | ||||
- } | } | ||||
- | - | ||||
- // TODO: GetInfo_ReadfromPipe should be improved so that we could pass the program name and its | - // TODO: GetInfo_ReadfromPipe should be improved so that we could pass the program name and its | ||||
- // arguments to it and remove most of the code below. | - // arguments to it and remove most of the code below. | ||||
- if ((pipe = popen(cmd.toLatin1(), "r")) == NULL) { | - if ((pipe = popen(cmd.toLatin1(), "r")) == NULL) { | ||||
- QStringList list; | - QStringList list; | ||||
- list << i18n("PCI subsystem could not be queried: %1 could not be executed", cmd); | - list << i18n("PCI subsystem could not be queried: %1 could not be executed", cmd); | ||||
- olditem = new QTreeWidgetItem(olditem, list); | - olditem = new QTreeWidgetItem(olditem, list); | ||||
- } else { | - } else { | ||||
- /* This prints out a list of all the pci devies, perhaps eventually we could | - /* This prints out a list of all the pci devies, perhaps eventually we could | ||||
- parse it as opposed to schlepping it into a listbox */ | - parse it as opposed to schlepping it into a listbox */ | ||||
- QTextStream outputStream(pipe, QIODevice::ReadOnly); | - QTextStream outputStream(pipe, QIODevice::ReadOnly); | ||||
- | - | ||||
- while (!outputStream.atEnd()) { | - while (!outputStream.atEnd()) { | ||||
- s = outputStream.readLine(); | - s = outputStream.readLine(); | ||||
- if (s.isEmpty() ) | - if (s.isEmpty() ) | ||||
- break; | - break; | ||||
- const QStringList list(s); | - const QStringList list(s); | ||||
- new QTreeWidgetItem(tree, list); | - new QTreeWidgetItem(tree, list); | ||||
- } | - } | ||||
- | - | ||||
- pclose(pipe); | - pclose(pipe); | ||||
} | - } | ||||
- | - | ||||
- if (!tree->topLevelItemCount()) { | - if (!tree->topLevelItemCount()) { | ||||
- QString str = i18n("The PCI subsystem could not be queried, this may need root privileges."); | - QString str = i18n("The PCI subsystem could not be queried, this may need root privileges."); | ||||
- olditem = new QTreeWidgetItem(tree, olditem); | - olditem = new QTreeWidgetItem(tree, olditem); | ||||
- olditem->setText(0, str); | - olditem->setText(0, str); | ||||
+ if (GetInfo_ReadfromPipe(tree, "/usr/sbin/pciconf", QStringList() << "-l" << "-v", true)) | + if (GetInfo_ReadfromPipe(tree, "/usr/sbin/pciconf", QStringList() << "-l" << "-v", true)) | ||||
return true; | return true; | ||||
- } | - } | ||||
- return true; | - return true; | ||||
+ return false; | + return false; | ||||
} | } | ||||
bool GetInfo_XServer_and_Video(QTreeWidget* tree) { | bool GetInfo_XServer_and_Video(QTreeWidget* tree) { | ||||
@@ -179,12 +135,7 @@ | @@ -179,12 +135,7 @@ bool GetInfo_XServer_and_Video(QTreeWidg | ||||
#ifdef HAVE_DEVINFO_H | #ifdef HAVE_DEVINFO_H | ||||
int print_irq(struct devinfo_rman *rman, void *arg) { | int print_irq(struct devinfo_rman *rman, void *arg) { | ||||
- QTreeWidget* tree = (QTreeWidget *)arg; | - QTreeWidget* tree = (QTreeWidget *)arg; | ||||
if (strcmp(rman->dm_desc, "Interrupt request lines")==0) { | if (strcmp(rman->dm_desc, "Interrupt request lines")==0) { | ||||
- | - | ||||
- QStringList list; | - QStringList list; | ||||
- list << rman->dm_desc; | - list << rman->dm_desc; | ||||
- new QTreeWidgetItem(tree, list); | - new QTreeWidgetItem(tree, list); | ||||
devinfo_foreach_rman_resource(rman, print_resource, arg); | devinfo_foreach_rman_resource(rman, print_resource, arg); | ||||
} | } | ||||
return 0; | return 0; | ||||
@@ -192,11 +143,7 @@ | @@ -192,11 +143,7 @@ int print_irq(struct devinfo_rman *rman, | ||||
int print_dma(struct devinfo_rman *rman, void *arg) | int print_dma(struct devinfo_rman *rman, void *arg) | ||||
{ | { | ||||
- QTreeWidget* tree = (QTreeWidget *)arg; | - QTreeWidget* tree = (QTreeWidget *)arg; | ||||
if (strcmp(rman->dm_desc, "DMA request lines")==0) { | if (strcmp(rman->dm_desc, "DMA request lines")==0) { | ||||
- QStringList list; | - QStringList list; | ||||
- list << rman->dm_desc; | - list << rman->dm_desc; | ||||
- new QTreeWidgetItem(tree, list); | - new QTreeWidgetItem(tree, list); | ||||
devinfo_foreach_rman_resource(rman, print_resource, arg); | devinfo_foreach_rman_resource(rman, print_resource, arg); | ||||
} | } | ||||
return(0); | return(0); | ||||
@@ -230,29 +177,25 @@ | @@ -230,29 +177,25 @@ int print_resource(struct devinfo_res *r | ||||
int hexmode; | int hexmode; | ||||
QTreeWidget* tree = (QTreeWidget*) arg; | QTreeWidget* tree = (QTreeWidget*) arg; | ||||
+ tree->setFont(KGlobalSettings::fixedFont()); | + tree->setFont(KGlobalSettings::fixedFont()); | ||||
+ QStringList list; | + QStringList list; | ||||
- QString s, tmp; | - QString s, tmp; | ||||
+ QString s; | + QString s; | ||||
Show All 25 Lines | |||||
+ if ((dev != NULL) && (dev->dd_name[0] != 0)) | + if ((dev != NULL) && (dev->dd_name[0] != 0)) | ||||
+ list << QString(dev->dd_name); | + list << QString(dev->dd_name); | ||||
- QStringList list; | - QStringList list; | ||||
- list << s; | - list << s; | ||||
new QTreeWidgetItem(tree, list); | new QTreeWidgetItem(tree, list); | ||||
return 0; | return 0; | ||||
--- kinfocenter/Modules/info/CMakeLists.txt | --- kinfocenter/Modules/base/info_hpux.cpp.orig 2015-06-26 03:17:21 UTC | ||||
+++ kinfocenter/Modules/info/CMakeLists.txt | |||||
@@ -13,6 +13,9 @@ set(kcm_info_PART_SRCS main.cpp info.cpp ../base/os_current.cpp ) | |||||
kde4_add_plugin(kcm_info ${kcm_info_PART_SRCS}) | |||||
target_link_libraries(kcm_info ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB}) | |||||
+if(BSDDEVINFO_FOUND) | |||||
+ target_link_libraries(kcm_info ${BSDDEVINFO_LIBRARY}) | |||||
+endif(BSDDEVINFO_FOUND) | |||||
install(TARGETS kcm_info DESTINATION ${PLUGIN_INSTALL_DIR} ) | |||||
--- kinfocenter/Modules/base/info_hpux.cpp | |||||
+++ kinfocenter/Modules/base/info_hpux.cpp | +++ kinfocenter/Modules/base/info_hpux.cpp | ||||
@@ -30,6 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | @@ -30,6 +30,7 @@ along with this program. If not, see <h | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <QFile> | #include <QFile> | ||||
#include <QFontMetrics> | #include <QFontMetrics> | ||||
+#include <QStringList> | +#include <QStringList> | ||||
#include <QTextStream> | #include <QTextStream> | ||||
# define INFO_PCI "" // Please, who know it ???? | # define INFO_PCI "" // Please, who know it ???? | ||||
@@ -178,14 +179,14 @@ bool GetInfo_PCI(QTreeWidget* tree) { | @@ -178,14 +179,14 @@ bool GetInfo_PCI(QTreeWidget* tree) { | ||||
Show All 9 Lines | |||||
} | } | ||||
bool GetInfo_SCSI(QListView *lBox) { | bool GetInfo_SCSI(QListView *lBox) { | ||||
- return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, false); | - return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, false); | ||||
+ return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, QStringList(), false); | + return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, QStringList(), false); | ||||
} | } | ||||
/* Parts taken from fsusage.c from the Midnight Commander (mc) | /* Parts taken from fsusage.c from the Midnight Commander (mc) | ||||
--- kinfocenter/Modules/base/info_linux.cpp | --- kinfocenter/Modules/base/info_linux.cpp.orig 2015-06-26 03:17:21 UTC | ||||
+++ kinfocenter/Modules/base/info_linux.cpp | +++ kinfocenter/Modules/base/info_linux.cpp | ||||
@@ -33,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | @@ -33,6 +33,7 @@ along with this program. If not, see <h | ||||
#include <QRegExp> | #include <QRegExp> | ||||
#include <QFile> | #include <QFile> | ||||
#include <QHeaderView> | #include <QHeaderView> | ||||
+#include <QStringList> | +#include <QStringList> | ||||
#include <klocale.h> | #include <klocale.h> | ||||
#include <kiconloader.h> | #include <kiconloader.h> | ||||
@@ -140,9 +141,12 @@ bool GetInfo_PCI(QTreeWidget* tree) { | @@ -140,9 +141,12 @@ bool GetInfo_PCI(QTreeWidget* tree) { | ||||
tree->setSortingEnabled(false); | tree->setSortingEnabled(false); | ||||
/* try to get the output of the lspci package first */ | /* try to get the output of the lspci package first */ | ||||
- if ((num = GetInfo_ReadfromPipe(tree, "lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, "/sbin/lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, "/usr/sbin/lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, "/usr/local/sbin/lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, | - if ((num = GetInfo_ReadfromPipe(tree, "lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, "/sbin/lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, "/usr/sbin/lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, "/usr/local/sbin/lspci -v", true)) || (num = GetInfo_ReadfromPipe(tree, | ||||
- "/usr/bin/lspci -v", true))) | - "/usr/bin/lspci -v", true))) | ||||
- return num; | - return num; | ||||
+ QStringList lspci; | + QStringList lspci; | ||||
+ lspci << "lspci" << "/sbin/lspci" << "/usr/sbin/lspci" << "/usr/local/sbin/lspci" << "/usr/bin/lspci"; | + lspci << "lspci" << "/sbin/lspci" << "/usr/sbin/lspci" << "/usr/local/sbin/lspci" << "/usr/bin/lspci"; | ||||
+ QString p; | + QString p; | ||||
+ foreach(p, lspci) | + foreach(p, lspci) | ||||
+ if (num = GetInfo_ReadfromPipe(tree, p, QStringList() << "-v", true)) | + if (num = GetInfo_ReadfromPipe(tree, p, QStringList() << "-v", true)) | ||||
+ return num; | + return num; | ||||
/* if lspci failed, read the contents of /proc/pci */ | /* if lspci failed, read the contents of /proc/pci */ | ||||
return GetInfo_ReadfromFile(tree, INFO_PCI, 0); | return GetInfo_ReadfromFile(tree, INFO_PCI, 0); | ||||
--- kinfocenter/Modules/base/os_base.h | --- kinfocenter/Modules/base/os_base.h.orig 2015-06-26 03:17:21 UTC | ||||
+++ kinfocenter/Modules/base/os_base.h | +++ kinfocenter/Modules/base/os_base.h | ||||
@@ -320,12 +320,12 @@ static bool GetInfo_XServer_Generic(QTreeWidget *lBox) { | @@ -330,12 +330,12 @@ static bool GetInfo_XServer_Generic(QTre | ||||
} | } | ||||
/* Helper-function to read output from an external program */ | /* Helper-function to read output from an external program */ | ||||
-static int GetInfo_ReadfromPipe(QTreeWidget* tree, const char *FileName, bool WithEmptyLines = true) { | -static int GetInfo_ReadfromPipe(QTreeWidget* tree, const char *FileName, bool WithEmptyLines = true) { | ||||
+static int GetInfo_ReadfromPipe(QTreeWidget* tree, const QString &program, const QStringList &arguments, bool WithEmptyLines = true) { | +static int GetInfo_ReadfromPipe(QTreeWidget* tree, const QString &program, const QStringList &arguments, bool WithEmptyLines = true) { | ||||
QProcess proc; | QProcess proc; | ||||
QTreeWidgetItem* olditem= NULL; | QTreeWidgetItem* olditem= NULL; | ||||
QString s; | QString s; | ||||
- proc.start(FileName, QIODevice::ReadOnly); | - proc.start(FileName, QIODevice::ReadOnly); | ||||
+ proc.start(program, arguments, QIODevice::ReadOnly); | + proc.start(program, arguments, QIODevice::ReadOnly); | ||||
if (!proc.waitForFinished()) { | if (!proc.waitForFinished()) { | ||||
// Process hanged or did not start | // Process hanged or did not start | ||||
return 0; | return 0; | ||||
--- kinfocenter/Modules/info/CMakeLists.txt.orig 2015-06-26 03:17:21 UTC | |||||
+++ kinfocenter/Modules/info/CMakeLists.txt | |||||
@@ -13,6 +13,9 @@ set(kcm_info_PART_SRCS main.cpp info.cpp | |||||
kde4_add_plugin(kcm_info ${kcm_info_PART_SRCS}) | |||||
target_link_libraries(kcm_info ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB}) | |||||
+if(BSDDEVINFO_FOUND) | |||||
+ target_link_libraries(kcm_info ${BSDDEVINFO_LIBRARY}) | |||||
+endif(BSDDEVINFO_FOUND) | |||||
install(TARGETS kcm_info DESTINATION ${PLUGIN_INSTALL_DIR} ) | |||||