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. | ||||
--- cmake/modules/FindBSDDevinfo.cmake.orig 2016-12-13 11:26:31 UTC | --- cmake/modules/FindBSDDevinfo.cmake.orig 2015-08-12 07:03:15 UTC | ||||
mat: This is only a header change, revert. | |||||
+++ 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.orig 2015-06-26 03:17:21 UTC | --- kinfocenter/Modules/base/CMakeLists.txt.orig 2015-08-12 07:03:15 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 2015-06-26 03:17:21 UTC | --- kinfocenter/Modules/base/info_fbsd.cpp.orig 2015-08-12 07:03:15 UTC | ||||
+++ kinfocenter/Modules/base/info_fbsd.cpp | +++ 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> | ||||
▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 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/base/info_hpux.cpp.orig 2015-06-26 03:17:21 UTC | --- kinfocenter/Modules/base/info_hpux.cpp.orig 2015-08-12 07:03:15 UTC | ||||
+++ kinfocenter/Modules/base/info_hpux.cpp | +++ kinfocenter/Modules/base/info_hpux.cpp | ||||
@@ -30,6 +30,7 @@ along with this program. If not, see <h | @@ -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> | ||||
Show All 11 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.orig 2015-06-26 03:17:21 UTC | --- kinfocenter/Modules/base/info_linux.cpp.orig 2015-08-12 07:03:15 UTC | ||||
+++ kinfocenter/Modules/base/info_linux.cpp | +++ kinfocenter/Modules/base/info_linux.cpp | ||||
@@ -33,6 +33,7 @@ along with this program. If not, see <h | @@ -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> | ||||
Show All 9 Lines | |||||
+ 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.orig 2015-06-26 03:17:21 UTC | --- kinfocenter/Modules/base/os_base.h.orig 2015-08-12 07:03:15 UTC | ||||
+++ kinfocenter/Modules/base/os_base.h | +++ kinfocenter/Modules/base/os_base.h | ||||
@@ -330,12 +330,12 @@ static bool GetInfo_XServer_Generic(QTre | @@ -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.orig 2015-08-12 07:03:15 UTC | ||||
+++ kinfocenter/Modules/info/CMakeLists.txt | +++ kinfocenter/Modules/info/CMakeLists.txt | ||||
@@ -13,6 +13,9 @@ set(kcm_info_PART_SRCS main.cpp info.cpp | @@ -13,6 +13,9 @@ set(kcm_info_PART_SRCS main.cpp info.cpp | ||||
kde4_add_plugin(kcm_info ${kcm_info_PART_SRCS}) | kde4_add_plugin(kcm_info ${kcm_info_PART_SRCS}) | ||||
target_link_libraries(kcm_info ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB}) | target_link_libraries(kcm_info ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_X11_LIB}) | ||||
+if(BSDDEVINFO_FOUND) | +if(BSDDEVINFO_FOUND) | ||||
+ target_link_libraries(kcm_info ${BSDDEVINFO_LIBRARY}) | + target_link_libraries(kcm_info ${BSDDEVINFO_LIBRARY}) | ||||
+endif(BSDDEVINFO_FOUND) | +endif(BSDDEVINFO_FOUND) | ||||
install(TARGETS kcm_info DESTINATION ${PLUGIN_INSTALL_DIR} ) | install(TARGETS kcm_info DESTINATION ${PLUGIN_INSTALL_DIR} ) | ||||
This is only a header change, revert.