From 0796d8fb22359f1b1dcaeb5012d66a31c9a1e61e Mon Sep 17 00:00:00 2001 From: Mariusz Fik Date: Thu, 30 Nov 2023 20:29:06 +0100 Subject: [PATCH] Adjust partition numbering. This change allows using SD cards that are visible by the system as /org/freedesktop/UDisks2/block_devices/mmcblk0 All standard devices (sdX, nvme) count partitions starting from 1. Signed-off-by: Mariusz Fik --- MainWindow.cpp | 4 ++-- PlatformUdisks2.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index c32bf9e..8d90722 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -338,7 +338,7 @@ void MainWindow::deviceInserted(const QDBusObjectPath &object_path, { Q_UNUSED(interfaces_and_properties); - QRegExp reg("[0-9]+$"); + QRegExp reg("[1-9]+$"); QString path = object_path.path(); if (!path.startsWith("/org/freedesktop/UDisks2/block_devices")) @@ -360,7 +360,7 @@ void MainWindow::deviceRemoved(const QDBusObjectPath &object_path, { Q_UNUSED(interfaces); - QRegExp reg("[0-9]+$"); + QRegExp reg("[1-9]+$"); QString path = object_path.path(); if (!path.startsWith("/org/freedesktop/UDisks2/block_devices")) diff --git a/PlatformUdisks2.cpp b/PlatformUdisks2.cpp index 1ef57c0..ce21686 100644 --- a/PlatformUdisks2.cpp +++ b/PlatformUdisks2.cpp @@ -51,7 +51,7 @@ PlatformUdisks2::udisk2Enabled() void PlatformUdisks2::findDevices() { - QRegExp reg("[0-9]+$"); + QRegExp reg("[1-9]+$"); if (!udisk2Enabled()) {