From 4d3e183ceb98ea0f720ef87fec15ff362b0428f6 Mon Sep 17 00:00:00 2001 From: Ark74 <ark@switnet.org> Date: Fri, 26 Jun 2020 22:13:32 -0500 Subject: [PATCH] Backport fix for solid kde framework --- ...t_handling_of_removable_file_systems.patch | 18 +++++ ...e_mount_point_after_mount_operations.patch | 69 +++++++++++++++++++ helpers/make-solid | 35 ++++++++++ 3 files changed, 122 insertions(+) create mode 100644 helpers/DATA/solid/122a6cd8_correct_handling_of_removable_file_systems.patch create mode 100644 helpers/DATA/solid/d735708f_update_mount_point_after_mount_operations.patch create mode 100644 helpers/make-solid diff --git a/helpers/DATA/solid/122a6cd8_correct_handling_of_removable_file_systems.patch b/helpers/DATA/solid/122a6cd8_correct_handling_of_removable_file_systems.patch new file mode 100644 index 00000000..e7688e33 --- /dev/null +++ b/helpers/DATA/solid/122a6cd8_correct_handling_of_removable_file_systems.patch @@ -0,0 +1,18 @@ +diff -ruN solid-5.44.0/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp +--- solid-5.44.0/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp 2020-06-26 14:03:41.000000000 -0500 ++++ solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp 2020-06-26 14:10:13.708453200 -0500 +@@ -122,10 +122,10 @@ + + const QString path = filePath(); + +- return !path.isEmpty() +- && !path.startsWith(QLatin1String("/media/")) +- && !path.startsWith(QLatin1String("/run/media/")) +- && !path.startsWith(QDir::homePath()); ++ bool inUserPath = path.startsWith(QLatin1String("/media/")) || ++ path.startsWith(QLatin1String("/run/media/")) || ++ path.startsWith(QDir::homePath()); ++ return !inUserPath; + } + + bool StorageAccess::setup() diff --git a/helpers/DATA/solid/d735708f_update_mount_point_after_mount_operations.patch b/helpers/DATA/solid/d735708f_update_mount_point_after_mount_operations.patch new file mode 100644 index 00000000..c93c22e7 --- /dev/null +++ b/helpers/DATA/solid/d735708f_update_mount_point_after_mount_operations.patch @@ -0,0 +1,69 @@ +diff -ruN solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksdevice.cpp solid-5.44.0-update-mount-point/src/solid/devices/backends/udisks2/udisksdevice.cpp +--- solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksdevice.cpp 2020-06-26 14:07:57.083219471 -0500 ++++ solid-5.44.0-update-mount-point/src/solid/devices/backends/udisks2/udisksdevice.cpp 2020-06-26 15:41:51.879400437 -0500 +@@ -157,6 +157,13 @@ + return QStringList(); + } + ++void Device::invalidateCache() ++{ ++ if (m_backend) { ++ return m_backend->invalidateProperties(); ++ } ++} ++ + QObject *Device::createDeviceInterface(const Solid::DeviceInterface::Type &type) + { + if (!queryDeviceInterface(type)) { +diff -ruN solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksdevice.h solid-5.44.0-update-mount-point/src/solid/devices/backends/udisks2/udisksdevice.h +--- solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksdevice.h 2020-06-26 14:07:57.083219471 -0500 ++++ solid-5.44.0-update-mount-point/src/solid/devices/backends/udisks2/udisksdevice.h 2020-06-26 15:44:30.976790082 -0500 +@@ -61,6 +61,7 @@ + QVariant prop(const QString &key) const; + bool propertyExists(const QString &key) const; + QVariantMap allProperties() const; ++ void invalidateCache(); + + bool hasInterface(const QString &name) const; + QStringList interfaces() const; +diff -ruN solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp solid-5.44.0-update-mount-point/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp +--- solid-5.44.0-fix-url-format/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp 2020-06-26 14:10:13.708453200 -0500 ++++ solid-5.44.0-update-mount-point/src/solid/devices/backends/udisks2/udisksstorageaccess.cpp 2020-06-26 19:02:41.461847792 -0500 +@@ -177,6 +177,7 @@ + mount(); + } else { // Don't broadcast setupDone unless the setup is really done. (Fix kde#271156) + m_setupInProgress = false; ++ m_device->invalidateCache(); + m_device->broadcastActionDone("setup"); + + checkAccessibility(); +@@ -202,6 +203,7 @@ + } + + m_teardownInProgress = false; ++ m_device->invalidateCache(); + m_device->broadcastActionDone("teardown"); + + checkAccessibility(); +@@ -238,9 +240,8 @@ + { + m_setupInProgress = false; + //qDebug() << "SETUP DONE:" << m_device->udi(); +- emit setupDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi()); +- + checkAccessibility(); ++ emit setupDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi()); + } + + void StorageAccess::slotTeardownRequested() +@@ -252,9 +253,8 @@ + void StorageAccess::slotTeardownDone(int error, const QString &errorString) + { + m_teardownInProgress = false; +- emit teardownDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi()); +- + checkAccessibility(); ++ emit teardownDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi()); + } + + bool StorageAccess::mount() diff --git a/helpers/make-solid b/helpers/make-solid new file mode 100644 index 00000000..80690d80 --- /dev/null +++ b/helpers/make-solid @@ -0,0 +1,35 @@ +#!/bin/sh +# +# Copyright (C) 2020 Luis Guzmán <ark@switnet.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +VERSION=1 +#EXTERNAL='deb-src http://archive.ubuntu.com/ubuntu focal main universe' +#REPOKEY="3B4FE6ACC0B21F32" +#BACKPORT=true +#DEPENDS=nspr + +. ./config + +patch -p1 < $DATA/122a6cd8_correct_handling_of_removable_file_systems.patch +patch -p1 < $DATA/d735708f_update_mount_point_after_mount_operations.patch + +changelog "Correct handling of removable file systems KDE GIT#122a6cd8 & #d735708f" +#changelog "Backport from focal" + +compile + -- GitLab