From owner-svn-ports-head@FreeBSD.ORG Tue Sep 18 18:57:01 2012 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 80FBB106564A; Tue, 18 Sep 2012 18:57:01 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3E28FC08; Tue, 18 Sep 2012 18:57:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IIv1S1044504; Tue, 18 Sep 2012 18:57:01 GMT (envelope-from rakuco@svn.freebsd.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IIv1XD044501; Tue, 18 Sep 2012 18:57:01 GMT (envelope-from rakuco@svn.freebsd.org) Message-Id: <201209181857.q8IIv1XD044501@svn.freebsd.org> From: Raphael Kubo da Costa Date: Tue, 18 Sep 2012 18:57:01 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r304454 - in head/x11/kdelibs4: . files X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 18:57:01 -0000 Author: rakuco Date: Tue Sep 18 18:57:00 2012 New Revision: 304454 URL: http://svn.freebsd.org/changeset/ports/304454 Log: Backport an upstream commit I made which fixes some Solid-related crashes. The crashes themselves only occur under some special circumstances, but since it may take some time to get an exp-run for a more recent KDE version and the newest KTorrent release does cause this crash, it makes sense to add this patch for now. Added: head/x11/kdelibs4/files/patch-git_e405fa9 (contents, props changed) Modified: head/x11/kdelibs4/Makefile Modified: head/x11/kdelibs4/Makefile ============================================================================== --- head/x11/kdelibs4/Makefile Tue Sep 18 18:29:19 2012 (r304453) +++ head/x11/kdelibs4/Makefile Tue Sep 18 18:57:00 2012 (r304454) @@ -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 Added: head/x11/kdelibs4/files/patch-git_e405fa9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11/kdelibs4/files/patch-git_e405fa9 Tue Sep 18 18:57:00 2012 (r304454) @@ -0,0 +1,153 @@ +commit e405fa978b3c308249a5d553b784d3f8b277fd35 +Author: Raphael Kubo da Costa +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 + 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 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 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 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; + }; + }