aboutsummaryrefslogtreecommitdiff
path: root/x11/kde-workspace-kde4/files
diff options
context:
space:
mode:
Diffstat (limited to 'x11/kde-workspace-kde4/files')
-rw-r--r--x11/kde-workspace-kde4/files/kde4.desktop7
-rw-r--r--x11/kde-workspace-kde4/files/kdm4.in75
-rw-r--r--x11/kde-workspace-kde4/files/patch-CMakeLists.txt11
-rw-r--r--x11/kde-workspace-kde4/files/patch-ConfigureChecks.cmake20
-rw-r--r--x11/kde-workspace-kde4/files/patch-kdm_backend_client.c35
-rw-r--r--x11/kde-workspace-kde4/files/patch-kdm_kfrontend_CMakeLists.txt12
-rw-r--r--x11/kde-workspace-kde4/files/patch-kinfocenter375
-rw-r--r--x11/kde-workspace-kde4/files/patch-kinfocenter_Modules_pci_kpci.cpp56
-rw-r--r--x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.cpp306
-rw-r--r--x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.h29
-rw-r--r--x11/kde-workspace-kde4/files/patch-ksysguard_gui_SystemLoad2.sgrd24
-rw-r--r--x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.cpp73
-rw-r--r--x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.h12
-rw-r--r--x11/kde-workspace-kde4/files/patch-kwin_effects_blur_blur.cpp13
-rw-r--r--x11/kde-workspace-kde4/files/patch-kwin_opengltest_CMakeLists.txt15
-rw-r--r--x11/kde-workspace-kde4/files/patch-kwin_scene__xrender.cpp22
-rw-r--r--x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.cpp25
-rw-r--r--x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.h12
-rw-r--r--x11/kde-workspace-kde4/files/patch-plasma_generic_applets_systemtray_CMakeLists.txt16
-rw-r--r--x11/kde-workspace-kde4/files/patch-powerdevil_daemon_backends_upower_xrandrbrightness.cpp21
-rw-r--r--x11/kde-workspace-kde4/files/patch-startkde.cmake12
-rw-r--r--x11/kde-workspace-kde4/files/patch-usbview493
-rw-r--r--x11/kde-workspace-kde4/files/pkg-message.gstreamer5
-rw-r--r--x11/kde-workspace-kde4/files/pkg-message.in8
24 files changed, 1677 insertions, 0 deletions
diff --git a/x11/kde-workspace-kde4/files/kde4.desktop b/x11/kde-workspace-kde4/files/kde4.desktop
new file mode 100644
index 000000000000..9b5bb888248d
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/kde4.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=XSession
+Exec=/usr/local/bin/startkde
+TryExec=/usr/local/bin/startkde
+DesktopNames=KDE
+Name=KDE4
diff --git a/x11/kde-workspace-kde4/files/kdm4.in b/x11/kde-workspace-kde4/files/kdm4.in
new file mode 100644
index 000000000000..278ff6223518
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/kdm4.in
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: kdm4
+# REQUIRE: LOGIN cleanvar moused syscons dbus hald
+# KEYWORD: shutdown
+#
+# Add the following to /etc/rc.conf to start KDM at boot time:
+#
+# kdm4_enable="YES"
+#
+# # Optional variables
+# kdm4_lang="en_US" # Default language. Note that language settings
+# # in %%PREFIX%%/share/config/kdm/kdmrc has
+# # higher priority.
+
+. /etc/rc.subr
+
+name=kdm4
+rcvar=kdm4_enable
+
+load_rc_config ${name}
+
+: ${kdm4_enable:="NO"}
+: ${kdm4_lang="en_US"} # .UTF-8 suffix will be added later to comply with locale format
+
+GENKDMCONF=%%PREFIX%%/bin/genkdmconf
+KDMCONFDIR=%%PREFIX%%/share/config/kdm
+
+command="%%PREFIX%%/bin/kdm"
+pidfile="/var/run/kdm.pid"
+start_cmd="kdm_start"
+
+kdm_genkdmconf()
+{
+ # Configure KDM if needed.
+ if [ ! -r ${KDMCONFDIR}/kdmrc ]; then
+ echo "Generating KDM configuration."
+ ${GENKDMCONF} --no-old --in ${KDMCONFDIR}
+ else
+ echo "Updating KDM configuration."
+ ${GENKDMCONF} --in ${KDMCONFDIR}
+ fi
+}
+
+kdm_start()
+{
+ kdm_genkdmconf
+
+ local iter
+
+ ( iter=0
+ while ! pgrep -f "^/usr/libexec/getty " > /dev/null 2>&1; do
+ if [ ${iter} -ge 600 ]; then
+ return 1
+ fi
+ sleep 1
+ iter=$((${iter} + 1))
+ done
+ if checkyesno hald_enable; then
+ if [ ! -x %%LOCALBASE%%/sbin/hald ]; then
+ err 1 "%%LOCALBASE%%/sbin/hald is not installed"
+ fi
+ iter=0
+ while [ ${iter} -lt 60 ] &&
+ ! pgrep -f "^%%LOCALBASE%%/sbin/hald" > /dev/null 2>&1; do
+ sleep 1
+ iter=$((${iter} + 1))
+ done
+ fi
+ LANG=${kdm4_lang}.UTF-8 ${command} ${kdm4_flags} ) &
+}
+
+run_rc_command "$1"
diff --git a/x11/kde-workspace-kde4/files/patch-CMakeLists.txt b/x11/kde-workspace-kde4/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..418ac6c5e40e
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-CMakeLists.txt
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig 2015-06-26 03:17:21 UTC
++++ CMakeLists.txt
+@@ -198,7 +198,7 @@ if(NOT WIN32)
+ configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h )
+ configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h )
+ if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+- set(EXPORT_XCURSOR_PATH "XCURSOR_PATH=${CMAKE_INSTALL_PREFIX}/share/icons:$XCURSOR_PATH\":~/.icons:/usr/share/icons:/usr/share/pixmaps:/usr/X11R6/lib/X11/icons\"; export XCURSOR_PATH")
++ set(EXPORT_XCURSOR_PATH "XCURSOR_PATH=${CMAKE_INSTALL_PREFIX}/share/icons:$XCURSOR_PATH\":~/.icons:/usr/local/share/icons:/usr/local/share/pixmaps:/usr/local/lib/X11/icons\"; export XCURSOR_PATH")
+ endif(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+ configure_file(startkde.cmake ${CMAKE_CURRENT_BINARY_DIR}/startkde @ONLY)
+ endif(NOT WIN32)
diff --git a/x11/kde-workspace-kde4/files/patch-ConfigureChecks.cmake b/x11/kde-workspace-kde4/files/patch-ConfigureChecks.cmake
new file mode 100644
index 000000000000..ceb47dd93117
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-ConfigureChecks.cmake
@@ -0,0 +1,20 @@
+--- ConfigureChecks.cmake.orig 2015-06-26 03:17:21 UTC
++++ ConfigureChecks.cmake
+@@ -21,16 +21,7 @@ if (PAM_FOUND)
+ endmacro(define_pam_service)
+
+ macro(install_pam_service APP)
+- string(TOUPPER KDE4_${APP}_PAM_SERVICE cvar)
+- install(CODE "
+- set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
+- if (NOT DESTDIR_VALUE)
+- exec_program(\"${KDEBASE_WORKSPACE_SOURCE_DIR}/mkpamserv\" ARGS ${${cvar}} RETURN_VALUE ret)
+- if (NOT ret)
+- exec_program(\"${KDEBASE_WORKSPACE_SOURCE_DIR}/mkpamserv\" ARGS -P ${${cvar}}-np)
+- endif (NOT ret)
+- endif (NOT DESTDIR_VALUE)
+- ")
++ message("Ignore installing pam service, FreeBSD has it already.")
+ endmacro(install_pam_service)
+
+ define_pam_service(KDM)
diff --git a/x11/kde-workspace-kde4/files/patch-kdm_backend_client.c b/x11/kde-workspace-kde4/files/patch-kdm_backend_client.c
new file mode 100644
index 000000000000..cff83e810c9f
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kdm_backend_client.c
@@ -0,0 +1,35 @@
+--- kdm/backend/client.c.orig 2015-06-26 03:17:21 UTC
++++ kdm/backend/client.c
+@@ -1322,6 +1322,9 @@ startClient(volatile int *pid)
+ char ckDeviceBuf[20] = "";
+ const char *ckDevice = ckDeviceBuf;
+ dbus_bool_t isLocal;
++# ifdef BSD
++ FILE *proc;
++# endif
+ #endif
+ char *failsafeArgv[2];
+ char *buf, *buf2;
+@@ -1353,6 +1356,13 @@ startClient(volatile int *pid)
+ # ifdef HAVE_VTS
+ if (td->serverVT > 0)
+ sprintf(ckDeviceBuf, "/dev/tty%d", td->serverVT);
++# elif defined(BSD)
++ if ((proc = popen( "/usr/local/libexec/ck-get-x11-display-device", "r" ))) {
++ fscanf( proc, "%s", ckDeviceBuf );
++ pclose(proc);
++ if (strcmp( ckDeviceBuf, "usage" ) == 0 || strcmp( ckDeviceBuf, "ERROR:" ) == 0)
++ ckDeviceBuf[0] = '\0';
++ }
+ # endif
+ isLocal = ((td->displayType & d_location) == dLocal);
+ # ifdef XDMCP
+@@ -1532,7 +1542,7 @@ startClient(volatile int *pid)
+ environ = pam_env;
+ # endif
+ removeCreds = True; /* set it first - i don't trust PAM's rollback */
+- pretc = pam_setcred(pamh, 0);
++ pretc = pam_setcred(pamh, PAM_ESTABLISH_CRED);
+ reInitErrorLog();
+ # ifndef HAVE_PAM_GETENVLIST
+ pam_env = environ;
diff --git a/x11/kde-workspace-kde4/files/patch-kdm_kfrontend_CMakeLists.txt b/x11/kde-workspace-kde4/files/patch-kdm_kfrontend_CMakeLists.txt
new file mode 100644
index 000000000000..40bcb9a68ff4
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kdm_kfrontend_CMakeLists.txt
@@ -0,0 +1,12 @@
+--- kdm/kfrontend/CMakeLists.txt.orig 2015-06-26 03:17:21 UTC
++++ kdm/kfrontend/CMakeLists.txt
+@@ -111,6 +111,6 @@ install(TARGETS kdmctl ${INSTALL_TARGETS
+
+
+ # use 'GENKDMCONF_FLAGS=... make install' to add flags to the config generation (try genkdmconf -h)
+-install(CODE "
+-exec_program(\"${CMAKE_CURRENT_BINARY_DIR}/genkdmconf\" ARGS --in \\\"\\\$DESTDIR${CONFIG_INSTALL_DIR}/kdm\\\" --no-in-notice --face-src \\\"${CMAKE_CURRENT_SOURCE_DIR}/pics\\\" \\\$GENKDMCONF_FLAGS)
+-")
++#install(CODE "
++#exec_program(\"${CMAKE_CURRENT_BINARY_DIR}/genkdmconf\" ARGS --in \\\"\\\$DESTDIR${CONFIG_INSTALL_DIR}/kdm\\\" --no-in-notice --face-src \\\"${CMAKE_CURRENT_SOURCE_DIR}/pics\\\" \\\$GENKDMCONF_FLAGS)
++#")
diff --git a/x11/kde-workspace-kde4/files/patch-kinfocenter b/x11/kde-workspace-kde4/files/patch-kinfocenter
new file mode 100644
index 000000000000..effd580055ab
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kinfocenter
@@ -0,0 +1,375 @@
+ Clean up info_fbsd.cpp.
+ Use libpci for pci access if possible - on FreeBSD it requires root
+ privileges (rw access to /dev/pci), therefore leave old method
+ as a fallback.
+ Improve GetInfo_ReadfromPipe function to use Qt types, pass program name
+ and its parameters as separate arguments.
+
+--- cmake/modules/FindBSDDevinfo.cmake.orig 2016-12-13 11:26:31 UTC
++++ cmake/modules/FindBSDDevinfo.cmake
+@@ -0,0 +1,15 @@
++# Find FreeBSD devinfo library
++# Once done this will define
++#
++# BSDDEVINFO_FOUND - system has devinfo
++# BSDDEVINFO_INCLUDE_DIR - devinfo include directory
++# BSDDEVINFO_LIBRARY - devinfo library
++
++find_path(BSDDEVINFO_INCLUDE_DIR devinfo.h)
++
++find_library(BSDDEVINFO_LIBRARY NAMES devinfo)
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(BSDDEVINFO DEFAULT_MSG BSDDEVINFO_LIBRARY BSDDEVINFO_INCLUDE_DIR)
++
++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
+@@ -1,6 +1,7 @@
+ # TODO: HAVE_LIBDEVINFO_H (for Solaris 7 and later)
+ # to be set if both -ldevinfo and libdevinfo.h exist
+
+-check_include_files(devinfo.h HAVE_DEVINFO_H) # info_fbsd.cpp
++macro_optional_find_package(BSDDevinfo) # info_fbsd.cpp
++macro_bool_to_01(BSDDEVINFO_FOUND HAVE_DEVINFO_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
+@@ -15,8 +15,6 @@
+ */
+
+ #include "config-infocenter.h" // HAVE_DEVINFO_H
+-#include <sys/types.h>
+-#include <sys/sysctl.h>
+
+ #ifdef HAVE_DEVINFO_H
+ extern "C" {
+@@ -24,13 +22,16 @@ extern "C" {
+ }
+ #endif
+
+-#include <string.h>
++#ifdef HAVE_PCIUTILS
++#include "kpci.h"
++#endif
+
+-#include <QMap>
+ #include <QFileInfo>
+-
++#include <QStringList>
+ #include <QTextStream>
+
++#include <KGlobalSettings>
++
+ void ProcessChildren(QString name);
+
+ #ifdef HAVE_DEVINFO_H
+@@ -44,13 +45,12 @@ extern "C" {
+
+ bool GetInfo_IRQ(QTreeWidget* tree) {
+ #ifdef HAVE_DEVINFO_H
+- /* 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
+- enema. The best idea would probably be to rip out the guts of systat.
+- Too bad it's not very well commented */
+- /* Oh neat, current now has a neat little utility called devinfo */
+ if (devinfo_init())
+- return false;
++ return false;
++
++ QStringList headers;
++ headers << i18n("IRQ") << i18n("Used By");
++ tree->setHeaderLabels(headers);
+ devinfo_foreach_rman(print_irq, tree);
+ return true;
+ #else
+@@ -60,9 +60,13 @@ bool GetInfo_IRQ(QTreeWidget* tree) {
+
+ bool GetInfo_DMA(QTreeWidget* tree) {
+ #ifdef HAVE_DEVINFO_H
+- /* Oh neat, current now has a neat little utility called devinfo */
+ if (devinfo_init())
+- return false;
++ return false;
++
++ QStringList headers;
++ headers << i18n("DMA-Channel") << i18n("Used By");
++ tree->setHeaderLabels(headers);
++
+ devinfo_foreach_rman(print_dma, tree);
+ return true;
+ #else
+@@ -72,9 +76,12 @@ bool GetInfo_DMA(QTreeWidget* tree) {
+
+ bool GetInfo_IO_Ports(QTreeWidget* tree) {
+ #ifdef HAVE_DEVINFO_H
+- /* Oh neat, current now has a neat little utility called devinfo */
+ if (devinfo_init())
+- return false;
++ return false;
++
++ QStringList headers;
++ headers << i18n("I/O-Range") << i18n("Used By");
++ tree->setHeaderLabels(headers);
+ devinfo_foreach_rman(print_ioports, tree);
+ return true;
+ #else
+@@ -83,50 +90,28 @@ bool GetInfo_IO_Ports(QTreeWidget* tree)
+ }
+
+ bool GetInfo_SCSI(QTreeWidget* tree) {
+- FILE *pipe;
+- QTextStream *t;
+- QString s;
+-
+ if (!QFileInfo(QLatin1String("/sbin/camcontrol")).exists()) {
+- s = i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be found");
+- QStringList list;
+- list << s;
+- new QTreeWidgetItem(tree, list);
+- } 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");
+ QStringList list;
+- list << s;
++ list << i18n("SCSI subsystem could not be queried: /sbin/camcontrol could not be found");
+ new QTreeWidgetItem(tree, list);
+- } else {
+-
+- /* This prints out a list of all the scsi devies, perhaps eventually we could
+- parse it as opposed to schlepping it into a listbox */
+-
+- t = new QTextStream(pipe, QIODevice::ReadOnly);
+-
+- while (true) {
+- s = t->readLine();
+- if (s.isEmpty() )
+- break;
+- QStringList list;
+- list << s;
+- new QTreeWidgetItem(tree, list);
+- }
+-
+- delete t;
+- pclose(pipe);
+ }
++ if (GetInfo_ReadfromPipe(tree, "/sbin/camcontrol", QStringList() << "devlist", true))
++ return true;
+
+- if (!tree->topLevelItemCount())
+- return false;
+-
+- return true;
++ return false;
+ }
+
+ bool GetInfo_PCI(QTreeWidget* tree) {
+- FILE *pipe;
+- QString s, cmd;
+- QTreeWidgetItem *olditem= NULL;
++#ifdef HAVE_PCIUTILS
++// libpci exits immediately if /dev/pci can't be open in rw mode
++ QFile pcidev("/dev/pci");
++ if (pcidev.open(QIODevice::ReadWrite)) {
++ pcidev.close();
++ if ( GetInfo_PCIUtils(tree)) {
++ return true;
++ }
++ }
++#endif //HAVE_PCIUTILS
+
+ const QStringList headers(i18nc("@title:column Column name for PCI information", "Information"));
+ tree->setHeaderLabels(headers);
+@@ -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");
+ new QTreeWidgetItem(tree, list);
+ return true;
+- } else {
+- cmd = "/usr/sbin/pciconf -l -v 2>&1";
+ }
+-
+- // 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.
+- if ((pipe = popen(cmd.toLatin1(), "r")) == NULL) {
+- QStringList list;
+- list << i18n("PCI subsystem could not be queried: %1 could not be executed", cmd);
+- olditem = new QTreeWidgetItem(olditem, list);
+- } else {
+- /* This prints out a list of all the pci devies, perhaps eventually we could
+- parse it as opposed to schlepping it into a listbox */
+- QTextStream outputStream(pipe, QIODevice::ReadOnly);
+-
+- while (!outputStream.atEnd()) {
+- s = outputStream.readLine();
+- if (s.isEmpty() )
+- break;
+- const QStringList list(s);
+- new QTreeWidgetItem(tree, list);
+- }
+-
+- pclose(pipe);
+- }
+-
+- if (!tree->topLevelItemCount()) {
+- QString str = i18n("The PCI subsystem could not be queried, this may need root privileges.");
+- olditem = new QTreeWidgetItem(tree, olditem);
+- olditem->setText(0, str);
++ if (GetInfo_ReadfromPipe(tree, "/usr/sbin/pciconf", QStringList() << "-l" << "-v", true))
+ return true;
+- }
+
+- return true;
++ return false;
+ }
+
+ bool GetInfo_XServer_and_Video(QTreeWidget* tree) {
+@@ -179,12 +135,7 @@ bool GetInfo_XServer_and_Video(QTreeWidg
+ #ifdef HAVE_DEVINFO_H
+
+ int print_irq(struct devinfo_rman *rman, void *arg) {
+- QTreeWidget* tree = (QTreeWidget *)arg;
+ if (strcmp(rman->dm_desc, "Interrupt request lines")==0) {
+-
+- QStringList list;
+- list << rman->dm_desc;
+- new QTreeWidgetItem(tree, list);
+ devinfo_foreach_rman_resource(rman, print_resource, arg);
+ }
+ return 0;
+@@ -192,11 +143,7 @@ int print_irq(struct devinfo_rman *rman,
+
+ int print_dma(struct devinfo_rman *rman, void *arg)
+ {
+- QTreeWidget* tree = (QTreeWidget *)arg;
+ if (strcmp(rman->dm_desc, "DMA request lines")==0) {
+- QStringList list;
+- list << rman->dm_desc;
+- new QTreeWidgetItem(tree, list);
+ devinfo_foreach_rman_resource(rman, print_resource, arg);
+ }
+ return(0);
+@@ -230,29 +177,25 @@ int print_resource(struct devinfo_res *r
+ int hexmode;
+
+ QTreeWidget* tree = (QTreeWidget*) arg;
++ tree->setFont(KGlobalSettings::fixedFont());
++ QStringList list;
+
+- QString s, tmp;
++ QString s;
++ QTextStream result(&s);
+
+ rman = devinfo_handle_to_rman(res->dr_rman);
+ hexmode = (rman->dm_size > 100) || (rman->dm_size == 0);
+- tmp.sprintf(hexmode ? "0x%lx" : "%lu", res->dr_start);
+- s += tmp;
+- if (res->dr_size > 1) {
+- tmp.sprintf(hexmode ? "-0x%lx" : "-%lu",
+- res->dr_start + res->dr_size - 1);
+- s += tmp;
+- }
++ if (hexmode)
++ result << showbase << hex;
++ result << res->dr_start;
++ if (res->dr_size > 1)
++ result << "-" << res->dr_start + res->dr_size - 1;
++ list << s;
+
+ dev = devinfo_handle_to_device(res->dr_device);
+- if ((dev != NULL) && (dev->dd_name[0] != 0)) {
+- tmp.sprintf(" (%s)", dev->dd_name);
+- } else {
+- tmp.sprintf(" ----");
+- }
+- s += tmp;
++ if ((dev != NULL) && (dev->dd_name[0] != 0))
++ list << QString(dev->dd_name);
+
+- QStringList list;
+- list << s;
+ new QTreeWidgetItem(tree, list);
+
+ return 0;
+--- kinfocenter/Modules/base/info_hpux.cpp.orig 2015-06-26 03:17:21 UTC
++++ kinfocenter/Modules/base/info_hpux.cpp
+@@ -30,6 +30,7 @@ along with this program. If not, see <h
+ #include <stdlib.h>
+ #include <QFile>
+ #include <QFontMetrics>
++#include <QStringList>
+ #include <QTextStream>
+
+ # define INFO_PCI "" // Please, who know it ????
+@@ -178,14 +179,14 @@ bool GetInfo_PCI(QTreeWidget* tree) {
+ }
+
+ bool GetInfo_IO_Ports(QListView *lBox) {
+- if (GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_1, false))
++ if (GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_1, QStringList(), false))
+ return true;
+ else
+- return GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_2, false);
++ return GetInfo_ReadfromPipe(lBox, INFO_IOPORTS_2, QStringList(), false);
+ }
+
+ bool GetInfo_SCSI(QListView *lBox) {
+- return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, false);
++ return GetInfo_ReadfromPipe(lBox, INFO_DEVICES, QStringList(), false);
+ }
+ /* 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
+@@ -33,6 +33,7 @@ along with this program. If not, see <h
+ #include <QRegExp>
+ #include <QFile>
+ #include <QHeaderView>
++#include <QStringList>
+
+ #include <klocale.h>
+ #include <kiconloader.h>
+@@ -140,9 +141,12 @@ bool GetInfo_PCI(QTreeWidget* tree) {
+ tree->setSortingEnabled(false);
+
+ /* 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,
+- "/usr/bin/lspci -v", true)))
+- return num;
++ QStringList lspci;
++ lspci << "lspci" << "/sbin/lspci" << "/usr/sbin/lspci" << "/usr/local/sbin/lspci" << "/usr/bin/lspci";
++ QString p;
++ foreach(p, lspci)
++ if (num = GetInfo_ReadfromPipe(tree, p, QStringList() << "-v", true))
++ return num;
+
+ /* if lspci failed, read the contents of /proc/pci */
+ 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
+@@ -330,12 +330,12 @@ static bool GetInfo_XServer_Generic(QTre
+ }
+
+ /* 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 QString &program, const QStringList &arguments, bool WithEmptyLines = true) {
+ QProcess proc;
+ QTreeWidgetItem* olditem= NULL;
+ QString s;
+
+- proc.start(FileName, QIODevice::ReadOnly);
++ proc.start(program, arguments, QIODevice::ReadOnly);
+ if (!proc.waitForFinished()) {
+ // Process hanged or did not start
+ 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} )
+
diff --git a/x11/kde-workspace-kde4/files/patch-kinfocenter_Modules_pci_kpci.cpp b/x11/kde-workspace-kde4/files/patch-kinfocenter_Modules_pci_kpci.cpp
new file mode 100644
index 000000000000..10b57e9feccf
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kinfocenter_Modules_pci_kpci.cpp
@@ -0,0 +1,56 @@
+* Obey user's unit preferences when displaying PCI info.
+* Use correct units, someone forgot about terabytes
+*
+--- kinfocenter/Modules/pci/kpci.cpp.orig 2015-06-26 03:17:21 UTC
++++ kinfocenter/Modules/pci/kpci.cpp
+@@ -22,6 +22,8 @@ extern "C" {
+ #include <QTreeWidget>
+ #include <QTreeWidgetItem>
+ #include <QFile>
++#include <kglobal.h>
++#include <klocale.h>
+
+ static const QString& getNameById(const id2name *const table, int id) {
+ for (int i=0;; i++) {
+@@ -238,31 +240,35 @@ static QTreeWidgetItem* addBist(QTreeWid
+ }//addBist
+
+ static QTreeWidgetItem* addSize(QTreeWidgetItem *parent, QTreeWidgetItem *after, pciaddr_t size) {
++ static bool realUnits = (KGlobal::locale()->binaryUnitDialect() == KLocale::JEDECBinaryDialect);
+ if (size<0x400) {
+ after=create(parent, i18n("Size"), QString("%1 B").arg(static_cast<unsigned long>(size)));
+ }//if
+ else if (size<0x100000) {
+- after=create(parent, i18n("Size"), QString("%1 kiB").arg(static_cast<unsigned long>(size/0x400)));
++ after=create(parent, i18n("Size"), QString(realUnits ? "%1 KB" : "%1 KiB").arg(static_cast<unsigned long>(size/0x400)));
+ }//elif
+ else if (size<0x40000000) {
+- after=create(parent, i18n("Size"), QString("%1 MiB").arg(static_cast<unsigned long>(size/0x100000)));
++ after=create(parent, i18n("Size"), QString(realUnits ? "%1 MB" : "%1 MiB").arg(static_cast<unsigned long>(size/0x100000)));
+ }//elif
+
+ #ifdef HAVE_PCIADDR_T64
+
+ else if (size<0x10000000000LL) {
+- after=create(parent, i18n("Size"),QString("%1 GiB").arg(static_cast<unsigned long>(size/0x40000000)));
++ after=create(parent, i18n("Size"),QString(realUnits ? "%1 GB" : "%1 GiB").arg(static_cast<unsigned long>(size/0x40000000)));
+ }//elif
+ else if (size<0x4000000000000LL) {
+- after=create(parent, i18n("Size"),QString("%1 PiB").arg(static_cast<unsigned long>(size/0x10000000000LL)));
++ after=create(parent, i18n("Size"),QString(realUnits ? "%1 TB" : "%1 TiB").arg(static_cast<unsigned long>(size/0x10000000000LL)));
+ }//elif
+ else if (size<0x1000000000000000LL) {
+- after=create(parent, i18n("Size"),QString("%1 EiB").arg(static_cast<unsigned long>(size/0x4000000000000LL)));
++ after=create(parent, i18n("Size"),QString(realUnits ? "%1 PB" : "%1 PiB").arg(static_cast<unsigned long>(size/0x4000000000000LL)));
+ }//elif
++ else {
++ after=create(parent, i18n("Size"),QString(realUnits ? "%1 EB" : "%1 EiB").arg(static_cast<unsigned long>(size/0x1000000000000000LL)));
++ }//else
+
+ #else //HAVE_PCIADDR_T64
+ else {
+- after=create(parent, i18n("Size"), QString("%1 GiB").arg(static_cast<unsigned long>(size/0x40000000)));
++ after=create(parent, i18n("Size"), QString(realUnits ? "%1 GB" : "%1 GiB").arg(static_cast<unsigned long>(size/0x40000000)));
+ }//else
+
+ #endif //HAVE_PCIADDR_T64
diff --git a/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.cpp b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.cpp
new file mode 100644
index 000000000000..72d181a797e2
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.cpp
@@ -0,0 +1,306 @@
+* Fix the unit handling in KSysGuard's Plotter to respect user's unit preferences
+*
+* Improve the handling of labels so the display is nicer when horizontally constrained
+*
+* Use reasonable units for the Plotter's tooltip (used to be unscaled)
+*
+* Allow a stored description for sensors to override the label
+*
+--- ksysguard/gui/SensorDisplayLib/FancyPlotter.cpp.orig 2015-06-26 03:17:21 UTC
++++ ksysguard/gui/SensorDisplayLib/FancyPlotter.cpp
+@@ -48,6 +48,7 @@ class SensorToAdd {
+ QRegExp name;
+ QString hostname;
+ QString type;
++ QString description;
+ QList<QColor> colors;
+ QString summationName;
+ };
+@@ -58,13 +59,15 @@ class FancyPlotterLabel : public QLabel
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ longHeadingWidth = 0;
+ shortHeadingWidth = 0;
++ minHeadingWidth = 0;
+ textMargin = 0;
+ setLayoutDirection(Qt::LeftToRight); //We do this because we organise the strings ourselves.. is this going to muck it up though for RTL languages?
+ }
+ ~FancyPlotterLabel() {
+ }
+ void setLabel(const QString &name, const QColor &color) {
+- labelName = name;
++ labelLongName = name;
++ labelShortName = name.split(QChar(' ')).first();
+
+ if(indicatorSymbol.isNull()) {
+ if(fontMetrics().inFont(QChar(0x25CF)))
+@@ -73,7 +76,6 @@ class FancyPlotterLabel : public QLabel
+ indicatorSymbol = '#';
+ }
+ changeLabel(color);
+-
+ }
+ void setValueText(const QString &value) {
+ //value can have multiple strings, separated with the 0x9c character
+@@ -87,63 +89,72 @@ class FancyPlotterLabel : public QLabel
+ if(valueText.isEmpty()) {
+ if(longHeadingWidth < width())
+ setText(longHeadingText);
+- else
++ else if(shortHeadingWidth < width())
+ setText(shortHeadingText);
++ else
++ setText(minHeadingText);
+ return;
+ }
+- QString value = valueText.first();
+
+- int textWidth = fm.boundingRect(value).width();
+- if(textWidth + longHeadingWidth < width())
+- setBothText(longHeadingText, value);
+- else if(textWidth + shortHeadingWidth < width())
+- setBothText(shortHeadingText, value);
+- else {
+- int valueTextCount = valueText.count();
+- int i;
+- for(i = 1; i < valueTextCount; ++i) {
+- textWidth = fm.boundingRect(valueText.at(i)).width();
+- if(textWidth + shortHeadingWidth <= width()) {
+- break;
+- }
++ int i, textWidth, valueTextCount = valueText.count();
++ for(i = 0; i < valueTextCount; ++i) {
++ textWidth = fm.boundingRect(valueText.at(i)).width();
++ if(textWidth + longHeadingWidth <= width()) {
++ setBothText(longHeadingText, valueText.at(i));
++ return;
+ }
+- if(i < valueTextCount)
++ if(textWidth + shortHeadingWidth <= width()) {
+ setBothText(shortHeadingText, valueText.at(i));
+- else
+- setText(noHeadingText + valueText.last()); //This just sets the color of the text
++ return;
++ }
+ }
++ for(i = 0; i < valueTextCount; ++i) {
++ textWidth = fm.boundingRect(valueText.at(i)).width();
++ if(textWidth + minHeadingWidth <= width()) {
++ setBothText(minHeadingText, valueText.at(i));
++ return;
++ }
++ }
++ setBothText(noHeadingText, valueText.last()); //This just sets the color of the text
+ }
+ void changeLabel(const QColor &_color) {
+ color = _color;
+
+- if ( kapp->layoutDirection() == Qt::RightToLeft )
+- longHeadingText = QString(": ") + labelName + " <font color=\"" + color.name() + "\">" + indicatorSymbol + "</font>";
+- else
+- longHeadingText = QString("<qt><font color=\"") + color.name() + "\">" + indicatorSymbol + "</font> " + labelName + " :";
+- shortHeadingText = QString("<qt><font color=\"") + color.name() + "\">" + indicatorSymbol + "</font>";
++ if ( kapp->layoutDirection() == Qt::RightToLeft ) {
++ longHeadingText = QString(" : ") + labelLongName + " <font color=\"" + color.name() + "\">" + indicatorSymbol + "</font>";
++ shortHeadingText = QString(" :") + labelShortName + " <font color=\"" + color.name() + "\">" + indicatorSymbol + "</font>";
++ } else {
++ longHeadingText = QString("<qt><font color=\"") + color.name() + "\">" + indicatorSymbol + "</font> " + labelLongName + " : ";
++ shortHeadingText = QString("<qt><font color=\"") + color.name() + "\">" + indicatorSymbol + "</font> " + labelShortName + ": ";
++ }
++ minHeadingText = QString("<qt><font color=\"") + color.name() + "\">" + indicatorSymbol + "</font> ";
+ noHeadingText = QString("<qt><font color=\"") + color.name() + "\">";
+
+- textMargin = fontMetrics().width('x') + margin()*2 + frameWidth()*2;
+- longHeadingWidth = fontMetrics().boundingRect(labelName + " :" + indicatorSymbol + " x").width() + textMargin;
+- shortHeadingWidth = fontMetrics().boundingRect(indicatorSymbol).width() + textMargin;
+- setMinimumWidth(shortHeadingWidth);
++ textMargin = margin()*2 + frameWidth()*2;
++ longHeadingWidth = fontMetrics().boundingRect(labelLongName + " : " + indicatorSymbol + " x").width() + textMargin;
++ shortHeadingWidth = fontMetrics().boundingRect(labelShortName + ": " + indicatorSymbol + " x").width() + textMargin;
++ minHeadingWidth = fontMetrics().boundingRect(indicatorSymbol + " x").width() + textMargin;
++ setMinimumWidth(minHeadingWidth);
+ update();
+ }
+ private:
+ void setBothText(const QString &heading, const QString & value) {
+ if(QApplication::layoutDirection() == Qt::LeftToRight)
+- setText(heading + ' ' + value);
++ setText(heading + value);
+ else
+- setText("<qt>" + value + ' ' + heading);
++ setText("<qt>" + value + heading);
+ }
+ int textMargin;
+ QString longHeadingText;
+ QString shortHeadingText;
++ QString minHeadingText;
+ QString noHeadingText;
+ int longHeadingWidth;
+ int shortHeadingWidth;
++ int minHeadingWidth;
+ QList<QString> valueText;
+- QString labelName;
++ QString labelLongName;
++ QString labelShortName;
+ QColor color;
+ static QChar indicatorSymbol;
+ };
+@@ -162,6 +173,7 @@ FancyPlotter::FancyPlotter( QWidget* par
+ mUseManualRange = false;
+ mNumAnswers = 0;
+ mLabelsWidget = NULL;
++ mRealUnits = (KGlobal::locale()->binaryUnitDialect() == KLocale::JEDECBinaryDialect);
+
+ //The unicode character 0x25CF is a big filled in circle. We would prefer to use this in the tooltip.
+ //However it's maybe possible that the font used to draw the tooltip won't have it. So we fall back to a
+@@ -510,10 +522,17 @@ void FancyPlotter::setTooltip()
+
+ if(sensor->isOk()) {
+ lastValue = KGlobal::locale()->formatNumber( sensor->lastValue, (sensor->isInteger)?0:-1 );
+- if (sensor->unit() == "%")
++ if (sensor->unit() == "%") {
+ lastValue = i18nc("units", "%1%", lastValue);
+- else if( !sensor->unit().isEmpty() )
+- lastValue = i18nc("units", QString(QString("%1 ") + sensor->unit()).toUtf8(), lastValue);
++ } else if( !sensor->unit().isEmpty() ) {
++ qreal scale = (mPlotter->scaleDownBy() == 1) ? 1 : (sensor->lastValue / mPlotter->scaleDownBy() < 0.1) ? (mPlotter->scaleDownBy() / 1024) : mPlotter->scaleDownBy();
++ if(scale > 1) {
++ QString unit = (scale == 1024) ? (sensor->unit()).replace("K","M") : (scale == 1024*1024) ? (sensor->unit()).replace("K","G") : (sensor->unit()).replace("K","T");
++ lastValue = i18nc("units", QString(QString("%1 ") + unit).toUtf8(), KGlobal::locale()->formatNumber( sensor->lastValue / scale ));
++ } else {
++ lastValue = i18nc("units", QString(QString("%1 ") + sensor->unit()).toUtf8(), lastValue);
++ }
++ }
+ } else {
+ lastValue = i18n("Error");
+ }
+@@ -615,33 +634,33 @@ void FancyPlotter::plotterAxisScaleChang
+ disconnect(mPlotter, SIGNAL(axisScaleChanged()), this, SLOT(plotterAxisScaleChanged()));
+ KLocalizedString unit;
+ double value = mPlotter->currentMaximumRangeValue();
+- if(mUnit == "KiB") {
+- if(value >= 1024*1024*1024*0.7) { //If it's over 0.7TiB, then set the scale to terabytes
++ if(mUnit == "KB" || mUnit == "KiB") {
++ if(value >= 1024*1024*1024) {
+ mPlotter->setScaleDownBy(1024*1024*1024);
+- unit = ki18nc("units", "%1 TiB"); // the unit - terabytes
+- } else if(value >= 1024*1024*0.7) { //If it's over 0.7GiB, then set the scale to gigabytes
++ unit = ki18nc("units", mRealUnits ? "%1 TB" : "%1 TiB"); // the unit - terabytes
++ } else if(value >= 1024*1024) {
+ mPlotter->setScaleDownBy(1024*1024);
+- unit = ki18nc("units", "%1 GiB"); // the unit - gigabytes
++ unit = ki18nc("units", mRealUnits ? "%1 GB" : "%1 GiB"); // the unit - gigabytes
+ } else if(value > 1024) {
+ mPlotter->setScaleDownBy(1024);
+- unit = ki18nc("units", "%1 MiB"); // the unit - megabytes
++ unit = ki18nc("units", mRealUnits ? "%1 MB" : "%1 MiB"); // the unit - megabytes
+ } else {
+ mPlotter->setScaleDownBy(1);
+- unit = ki18nc("units", "%1 KiB"); // the unit - kilobytes
++ unit = ki18nc("units", mRealUnits ? "%1 KB" : "%1 KiB"); // the unit - kilobytes
+ }
+- } else if(mUnit == "KiB/s") {
+- if(value >= 1024*1024*1024*0.7) { //If it's over 0.7TiB, then set the scale to terabytes
++ } else if(mUnit == "KB/s" || mUnit == "KiB/s") {
++ if(value >= 1024*1024*1024) {
+ mPlotter->setScaleDownBy(1024*1024*1024);
+- unit = ki18nc("units", "%1 TiB/s"); // the unit - terabytes per second
+- } else if(value >= 1024*1024*0.7) { //If it's over 0.7GiB, then set the scale to gigabytes
++ unit = ki18nc("units", mRealUnits ? "%1 TB/s" : "%1 TiB/s"); // the unit - terabytes per second
++ } else if(value >= 1024*1024) {
+ mPlotter->setScaleDownBy(1024*1024);
+- unit = ki18nc("units", "%1 GiB/s"); // the unit - gigabytes per second
++ unit = ki18nc("units", mRealUnits ? "%1 GB/s" : "%1 GiB/s"); // the unit - gigabytes per second
+ } else if(value > 1024) {
+ mPlotter->setScaleDownBy(1024);
+- unit = ki18nc("units", "%1 MiB/s"); // the unit - megabytes per second
++ unit = ki18nc("units", mRealUnits ? "%1 MB/s" : "%1 MiB/s"); // the unit - megabytes per second
+ } else {
+ mPlotter->setScaleDownBy(1);
+- unit = ki18nc("units", "%1 KiB/s"); // the unit - kilobytes per second
++ unit = ki18nc("units", mRealUnits ? "%1 KB/s" : "%1 KiB/s"); // the unit - kilobytes per second
+ }
+ } else if(mUnit == "%") {
+ mPlotter->setScaleDownBy(1);
+@@ -694,9 +713,9 @@ void FancyPlotter::answerReceived( int i
+ KSGRD::SensorFloatInfo info( answer );
+ QString unit = info.unit();
+ if(unit.toUpper() == "KB" || unit.toUpper() == "KIB")
+- unit = "KiB";
++ unit = mRealUnits ? "KB" : "KiB";
+ if(unit.toUpper() == "KB/S" || unit.toUpper() == "KIB/S")
+- unit = "KiB/s";
++ unit = mRealUnits ? "KB/s" : "KiB/s";
+
+ if(id == 100) //if we are the first sensor, just use that sensors units as the global unit
+ mUnit = unit;
+@@ -714,7 +733,8 @@ void FancyPlotter::answerReceived( int i
+ sensor->maxValue = info.max();
+ sensor->minValue = info.min();
+ sensor->setUnit( unit );
+- sensor->setDescription( info.name() );
++ if(sensor->description().isEmpty())
++ sensor->setDescription( info.name() );
+
+ QString summationName = sensor->summationName;
+ int beamId = sensor->beamId;
+@@ -723,7 +743,7 @@ void FancyPlotter::answerReceived( int i
+ Q_ASSERT(beamId < mLabelLayout->count());
+
+ if(summationName.isEmpty())
+- static_cast<FancyPlotterLabel *>((static_cast<QWidgetItem *>(mLabelLayout->itemAt(beamId)))->widget())->setLabel(info.name(), mPlotter->beamColor(beamId));
++ static_cast<FancyPlotterLabel *>((static_cast<QWidgetItem *>(mLabelLayout->itemAt(beamId)))->widget())->setLabel(sensor->description(), mPlotter->beamColor(beamId));
+
+ } else if( id == 200) {
+ /* FIXME This doesn't check the host! */
+@@ -743,8 +763,8 @@ void FancyPlotter::answerReceived( int i
+ else if(KSGRD::Style->numSensorColors() != 0)
+ color = KSGRD::Style->sensorColor( beamId % KSGRD::Style->numSensorColors());
+ addSensor( sensor->hostname, sensorName,
+- (sensor->type.isEmpty()) ? "float" : sensor->type
+- , "", color, sensor->name.pattern(), beamId, sensor->summationName);
++ (sensor->type.isEmpty()) ? "float" : sensor->type,
++ sensor->description, color, sensor->name.pattern(), beamId, sensor->summationName);
+ }
+ }
+ }
+@@ -823,7 +843,7 @@ bool FancyPlotter::restoreSettings( QDom
+ } else
+ addSensor( el.attribute( "hostName" ), el.attribute( "sensorName" ),
+ ( el.attribute( "sensorType" ).isEmpty() ? "float" :
+- el.attribute( "sensorType" ) ), "", restoreColor( el, "color",
++ el.attribute( "sensorType" ) ), el.attribute( "description" ), restoreColor( el, "color",
+ KSGRD::Style->sensorColor( i ) ), QString(), mBeams, el.attribute("summationName") );
+ }
+
+@@ -873,16 +893,18 @@ bool FancyPlotter::saveSettings( QDomDoc
+ } else {
+ QDomElement beam = doc.createElement( "beam" );
+ element.appendChild( beam );
++ beam.setAttribute( "sensorType", sensor->type() );
+ beam.setAttribute( "hostName", sensor->hostName() );
+- if(regExpName.isEmpty())
++ if(regExpName.isEmpty()) {
+ beam.setAttribute( "sensorName", sensor->name() );
+- else {
++ if(sensor->hasDescription)
++ beam.setAttribute( "description", sensor->description() );
++ } else {
+ beam.setAttribute( "regexpSensorName", sensor->regExpName() );
+ hash[regExpName] = beam;
++ if(!sensor->summationName.isEmpty())
++ beam.setAttribute( "summationName", sensor->summationName);
+ }
+- if(!sensor->summationName.isEmpty())
+- beam.setAttribute( "summationName", sensor->summationName);
+- beam.setAttribute( "sensorType", sensor->type() );
+ saveColor( beam, "color", mPlotter->beamColor( beamId ) );
+ }
+ }
+@@ -918,6 +940,7 @@ FPSensorProperties::FPSensorProperties(
+ minValue = 0;
+ lastValue = 0;
+ isInteger = (type == "integer");
++ hasDescription = !description.isEmpty();
+ }
+
+ FPSensorProperties::~FPSensorProperties()
diff --git a/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.h b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.h
new file mode 100644
index 000000000000..e81bcb039dc1
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SensorDisplayLib_FancyPlotter.h
@@ -0,0 +1,29 @@
+* Add a couple variables for the additional functionality in FancyPlotter.cpp
+*
+--- ksysguard/gui/SensorDisplayLib/FancyPlotter.h.orig 2015-06-26 03:17:21 UTC
++++ ksysguard/gui/SensorDisplayLib/FancyPlotter.h
+@@ -52,6 +52,7 @@ class FPSensorProperties : public KSGRD:
+ double minValue;
+ double lastValue;
+ bool isInteger;
++ bool hasDescription;
+
+ private:
+ QColor mColor;
+@@ -104,7 +105,7 @@ class FancyPlotter : public KSGRD::Senso
+ private:
+ void sendDataToPlotter();
+ uint mBeams;
+-
++
+ int mNumAnswers;
+ /** When we talk to the sensor, it tells us a range. Record the max here. equals 0 until we have an answer from it */
+ double mSensorReportedMax;
+@@ -131,6 +132,7 @@ class FancyPlotter : public KSGRD::Senso
+ QLabel *mHeading;
+
+ QString mUnit;
++ bool mRealUnits;
+
+ QList<SensorToAdd *> mSensorsToAdd;
+ QBoxLayout *mLabelLayout;
diff --git a/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SystemLoad2.sgrd b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SystemLoad2.sgrd
new file mode 100644
index 000000000000..07b0f46205f7
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_SystemLoad2.sgrd
@@ -0,0 +1,24 @@
+* Provide a detailed view of Memory and Swap Used instead of the simplistic and
+* misleading view that showed only application use (kernel use was neglected)
+*
+--- ksysguard/gui/SystemLoad2.sgrd.orig 2015-06-26 03:17:21 UTC
++++ ksysguard/gui/SystemLoad2.sgrd
+@@ -3,11 +3,14 @@
+ <WorkSheet title="System Load" interval="0.5" locked="1" rows="3" columns="1" >
+ <host port="-1" command="ksysguardd" shell="" name="localhost" />
+ <display title="CPU History" svgBackground="widgets/plot-background" autoRange="0" class="FancyPlotter" column="0" row="0" version="1">
+- <beam sensorType="float" hostName="localhost" regexpSensorName="cpu/cpu.*/TotalLoad" color="0xffff8000,0xffe20800" />
++ <beam sensorType="float" hostName="localhost" regexpSensorName="cpu/cpu.*/TotalLoad" />
+ </display>
+- <display title="Memory and Swap History" svgBackground="widgets/plot-background" autoRange="0" class="FancyPlotter" column="0" row="1" version="1" >
+- <beam summationName="Memory" sensorName="mem/physical/application" sensorType="integer" hostName="localhost" color="0xffc000c0" />
+- <beam summationName="Swap" sensorName="mem/swap/used" sensorType="integer" hostName="localhost" color="0xff00c000" />
++ <display title="Memory and Swap History" svgBackground="widgets/plot-background" autoRange="1" class="FancyPlotter" column="0" row="1" version="1" stacked="1">
++ <beam sensorType="integer" hostName="localhost" sensorName="mem/physical/wired" color="0xffc00000" />
++ <beam sensorType="integer" hostName="localhost" sensorName="mem/physical/inactive" color="0xffc0c000" />
++ <beam sensorType="integer" hostName="localhost" sensorName="mem/physical/active" color="0xff0000c0" />
++ <beam sensorType="integer" hostName="localhost" sensorName="mem/physical/free" color="0xff00c000" />
++ <beam sensorType="integer" hostName="localhost" sensorName="mem/swap/used" description="Swap Used" color="0xffc000c0" />
+ </display>
+ <display title="Network History" svgBackground="widgets/plot-background" autoRange="1" class="FancyPlotter" column="0" row="2" version="1" min="0" max="20" manualRange="1">
+ <beam sensorType="float" hostName="localhost" summationName="Receiving" regexpSensorName="network/interfaces/(?!lo|bridge|usbus|bond).*/receiver/data" color="0xB3A52D" />
diff --git a/x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.cpp b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.cpp
new file mode 100644
index 000000000000..071689cb5fcc
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.cpp
@@ -0,0 +1,73 @@
+* More detailed Memory stats in the KSysGuard's Status Bar
+*
+* Make the the Status Bar elements reasonably proportional in size
+*
+--- ksysguard/gui/ksysguard.cpp.orig 2015-06-26 03:17:21 UTC
++++ ksysguard/gui/ksysguard.cpp
+@@ -93,19 +93,21 @@ TopLevel::TopLevel()
+ /* Create the status bar. It displays some information about the
+ * number of processes and the memory consumption of the local
+ * host. */
+- const int STATUSBAR_STRETCH=1;
+-
+ sbProcessCount = new QLabel();
+- statusBar()->addWidget( sbProcessCount, STATUSBAR_STRETCH );
++ sbProcessCount->setAlignment( Qt::AlignHCenter );
++ statusBar()->addWidget( sbProcessCount, 3 ); // 1 long label + 1 value = 3
+
+ sbCpuStat = new QLabel();
+- statusBar()->addWidget( sbCpuStat, STATUSBAR_STRETCH );
++ sbCpuStat->setAlignment( Qt::AlignHCenter );
++ statusBar()->addWidget( sbCpuStat, 2 ); // 1 short label + 1 value = 2
+
+ sbMemTotal = new QLabel();
+- statusBar()->addWidget( sbMemTotal, STATUSBAR_STRETCH );
++ sbMemTotal->setAlignment( Qt::AlignHCenter );
++ statusBar()->addWidget( sbMemTotal, 5 ); // 1 label + 4 values = 5
+
+ sbSwapTotal = new QLabel();
+- statusBar()->addWidget( sbSwapTotal, STATUSBAR_STRETCH );
++ sbSwapTotal->setAlignment( Qt::AlignHCenter );
++ statusBar()->addWidget( sbSwapTotal, 3 ); // 1 label + 2 values = 3
+
+ statusBar()->hide();
+
+@@ -453,11 +455,7 @@ void TopLevel::answerReceived( int id, c
+
+ case 4:
+ mUsedApplication = answer.toLongLong();
+- //Use a multi-length string
+- s = i18nc( "Arguments are formatted byte sizes (used/total)", "Memory: %1 / %2" "\xc2\x9c" "Mem: %1 / %2" "\xc2\x9c" "Mem: %1" "\xc2\x9c" "%1",
+- KGlobal::locale()->formatByteSize( mUsedApplication*1024),
+- KGlobal::locale()->formatByteSize( (mFree+mUsedTotal)*1024 ) );
+- sbMemTotal->setText( s );
++ setMemInfo( mUsedApplication, mUsedTotal, mFree, unit );
+ break;
+
+ case 5:
+@@ -477,6 +475,17 @@ void TopLevel::answerReceived( int id, c
+ }
+ }
+
++void TopLevel::setMemInfo(qlonglong usedapps, qlonglong usedtotal, qlonglong free, const QString & )
++{
++ QString msg;
++ msg = i18nc( "Arguments are formatted byte sizes (used/total)", "Memory: (K %4 + U %3) %1 / %2" "\xc2\x9c" "Memory: (U %3) %1 / %2" "\xc2\x9c" "Memory: %1 / %2" "\xc2\x9c" "Mem: %1 / %2" "\xc2\x9c" "Mem: %1" "\xc2\x9c" "%1",
++ KGlobal::locale()->formatByteSize( usedtotal*1024 ),
++ KGlobal::locale()->formatByteSize( (free+usedtotal)*1024 ),
++ KGlobal::locale()->formatByteSize( usedapps*1024 ),
++ KGlobal::locale()->formatByteSize( (usedtotal-usedapps)*1024 ) );
++ sbMemTotal->setText( msg );
++}
++
+ void TopLevel::setSwapInfo( qlonglong used, qlonglong free, const QString & )
+ {
+ QString msg;
+@@ -487,7 +496,6 @@ void TopLevel::setSwapInfo( qlonglong us
+ KGlobal::locale()->formatByteSize( used*1024 ),
+ KGlobal::locale()->formatByteSize( (free+used)*1024) );
+ }
+-
+ sbSwapTotal->setText( msg );
+ }
+
diff --git a/x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.h b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.h
new file mode 100644
index 000000000000..8afa4d9b3225
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-ksysguard_gui_ksysguard.h
@@ -0,0 +1,12 @@
+* Add the detailed setMemInfo used in ksysguard.cpp
+*
+--- ksysguard/gui/ksysguard.h.orig 2015-06-26 03:17:21 UTC
++++ ksysguard/gui/ksysguard.h
+@@ -77,6 +77,7 @@ class TopLevel : public KXmlGuiWindow, p
+ void configureCurrentSheet();
+
+ private:
++ void setMemInfo( qlonglong, qlonglong, qlonglong, const QString& );
+ void setSwapInfo( qlonglong, qlonglong, const QString& );
+ void changeEvent( QEvent * event );
+ void retranslateUi();
diff --git a/x11/kde-workspace-kde4/files/patch-kwin_effects_blur_blur.cpp b/x11/kde-workspace-kde4/files/patch-kwin_effects_blur_blur.cpp
new file mode 100644
index 000000000000..f41d9a184da9
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kwin_effects_blur_blur.cpp
@@ -0,0 +1,13 @@
+Fix ambiguous call on armv6.
+
+--- kwin/effects/blur/blur.cpp.orig 2017-01-11 16:01:39 UTC
++++ kwin/effects/blur/blur.cpp
+@@ -387,7 +387,7 @@ bool BlurEffect::shouldBlur(const Effect
+ if (w->isDesktop())
+ return false;
+
+- bool scaled = !qFuzzyCompare(data.xScale(), 1.0) && !qFuzzyCompare(data.yScale(), 1.0);
++ bool scaled = !qFuzzyCompare(data.xScale(), qreal(1.0)) && !qFuzzyCompare(data.yScale(), qreal(1.0));
+ bool translated = data.xTranslation() || data.yTranslation();
+
+ if (scaled || ((translated || (mask & PAINT_WINDOW_TRANSFORMED)) && !w->data(WindowForceBlurRole).toBool()))
diff --git a/x11/kde-workspace-kde4/files/patch-kwin_opengltest_CMakeLists.txt b/x11/kde-workspace-kde4/files/patch-kwin_opengltest_CMakeLists.txt
new file mode 100644
index 000000000000..f9d589472c79
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kwin_opengltest_CMakeLists.txt
@@ -0,0 +1,15 @@
+--- kwin/opengltest/CMakeLists.txt.orig 2015-06-26 03:17:21 UTC
++++ kwin/opengltest/CMakeLists.txt
+@@ -2,9 +2,11 @@
+
+ set(kwin_opengl_test_SRCS opengltest.cpp )
+
++find_package(Threads)
++
+ kde4_add_executable(kwin_opengl_test ${kwin_opengl_test_SRCS})
+
+-target_link_libraries(kwin_opengl_test ${X11_LIBRARIES} ${OPENGL_gl_LIBRARY})
++target_link_libraries(kwin_opengl_test ${X11_LIBRARIES} ${OPENGL_gl_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
+
+ install(TARGETS kwin_opengl_test DESTINATION ${LIBEXEC_INSTALL_DIR} )
+
diff --git a/x11/kde-workspace-kde4/files/patch-kwin_scene__xrender.cpp b/x11/kde-workspace-kde4/files/patch-kwin_scene__xrender.cpp
new file mode 100644
index 000000000000..6132b4a9e04f
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-kwin_scene__xrender.cpp
@@ -0,0 +1,22 @@
+Fix ambiguous call on armv6.
+
+--- kwin/scene_xrender.cpp.orig 2017-01-11 16:04:04 UTC
++++ kwin/scene_xrender.cpp
+@@ -392,7 +392,7 @@ void SceneXrender::Window::performPaint(
+ {
+ setTransformedShape(QRegion()); // maybe nothing will be painted
+ // check if there is something to paint
+- bool opaque = isOpaque() && qFuzzyCompare(data.opacity(), 1.0);
++ bool opaque = isOpaque() && qFuzzyCompare(data.opacity(), qreal(1.0));
+ /* HACK: It seems this causes painting glitches, disable temporarily
+ if (( mask & PAINT_WINDOW_OPAQUE ) ^ ( mask & PAINT_WINDOW_TRANSLUCENT ))
+ { // We are only painting either opaque OR translucent windows, not both
+@@ -469,7 +469,7 @@ void SceneXrender::Window::performPaint(
+ xscale *= screen_paint.xScale();
+ yscale *= screen_paint.yScale();
+ }
+- if (!qFuzzyCompare(xscale, 1.0) || !qFuzzyCompare(yscale, 1.0)) {
++ if (!qFuzzyCompare(xscale, qreal(1.0)) || !qFuzzyCompare(yscale, qreal(1.0))) {
+ scaled = true;
+ xform.matrix11 = DOUBLE_TO_FIXED(1.0 / xscale);
+ xform.matrix22 = DOUBLE_TO_FIXED(1.0 / yscale);
diff --git a/x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.cpp b/x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.cpp
new file mode 100644
index 000000000000..9c761bd9aff2
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.cpp
@@ -0,0 +1,25 @@
+* Hide the desktop toolbox (aka "cashew") when widgets are locked
+*
+--- plasma/desktop/toolboxes/desktoptoolbox.cpp.orig 2015-06-26 03:17:21 UTC
++++ plasma/desktop/toolboxes/desktoptoolbox.cpp
+@@ -177,6 +177,8 @@ void DesktopToolBox::init()
+ connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()),
+ this, SLOT(updateTheming()));
+ Plasma::ToolTipManager::self()->registerWidget(this);
++ QObject::connect(m_containment, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)),
++ this, SLOT(immutabilityChanged(Plasma::ImmutabilityType)));
+
+ if (KAuthorized::authorizeKAction("logout")) {
+ QAction *action = new QAction(i18n("Leave..."), this);
+@@ -761,6 +763,11 @@ void DesktopToolBox::toggle()
+ setShowing(!isShowing());
+ }
+
++void DesktopToolBox::immutabilityChanged(Plasma::ImmutabilityType immutability)
++{
++ setVisible(immutability == Plasma::Mutable);
++}
++
+ void DesktopToolBox::adjustBackgroundBorders() const
+ {
+ Plasma::FrameSvg *background = const_cast<Plasma::FrameSvg *>(m_background);
diff --git a/x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.h b/x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.h
new file mode 100644
index 000000000000..07e35d50d86d
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-plasma_desktop_toolboxes_desktoptoolbox.h
@@ -0,0 +1,12 @@
+* Add handler for change of mutability of the desktop toolbox
+*
+--- plasma/desktop/toolboxes/desktoptoolbox.h.orig 2015-06-26 03:17:21 UTC
++++ plasma/desktop/toolboxes/desktoptoolbox.h
+@@ -81,6 +81,7 @@ protected Q_SLOTS:
+ * show/hide the toolbox
+ */
+ void toggle();
++ void immutabilityChanged(Plasma::ImmutabilityType immutability);
+
+ // basic desktop controls
+ void startLogout();
diff --git a/x11/kde-workspace-kde4/files/patch-plasma_generic_applets_systemtray_CMakeLists.txt b/x11/kde-workspace-kde4/files/patch-plasma_generic_applets_systemtray_CMakeLists.txt
new file mode 100644
index 000000000000..afb71b25bfe4
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-plasma_generic_applets_systemtray_CMakeLists.txt
@@ -0,0 +1,16 @@
+Link to the full library as detected by CMake, so that the linker is passed
+"/full/path/to/libXss.so" instead of "-lXss", which can fail if -L/full/path/to
+is not passed as well.
+
+Not upstreamed because upstream is no longer releasing kde-workspace.
+--- plasma/generic/applets/systemtray/CMakeLists.txt
++++ plasma/generic/applets/systemtray/CMakeLists.txt
+@@ -43,7 +43,7 @@ include (CheckLibraryExists)
+ check_library_exists (Xss XScreenSaverQueryInfo "" HAVE_LIBXSS)
+ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+ IF (HAVE_LIBXSS)
+- SET (IDLE_DETECTION_LIB "Xss")
++ SET (IDLE_DETECTION_LIB ${X11_Xscreensaver_LIB})
+ ENDIF (HAVE_LIBXSS)
+
+ kde4_add_plugin(plasma_applet_systemtray ${systemtray_SRCS})
diff --git a/x11/kde-workspace-kde4/files/patch-powerdevil_daemon_backends_upower_xrandrbrightness.cpp b/x11/kde-workspace-kde4/files/patch-powerdevil_daemon_backends_upower_xrandrbrightness.cpp
new file mode 100644
index 000000000000..53fa3cbebf8e
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-powerdevil_daemon_backends_upower_xrandrbrightness.cpp
@@ -0,0 +1,21 @@
+--- powerdevil/daemon/backends/upower/xrandrbrightness.cpp.orig 2015-06-26 03:17:21 UTC
++++ powerdevil/daemon/backends/upower/xrandrbrightness.cpp
+@@ -62,6 +62,9 @@ XRandrBrightness::XRandrBrightness()
+ qWarning("No available Randr resources");
+ return;
+ }
++
++ if (brightness() == -1)
++ m_resources = 0;
+ }
+
+ XRandrBrightness::~XRandrBrightness()
+@@ -89,7 +92,7 @@ bool XRandrBrightness::isSupported() con
+
+ float XRandrBrightness::brightness() const
+ {
+- float result = 0;
++ float result = -1;
+
+ if (!m_resources)
+ return result;
diff --git a/x11/kde-workspace-kde4/files/patch-startkde.cmake b/x11/kde-workspace-kde4/files/patch-startkde.cmake
new file mode 100644
index 000000000000..e322d8a68db9
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-startkde.cmake
@@ -0,0 +1,12 @@
+--- startkde.cmake.orig 2015-06-26 03:17:21 UTC
++++ startkde.cmake
+@@ -271,7 +271,8 @@ export XDG_DATA_DIRS
+ # Make sure that D-Bus is running
+ # D-Bus autolaunch is broken
+ if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
+- eval `dbus-launch --sh-syntax --exit-with-session`
++ uuid="`dbus-uuidgen --get`"
++ eval `dbus-launch --sh-syntax --exit-with-session --autolaunch $uuid`
+ fi
+ if $qdbus >/dev/null 2>/dev/null; then
+ : # ok
diff --git a/x11/kde-workspace-kde4/files/patch-usbview b/x11/kde-workspace-kde4/files/patch-usbview
new file mode 100644
index 000000000000..9c56664bb6ce
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/patch-usbview
@@ -0,0 +1,493 @@
+ Use libusb-1 to query info about usb devices on all platforms, leave old
+ method as a fallback for Linux only.
+ Remove *BSD specific code, it doesn't work on FreeBSD 8.x and greater.
+ Old code probably works on NetBSD, but let it use libusb-1 as well.
+ Use DeviceNotifier instead of polling.
+
+--- cmake/modules/FindLibUSB1.cmake.orig 2016-12-13 11:26:31 UTC
++++ cmake/modules/FindLibUSB1.cmake
+@@ -0,0 +1,21 @@
++# - Try to find libusb v1.0 library
++# Once done this defines
++#
++# LIBUSB1_FOUND - system has libusb
++# LIBUSB1_INCLUDE_DIR - libusb include directory
++# LIBUSB1_LIBRARY - libusb library
++
++find_package(PkgConfig)
++pkg_check_modules(PC_LIBUSB1 QUIET libusb-1.0)
++
++find_path(LIBUSB1_INCLUDE_DIR libusb.h
++ HINTS ${PC_LIBUSB1_INCLUDEDIR} ${PC_LIBUSB1_INCLUDE_DIRS})
++
++# On FreeBSD libusb provides both v0.1 and v1.0 API
++find_library(LIBUSB1_LIBRARY NAMES usb-1.0 usb
++ HINTS ${PC_LIBUSB1_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(LIBUSB1 DEFAULT_MSG LIBUSB1_LIBRARY LIBUSB1_INCLUDE_DIR)
++
++mark_as_advanced(LIBUSB1_INCLUDE_DIR LIBUSB1_LIBRARY)
+--- kinfocenter/Modules/usbview/CMakeLists.txt.orig 2015-06-26 03:17:21 UTC
++++ kinfocenter/Modules/usbview/CMakeLists.txt
+@@ -1,15 +1,25 @@
++macro_optional_find_package(LibUSB1)
++macro_bool_to_01(LIBUSB1_FOUND HAVE_LIBUSB1)
++macro_log_feature(LIBUSB1_FOUND "libusb-1" "User level access to USB devices" "http://libusb.sourceforge.net/" FALSE "" "Provides usb info support in KControl.")
+
+-
++configure_file (config-kcmusb.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcmusb.h )
+
+ ########### next target ###############
+
++if (LIBUSB1_FOUND)
++ include_directories( ${LIBUSB1_INCLUDE_DIR} )
++endif (LIBUSB1_FOUND)
++
+ set(kcm_usb_PART_SRCS kcmusb.cpp usbdevices.cpp usbdb.cpp )
+
+
+ kde4_add_plugin(kcm_usb ${kcm_usb_PART_SRCS})
+
+
+-target_link_libraries(kcm_usb ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY})
++target_link_libraries(kcm_usb ${KDE4_KDEUI_LIBS} ${KDE4_SOLID_LIBS} ${QT_QTGUI_LIBRARY})
++if (LIBUSB1_FOUND)
++ target_link_libraries(kcm_usb ${LIBUSB1_LIBRARY})
++endif (LIBUSB1_FOUND)
+
+ install(TARGETS kcm_usb DESTINATION ${PLUGIN_INSTALL_DIR} )
+
+--- kinfocenter/Modules/usbview/config-kcmusb.h.cmake.orig 2016-12-13 11:26:31 UTC
++++ kinfocenter/Modules/usbview/config-kcmusb.h.cmake
+@@ -0,0 +1,2 @@
++/* Defined if you have libusb */
++#cmakedefine HAVE_LIBUSB1 1
+--- kinfocenter/Modules/usbview/kcmusb.cpp.orig 2015-06-26 03:17:21 UTC
++++ kinfocenter/Modules/usbview/kcmusb.cpp
+@@ -12,7 +12,6 @@
+ #include <QLayout>
+ #include <QSplitter>
+ #include <QtGui/QTextEdit>
+-#include <QTimer>
+ #include <QHBoxLayout>
+ #include <QList>
+ #include <QTreeWidget>
+@@ -20,6 +19,7 @@
+
+ #include <kaboutdata.h>
+ #include <kdialog.h>
++#include <solid/devicenotifier.h>
+
+ #include <KPluginFactory>
+ #include <KPluginLoader>
+@@ -63,11 +63,8 @@ USBViewer::USBViewer(QWidget *parent, co
+ _details = new QTextEdit(splitter);
+ _details->setReadOnly(true);
+
+- QTimer *refreshTimer = new QTimer(this);
+- // 1 sec seems to be a good compromise between latency and polling load.
+- refreshTimer->start(1000);
+-
+- connect(refreshTimer, SIGNAL(timeout()), SLOT(refresh()));
++ connect(Solid::DeviceNotifier::instance(),SIGNAL(deviceAdded(QString)), SLOT(refresh()));
++ connect(Solid::DeviceNotifier::instance(),SIGNAL(deviceRemoved(const QString)), SLOT(refresh()));
+ connect(_devices, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(selectionChanged(QTreeWidgetItem*)));
+
+ KAboutData *about = new KAboutData(I18N_NOOP("kcmusb"), 0, ki18n("KDE USB Viewer"),
+@@ -113,8 +110,12 @@ static void delete_recursive(QTreeWidget
+ void USBViewer::refresh() {
+ QMap<int, QTreeWidgetItem*> new_items;
+
++#if defined(HAVE_LIBUSB1)
++ USBDevice::parse();
++#else
+ if (!USBDevice::parse("/proc/bus/usb/devices"))
+ USBDevice::parseSys("/sys/bus/usb/devices");
++#endif
+
+ int level = 0;
+ bool found = true;
+--- kinfocenter/Modules/usbview/usbdevices.cpp.orig 2015-06-26 03:17:21 UTC
++++ kinfocenter/Modules/usbview/usbdevices.cpp
+@@ -27,9 +27,9 @@
+
+ #include <math.h>
+
+-#if defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
+-#include <sys/ioctl.h>
+-#include <sys/param.h>
++#include <config-kcmusb.h>
++#if defined(HAVE_LIBUSB1)
++#include <libusb.h>
+ #endif
+
+ QList<USBDevice*> USBDevice::_devices;
+@@ -48,6 +48,7 @@ USBDevice::~USBDevice() {
+
+ }
+
++#if !defined(HAVE_LIBUSB1)
+ static QString catFile(QString fname) {
+ char buffer[256];
+ QString result;
+@@ -129,6 +130,7 @@ void USBDevice::parseLine(const QString&
+ } else if (line.startsWith("P:"))
+ sscanf(line.toLocal8Bit().data(), "P: Vendor=%x ProdID=%x Rev=%x.%x", &_vendorID, &_prodID, &_revMajor, &_revMinor);
+ }
++#endif // !defined(HAVE_LIBUSB1)
+
+ USBDevice* USBDevice::find(int bus, int device) {
+ foreach(USBDevice* usbDevice, _devices) {
+@@ -160,6 +162,10 @@ QString USBDevice::dump() {
+
+ r += "<br/><table>";
+
++ r += i18n("<tr><td><i>Bus number</i></td><td>%1</td></tr>", _bus);
++ r += i18n("<tr><td><i>Device address</i></td><td>%1</td></tr>", _device);
++ r += "<tr><td></td></tr>";
++
+ QString c = QString("<td>%1</td>").arg(_class);
+ QString cname = _db->cls(_class);
+ if (!cname.isEmpty())
+@@ -175,11 +181,9 @@ QString USBDevice::dump() {
+ if (!prname.isEmpty())
+ pr += "<td>(" + prname +")</td>";
+ r += i18n("<tr><td><i>Protocol</i></td>%1</tr>", pr);
+-#if !(defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD))
+ r += ki18n("<tr><td><i>USB Version</i></td><td>%1.%2</td></tr>")
+ .subs(_verMajor,0,16).subs(_verMinor,2,16,QChar::fromLatin1('0'))
+ .toString();
+-#endif
+ r += "<tr><td></td></tr>";
+
+ QString v = QString::number(_vendorID, 16);
+@@ -198,22 +202,15 @@ QString USBDevice::dump() {
+ r += "<tr><td></td></tr>";
+
+ r += i18n("<tr><td><i>Speed</i></td><td>%1 Mbit/s</td></tr>", _speed);
+- r += i18n("<tr><td><i>Channels</i></td><td>%1</td></tr>", _channels);
+-#if (defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)) && !defined(DISABLE_USBDEVICES_FREEBSD)
+- if ( _power )
++#if defined(HAVE_LIBUSB1)
++ if ( _power != -1 )
+ r += i18n("<tr><td><i>Power Consumption</i></td><td>%1 mA</td></tr>", _power);
+ else
+- r += i18n("<tr><td><i>Power Consumption</i></td><td>self powered</td></tr>");
+- r += i18n("<tr><td><i>Attached Devicenodes</i></td><td>%1</td></tr>", _devnodes.at(0));
+- if ( _devnodes.count() > 1 ) {
+- QStringList::const_iterator it = _devnodes.constBegin();
+- ++it;
+- for (; it != _devnodes.constEnd(); ++it )
+- r += "<tr><td></td><td>" + *it + "</td></tr>";
+- }
+-#else
++ r += i18n("<tr><td><i>Power Consumption</i></td><td>unknown</td></tr>");
++#else // defined(HAVE_LIBUSB1)
++ r += i18n("<tr><td><i>Channels</i></td><td>%1</td></tr>", _channels);
++#endif // defined(HAVE_LIBUSB1)
+ r += i18n("<tr><td><i>Max. Packet Size</i></td><td>%1</td></tr>", _maxPacketSize);
+-#endif
+ r += "<tr><td></td></tr>";
+
+ if (_hasBW) {
+@@ -228,7 +225,82 @@ QString USBDevice::dump() {
+ return r;
+ }
+
+-#if !(defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD))
++#if defined(HAVE_LIBUSB1)
++
++void USBDevice::dump_usbdev_info(libusb_device *dev) {
++
++ _bus = libusb_get_bus_number(dev);
++ _device = libusb_get_device_address(dev);
++
++ switch (libusb_get_device_speed(dev)) {
++ case LIBUSB_SPEED_LOW: _speed = 1.5; break;
++ case LIBUSB_SPEED_FULL: _speed = 12; break;
++ case LIBUSB_SPEED_HIGH: _speed = 480; break;
++ case LIBUSB_SPEED_SUPER: _speed = 5000; break;
++ }
++
++ struct libusb_config_descriptor *conf;
++ if (libusb_get_active_config_descriptor(dev, &conf) == 0) {
++ _power = conf->MaxPower;
++ libusb_free_config_descriptor(conf);
++ } else {
++ _power = -1;
++ }
++
++ struct libusb_device_descriptor desc;
++ if (libusb_get_device_descriptor(dev, &desc) == 0) {
++ _verMajor = desc.bcdUSB >> 8;
++ _verMinor = desc.bcdUSB & 0x00FF;
++ _class = desc.bDeviceClass;
++ _sub = desc.bDeviceSubClass;
++ _prot = desc.bDeviceProtocol;
++ _maxPacketSize = desc.bMaxPacketSize0;
++ _configs = desc.bNumConfigurations;
++ _vendorID = desc.idVendor;
++ _prodID = desc.idProduct;
++ _revMajor = desc.bcdDevice >> 8;
++ _revMinor = desc.bcdDevice & 0x00FF;
++ }
++
++ libusb_device_handle *hdev;
++ uchar buf[256];
++ if (libusb_open(dev, &hdev) == 0) {
++ if (libusb_get_string_descriptor_ascii(hdev, desc.iManufacturer, buf, sizeof(buf)) > 0)
++ _manufacturer = (char*) buf;
++ if (libusb_get_string_descriptor_ascii(hdev, desc.iProduct, buf, sizeof(buf)) > 0)
++ _product = (char*) buf;
++ if (libusb_get_string_descriptor_ascii(hdev, desc.iSerialNumber, buf, sizeof(buf)) > 0)
++ _serial = (char*) buf;
++ libusb_close(hdev);
++ }
++}
++
++bool USBDevice::parse() {
++ _devices.clear();
++
++ int r = libusb_init(NULL);
++ if (r != 0)
++ return false;
++
++ libusb_device **devs;
++ ssize_t cnt = libusb_get_device_list(NULL, &devs);
++ if (cnt < 0)
++ return false;
++
++ libusb_device *dev;
++ int i = 0;
++ while ((dev = devs[i++]) != NULL) {
++ USBDevice* device = new USBDevice();
++ device->dump_usbdev_info(dev);
++ }
++ libusb_free_device_list(devs, 1);
++
++ libusb_exit(NULL);
++ return true;
++}
++
++#else // defined(HAVE_LIBUSB1)
++#if defined(Q_OS_LINUX)
+ bool USBDevice::parse(const QString &fname) {
+ _devices.clear();
+
+@@ -290,146 +362,19 @@ bool USBDevice::parseSys(const QString &
+ return d.count();
+ }
+
+-#else
+-
+-// Unused by *BSD
+-bool USBDevice::parseSys(const QString &fname)
+-{
+- Q_UNUSED(fname)
+-
+- return true;
+-}
+-
+-# if defined(DISABLE_USBDEVICES_FREEBSD)
+-
+-/*
+- * FIXME: The USB subsystem has changed a lot in FreeBSD 8.0
+- * Support for it must be written.
+- */
++#else // defined(Q_OS_LINUX)
+
+-bool USBDevice::parse(const QString &fname)
+-{
++bool USBDevice::parse(const QString &fname) {
+ Q_UNUSED(fname)
+
+ return true;
+ }
+
+-# else
+-
+-/*
+- * FreeBSD support by Markus Brueffer <markus@brueffer.de>
+- *
+- * Basic idea and some code fragments were taken from FreeBSD's usbdevs(8),
+- * originally developed for NetBSD, so this code should work with no or
+- * only little modification on NetBSD.
+- */
+-
+-void USBDevice::collectData( int fd, int level, usb_device_info &di, int parent)
+-{
+- // determine data for this device
+- _level = level;
+- _parent = parent;
+-
+- _bus = di.udi_bus;
+- _device = di.udi_addr;
+- _product = QLatin1String(di.udi_product);
+- if ( _device == 1 )
+- _product += ' ' + QString::number( _bus );
+- _manufacturer = QLatin1String(di.udi_vendor);
+- _prodID = di.udi_productNo;
+- _vendorID = di.udi_vendorNo;
+- _class = di.udi_class;
+- _sub = di.udi_subclass;
+- _prot = di.udi_protocol;
+- _power = di.udi_power;
+- _channels = di.udi_nports;
+-
+- // determine the speed
+-#if defined(__DragonFly__) || (defined(Q_OS_FREEBSD) && __FreeBSD_version > 490102) || defined(Q_OS_NETBSD)
+- switch (di.udi_speed) {
+- case USB_SPEED_LOW: _speed = 1.5; break;
+- case USB_SPEED_FULL: _speed = 12.0; break;
+- case USB_SPEED_HIGH: _speed = 480.0; break;
+- }
+-#else
+- _speed = di.udi_lowspeed ? 1.5 : 12.0;
+-#endif
+-
+- // Get all attached devicenodes
+- for ( int i = 0; i < USB_MAX_DEVNAMES; ++i )
+- if ( di.udi_devnames[i][0] )
+- _devnodes << di.udi_devnames[i];
+-
+- // For compatibility, split the revision number
+- sscanf( di.udi_release, "%x.%x", &_revMajor, &_revMinor );
+-
+- // Cycle through the attached devices if there are any
+- for ( int p = 0; p < di.udi_nports; ++p ) {
+- // Get data for device
+- struct usb_device_info di2;
+-
+- di2.udi_addr = di.udi_ports[p];
+-
+- if ( di2.udi_addr >= USB_MAX_DEVICES )
+- continue;
+-
+- if ( ioctl(fd, USB_DEVICEINFO, &di2) == -1 )
+- continue;
+-
+- // Only add the device if we didn't detect it, yet
+- if (!find( di2.udi_bus, di2.udi_addr ) )
+- {
+- USBDevice *device = new USBDevice();
+- device->collectData( fd, level + 1, di2, di.udi_addr );
+- }
+- }
+-}
+-
+-bool USBDevice::parse(const QString &fname)
+-{
+- Q_UNUSED(fname)
+-
+- static bool showErrorMessage = true;
+- bool error = false;
+- _devices.clear();
+-
+- QFile controller("/dev/usb0");
+- int i = 1;
+- while ( controller.exists() )
+- {
+- // If the devicenode exists, continue with further inspection
+- if ( controller.open(QIODevice::ReadOnly) )
+- {
+- for ( int addr = 1; addr < USB_MAX_DEVICES; ++addr )
+- {
+- struct usb_device_info di;
+-
+- di.udi_addr = addr;
+- if ( ioctl(controller.handle(), USB_DEVICEINFO, &di) != -1 )
+- {
+- if (!find( di.udi_bus, di.udi_addr ) )
+- {
+- USBDevice *device = new USBDevice();
+- device->collectData( controller.handle(), 0, di, 0);
+- }
+- }
+- }
+- controller.close();
+-#ifndef Q_OS_NETBSD
+- } else {
+- error = true;
+-#endif
+- }
+- controller.setFileName( QString::fromLocal8Bit("/dev/usb%1").arg(i++) );
+- }
+-
+- if ( showErrorMessage && error ) {
+- showErrorMessage = false;
+- KMessageBox::error( 0, i18n("Could not open one or more USB controller. Make sure, you have read access to all USB controllers that should be listed here."));
+- }
++bool USBDevice::parseSys(const QString &dname) {
++ Q_UNUSED(dname)
+
+ return true;
+ }
+
+-# endif // defined(DISABLE_USBDEVICES_FREEBSD)
+-#endif // !(defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD))
++#endif // defined(Q_OS_LINUX)
++#endif // defined(HAVE_LIBUSB1)
+--- kinfocenter/Modules/usbview/usbdevices.h.orig 2015-06-26 03:17:21 UTC
++++ kinfocenter/Modules/usbview/usbdevices.h
+@@ -14,18 +14,9 @@
+ #include <QList>
+ #include <QString>
+
+-#if defined(__DragonFly__)
+-#include <bus/usb/usb.h>
+-#include <QStringList>
+-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)
+-#include <sys/param.h>
+-# if defined(__FreeBSD_version) && __FreeBSD_version >= 800100
+-# define DISABLE_USBDEVICES_FREEBSD
+-# warning "The USB subsystem has changed in 8.0. Disabling."
+-# else
+-# include <dev/usb/usb.h>
+-# include <QStringList>
+-# endif
++#include <config-kcmusb.h>
++#if defined(HAVE_LIBUSB1)
++#include <libusb.h>
+ #endif
+
+ class USBDB;
+@@ -36,10 +27,12 @@ public:
+ USBDevice();
+
+ ~USBDevice();
+-
++#if defined(HAVE_LIBUSB1)
++ void dump_usbdev_info(libusb_device *dev);
++#else
+ void parseLine(const QString &line);
+ void parseSysDir(int bus, int parent, int level, const QString &line);
+-
++#endif
+ int level() const {
+ return _level;
+ }
+@@ -60,8 +53,12 @@ public:
+ return _devices;
+ }
+ static USBDevice *find(int bus, int device);
++#if defined(HAVE_LIBUSB1)
++ static bool parse();
++#else
+ static bool parse(const QString& fname);
+ static bool parseSys(const QString& fname);
++#endif
+
+ private:
+
+@@ -82,10 +79,6 @@ private:
+
+ unsigned int _vendorID, _prodID, _revMajor, _revMinor;
+
+-#if (defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD)) && !defined(DISABLE_USBDEVICES_FREEBSD)
+- void collectData( int fd, int level, usb_device_info &di, int parent );
+- QStringList _devnodes;
+-#endif
+ };
+
+ #endif
diff --git a/x11/kde-workspace-kde4/files/pkg-message.gstreamer b/x11/kde-workspace-kde4/files/pkg-message.gstreamer
new file mode 100644
index 000000000000..f6d499b7bb95
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/pkg-message.gstreamer
@@ -0,0 +1,5 @@
+Warning: should you want to use Phonon-GStreamer as your Phonon
+backend, you'll need to install *at least* audio/gstreamer-plugins-ogg
+to avoid finding yourself stuck when logging out of KDE Plasma
+Desktop.
+
diff --git a/x11/kde-workspace-kde4/files/pkg-message.in b/x11/kde-workspace-kde4/files/pkg-message.in
new file mode 100644
index 000000000000..158456987cbb
--- /dev/null
+++ b/x11/kde-workspace-kde4/files/pkg-message.in
@@ -0,0 +1,8 @@
+======================================================================
+
+To enable KDE Display Manager (KDM), add kdm4_enable="YES" to
+rc.conf(5). To get full functionality you also need procfs(5) mounted.
+
+If sysutils/upower is installed, backlight management support requires
+acpi_video(4) to be loaded.
+