aboutsummaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2012-09-18 18:57:00 +0000
committerRaphael Kubo da Costa <rakuco@FreeBSD.org>2012-09-18 18:57:00 +0000
commitc8c82cf5bf8a2213fec7a6fa708550bc770f1348 (patch)
tree1fe0643809fc44d72c3b36981291828ec20504c7 /x11
parent6fcb72ece2dc5196133b57bed6fea944f3d6666e (diff)
downloadports-c8c82cf5bf8a2213fec7a6fa708550bc770f1348.tar.gz
ports-c8c82cf5bf8a2213fec7a6fa708550bc770f1348.zip
Notes
Diffstat (limited to 'x11')
-rw-r--r--x11/kdelibs4/Makefile1
-rw-r--r--x11/kdelibs4/files/patch-git_e405fa9153
2 files changed, 154 insertions, 0 deletions
diff --git a/x11/kdelibs4/Makefile b/x11/kdelibs4/Makefile
index f411e35b0418..e413aecf7e71 100644
--- a/x11/kdelibs4/Makefile
+++ b/x11/kdelibs4/Makefile
@@ -8,6 +8,7 @@
PORTNAME= kdelibs
PORTVERSION= ${KDE4_VERSION}
+PORTREVISION= 1
CATEGORIES= x11 kde ipv6
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= ${KDE4_BRANCH}/${PORTVERSION}/src
diff --git a/x11/kdelibs4/files/patch-git_e405fa9 b/x11/kdelibs4/files/patch-git_e405fa9
new file mode 100644
index 000000000000..64f3b0320dba
--- /dev/null
+++ b/x11/kdelibs4/files/patch-git_e405fa9
@@ -0,0 +1,153 @@
+commit e405fa978b3c308249a5d553b784d3f8b277fd35
+Author: Raphael Kubo da Costa <rakuco@FreeBSD.org>
+Date: Wed Jul 18 22:32:41 2012 -0300
+
+ HAL: Use the filtering code in HalDevice in devicesFromQuery().
+
+ Follow what other backends such as the UDisks one do and simply relay
+ the required checks for validity to each Device we are interested in.
+
+ So far, HalDevice::queryDeviceInterface() performed some checks
+ depending on the DeviceInterface type being passed to it, while
+ HalManager::devicesFromQuery() did not filter the results it got in
+ the same way. What's more, some checks such as the video4linux ones
+ were being made in both places, leading to some needless duplication
+ in functionality.
+
+ As a side-effect, this fixes a bug made visibile by a recent commit to
+ libktorrent: retrieving StorageAccess devices with listFromType()
+ would simply query HAL for devices with the "volume" capability (which
+ includes swap partitions and other non-mountable things), so using
+ Device::asDeviceInterface(Solid::DeviceInterface::StorageAccess) would
+ sometimes return 0 on a few of those entries retrieved earlier.
+
+ Reviewed-by: Alberto Villa <avilla@FreeBSD.org>
+ REVIEW: 105615
+
+diff --git a/solid/solid/backends/hal/halmanager.cpp b/solid/solid/backends/hal/halmanager.cpp
+index 2c9c6c0..7238b6a 100644
+--- solid/solid/backends/hal/halmanager.cpp
++++ solid/solid/backends/hal/halmanager.cpp
+@@ -147,30 +147,27 @@ bool HalManager::deviceExists(const QString &udi)
+ QStringList HalManager::devicesFromQuery(const QString &parentUdi,
+ Solid::DeviceInterface::Type type)
+ {
+- if (!parentUdi.isEmpty())
+- {
+- QStringList result = findDeviceStringMatch("info.parent", parentUdi);
++ if ((parentUdi.isEmpty()) && (type == Solid::DeviceInterface::Unknown)) {
++ return allDevices();
++ }
+
+- if (type!=Solid::DeviceInterface::Unknown) {
+- const QStringList matches = result;
+- result.clear();
++ QStringList result;
+
+- foreach (const QString &match, matches) {
+- HalDevice device(match);
++ foreach (const QString &udi, allDevices()) {
++ HalDevice device(udi);
+
+- if (device.queryDeviceInterface(type)) {
+- result << match;
+- }
+- }
++ if ((!parentUdi.isEmpty()) && (parentUdi != device.parentUdi())) {
++ continue;
+ }
+
+- return result;
++ if ((type != Solid::DeviceInterface::Unknown) && (!device.queryDeviceInterface(type))) {
++ continue;
++ }
+
+- } else if (type!=Solid::DeviceInterface::Unknown) {
+- return findDeviceByDeviceInterface(type);
+- } else {
+- return allDevices();
++ result << udi;
+ }
++
++ return result;
+ }
+
+ QObject *HalManager::createDevice(const QString &udi)
+@@ -182,63 +179,6 @@ QObject *HalManager::createDevice(const QString &udi)
+ }
+ }
+
+-QStringList HalManager::findDeviceStringMatch(const QString &key, const QString &value)
+-{
+- QDBusReply<QStringList> reply = d->manager.call("FindDeviceStringMatch", key, value);
+-
+- if (!reply.isValid())
+- {
+- qWarning() << Q_FUNC_INFO << " error: " << reply.error().name() << endl;
+- return QStringList();
+- }
+-
+- return reply;
+-}
+-
+-QStringList HalManager::findDeviceByDeviceInterface(Solid::DeviceInterface::Type type)
+-{
+- QStringList cap_list = DeviceInterface::toStringList(type);
+- QStringList result;
+-
+- foreach (const QString &cap, cap_list)
+- {
+- QDBusReply<QStringList> reply = d->manager.call("FindDeviceByCapability", cap);
+-
+- if (!reply.isValid())
+- {
+- qWarning() << Q_FUNC_INFO << " error: " << reply.error().name() << endl;
+- return QStringList();
+- }
+- if ( cap == QLatin1String( "video4linux" ) )
+- {
+- QStringList foundDevices ( reply );
+- QStringList filtered;
+- foreach ( const QString &udi, foundDevices )
+- {
+- QDBusInterface device( "org.freedesktop.Hal", udi, "org.freedesktop.Hal.Device", QDBusConnection::systemBus() );
+- QDBusReply<QString> reply = device.call( "GetProperty", "video4linux.device" );
+- if (!reply.isValid())
+- {
+- qWarning() << Q_FUNC_INFO << " error getting video4linux.device: " << reply.error().name() << endl;
+- continue;
+- }
+- if ( !reply.value().contains( "video" ) )
+- {
+- continue;
+- }
+- filtered.append( udi );
+- }
+- result += filtered;
+- }
+- else
+- {
+- result << reply;
+- }
+- }
+-
+- return result;
+-}
+-
+ void HalManager::slotDeviceAdded(const QString &udi)
+ {
+ d->devicesCache.append(udi);
+diff --git a/solid/solid/backends/hal/halmanager.h b/solid/solid/backends/hal/halmanager.h
+index ec42fac..377b15d 100644
+--- solid/solid/backends/hal/halmanager.h
++++ solid/solid/backends/hal/halmanager.h
+@@ -59,9 +59,6 @@ private Q_SLOTS:
+ void slotDeviceRemoved(const QString &udi);
+
+ private:
+- QStringList findDeviceStringMatch(const QString &key, const QString &value);
+- QStringList findDeviceByDeviceInterface(Solid::DeviceInterface::Type type);
+-
+ HalManagerPrivate *d;
+ };
+ }