From 4bcf9288e672d3ae7717f95d921358322805e336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 12 Apr 2018 15:16:42 +0300 Subject: [PATCH 1/4] Remove deprecated attribute for now. Not available on current Neon. --- src/core/partition.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/partition.h b/src/core/partition.h index 63f604d..c675c10 100644 --- a/src/core/partition.h +++ b/src/core/partition.h @@ -80,10 +80,10 @@ public: New, /**< from a NewOperation */ Copy, /**< from a CopyOperation */ Restore, /**< from a RestoreOperation */ - StateNone __attribute__((deprecated("Use Partition::State::None"))) = None, - StateNew __attribute__((deprecated("Use Partition::State::New"))) = New, - StateCopy __attribute__((deprecated("Use Partition::State::Copy"))) = Copy, - StateRestore __attribute__((deprecated("Use Partition::State::Restore"))) = Restore + StateNone = None, + StateNew = New, + StateCopy = Copy, + StateRestore = Restore }; Partition(PartitionNode* parent, const Device& device, const PartitionRole& role, FileSystem* fs, qint64 sectorStart, qint64 sectorEnd, QString partitionPath, PartitionTable::Flags availableFlags = PartitionTable::FlagNone, const QString& mountPoint = QString(), bool mounted = false, PartitionTable::Flags activeFlags = PartitionTable::FlagNone, State state = State::None); From b3a8a3874fae41f84759e77396b70975b0d602d2 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Mon, 23 Apr 2018 05:26:25 +0200 Subject: [PATCH 2/4] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- src/plugins/dummy/pmdummybackendplugin.json | 2 ++ src/plugins/libparted/pmlibpartedbackendplugin.json | 2 ++ src/plugins/sfdisk/pmsfdiskbackendplugin.json | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/plugins/dummy/pmdummybackendplugin.json b/src/plugins/dummy/pmdummybackendplugin.json index f79b94b..4169c9d 100644 --- a/src/plugins/dummy/pmdummybackendplugin.json +++ b/src/plugins/dummy/pmdummybackendplugin.json @@ -13,6 +13,7 @@ "Description[ca]": "Un dorsal fals del gestor de particions del KDE amb la finalitat de fer proves.", "Description[de]": "Ein Dummy-Backend für die KDE-Partitionsverwaltung zu Testzwecken.", "Description[es]": "Un motor de simulación para el gestor de particiones de KDE para hacer pruebas.", + "Description[gl]": "Unha infraestrutura de probas para o xestor de particións de KDE.", "Description[nl]": "Dummy backend van KDE-partitiebeheerder voor testdoeleinden", "Description[pt]": "Uma infra-estrutura de testes para o Gestor de Partições do KDE.", "Description[sk]": "Testovací program v pozadí KDE Správcu partícií", @@ -32,6 +33,7 @@ "Name[es]": "Motor de simulación para el gestor de particiones de KDE", "Name[fi]": "KDE:n osionhallinnan valetaustaosa", "Name[fr]": "Moteur de test pour le gestionnaire de partitions de KDE", + "Name[gl]": "Infraestrutura de probas para o xestor de particións de KDE", "Name[id]": "Backend Tiruan Pengelola Partisi KDE", "Name[it]": "Motore fittizio del gestore delle partizioni di KDE", "Name[nb]": "Attrapp-motor for KDE partisjonsbehandler", diff --git a/src/plugins/libparted/pmlibpartedbackendplugin.json b/src/plugins/libparted/pmlibpartedbackendplugin.json index 16ba62b..7687f7c 100644 --- a/src/plugins/libparted/pmlibpartedbackendplugin.json +++ b/src/plugins/libparted/pmlibpartedbackendplugin.json @@ -13,6 +13,7 @@ "Description[ca]": "Un dorsal pel LibParted del gestor de particions del KDE", "Description[de]": "Das LibParted-Backend für die KDE-Partitionsverwaltung", "Description[es]": "El motor LibParted para el gestor de particiones de KDE", + "Description[gl]": "A infraestrutura de LibPartes para o xestor de particións de KDE.", "Description[nl]": "De LibParted-backend voor de KDE-partitiebeheerder", "Description[pt]": "A infra-estrutura da LibParted para o Gestor de Partições do KDE", "Description[sk]": "LibParted - program v pozadí pre KDE Správcu partícií", @@ -32,6 +33,7 @@ "Name[es]": "Motor LibParted para el gestor de particiones de KDE", "Name[fi]": "KDE:n osionhallinnan LibParted-taustaosa", "Name[fr]": "Moteur LibParted pour le gestionnaire de partitions de KDE", + "Name[gl]": "Infraestrutura de LibPartes para o xestor de particións de KDE", "Name[id]": "Backend LibParted Pengelola Parisi KDE", "Name[it]": "Motore LibParted del gestore delle partizioni di KDE", "Name[nb]": "KDE partisjonsbehandler, bakgrunnsmotor for libparted", diff --git a/src/plugins/sfdisk/pmsfdiskbackendplugin.json b/src/plugins/sfdisk/pmsfdiskbackendplugin.json index 94274dd..66e3d0a 100644 --- a/src/plugins/sfdisk/pmsfdiskbackendplugin.json +++ b/src/plugins/sfdisk/pmsfdiskbackendplugin.json @@ -13,6 +13,7 @@ "Description[ca]": "Un dorsal «sfdisk» del gestor de particions del KDE.", "Description[de]": "Ein sfdisk-Backend für die KDE-Partitionsverwaltung.", "Description[es]": "Motor sfdisk para el gestor de particiones de KDE.", + "Description[gl]": "Unha infraestrutura de sfdisk para o xestor de particións de KDE.", "Description[nl]": "Een sfdisk backend van KDE-partitiebeheerder.", "Description[pt]": "A infra-estrutura do 'sfdisk' para o Gestor de Partições do KDE.", "Description[sk]": "Backend KDE správcu partícií sfdisk.", @@ -28,6 +29,7 @@ "Name[ca]": "Dorsal «sfdisk» del gestor de particions del KDE", "Name[de]": "KDE-Partitionsverwaltung sfdisk-Backend", "Name[es]": "Motor sfdisk para el gestor de particiones de KDE", + "Name[gl]": "Infraestrutura de sfdisk para o xestor de particións de KDE", "Name[it]": "Motore sfdisk del gestore delle partizioni di KDE", "Name[nl]": "Sfdisk backend van KDE-partitiebeheerder", "Name[pt]": "Infra-Estrutura do Sfdisk para o Gestor de Partições do KDE", From 7497d509f4b4ba1ae252ae4760a91d4743bbf98b Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Thu, 7 Jun 2018 05:41:48 +0200 Subject: [PATCH 3/4] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- src/plugins/dummy/pmdummybackendplugin.json | 1 + src/plugins/libparted/pmlibpartedbackendplugin.json | 1 + src/plugins/sfdisk/pmsfdiskbackendplugin.json | 1 + 3 files changed, 3 insertions(+) diff --git a/src/plugins/dummy/pmdummybackendplugin.json b/src/plugins/dummy/pmdummybackendplugin.json index 4169c9d..055d483 100644 --- a/src/plugins/dummy/pmdummybackendplugin.json +++ b/src/plugins/dummy/pmdummybackendplugin.json @@ -14,6 +14,7 @@ "Description[de]": "Ein Dummy-Backend für die KDE-Partitionsverwaltung zu Testzwecken.", "Description[es]": "Un motor de simulación para el gestor de particiones de KDE para hacer pruebas.", "Description[gl]": "Unha infraestrutura de probas para o xestor de particións de KDE.", + "Description[it]": "Un motore fittizio del gestore delle partizioni di KDE per scopi di prova.", "Description[nl]": "Dummy backend van KDE-partitiebeheerder voor testdoeleinden", "Description[pt]": "Uma infra-estrutura de testes para o Gestor de Partições do KDE.", "Description[sk]": "Testovací program v pozadí KDE Správcu partícií", diff --git a/src/plugins/libparted/pmlibpartedbackendplugin.json b/src/plugins/libparted/pmlibpartedbackendplugin.json index 7687f7c..ef69663 100644 --- a/src/plugins/libparted/pmlibpartedbackendplugin.json +++ b/src/plugins/libparted/pmlibpartedbackendplugin.json @@ -14,6 +14,7 @@ "Description[de]": "Das LibParted-Backend für die KDE-Partitionsverwaltung", "Description[es]": "El motor LibParted para el gestor de particiones de KDE", "Description[gl]": "A infraestrutura de LibPartes para o xestor de particións de KDE.", + "Description[it]": "Il motore LibParted del gestore delle partizioni di KDE", "Description[nl]": "De LibParted-backend voor de KDE-partitiebeheerder", "Description[pt]": "A infra-estrutura da LibParted para o Gestor de Partições do KDE", "Description[sk]": "LibParted - program v pozadí pre KDE Správcu partícií", diff --git a/src/plugins/sfdisk/pmsfdiskbackendplugin.json b/src/plugins/sfdisk/pmsfdiskbackendplugin.json index 66e3d0a..e2009db 100644 --- a/src/plugins/sfdisk/pmsfdiskbackendplugin.json +++ b/src/plugins/sfdisk/pmsfdiskbackendplugin.json @@ -14,6 +14,7 @@ "Description[de]": "Ein sfdisk-Backend für die KDE-Partitionsverwaltung.", "Description[es]": "Motor sfdisk para el gestor de particiones de KDE.", "Description[gl]": "Unha infraestrutura de sfdisk para o xestor de particións de KDE.", + "Description[it]": "Un motore sfdisk del gestore delle partizioni di KDE.", "Description[nl]": "Een sfdisk backend van KDE-partitiebeheerder.", "Description[pt]": "A infra-estrutura do 'sfdisk' para o Gestor de Partições do KDE.", "Description[sk]": "Backend KDE správcu partícií sfdisk.", From 358957641b2c7ff6b69d090c9e1fddba482c6817 Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Mon, 11 Jun 2018 18:25:01 -0300 Subject: [PATCH 4/4] Including LVM VG device scan in scanDevice in SfdiskBackend and LibPartedBackend. It was scanning only for DiskDevices. --- src/plugins/libparted/libpartedbackend.cpp | 18 +++++++++++++++++- src/plugins/libparted/libpartedbackend.h | 2 +- src/plugins/sfdisk/sfdiskbackend.cpp | 17 +++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/plugins/libparted/libpartedbackend.cpp b/src/plugins/libparted/libpartedbackend.cpp index 7c0e59a..db73577 100644 --- a/src/plugins/libparted/libpartedbackend.cpp +++ b/src/plugins/libparted/libpartedbackend.cpp @@ -384,12 +384,28 @@ void LibPartedBackend::scanDevicePartitions(Device& d, PedDisk* pedDisk) @param deviceNode the device node (e.g. "/dev/sda") @return the created Device object. callers need to free this. */ -DiskDevice* LibPartedBackend::scanDevice(const QString& deviceNode) +Device* LibPartedBackend::scanDevice(const QString& deviceNode) { PedDevice* pedDevice = ped_device_get(deviceNode.toLocal8Bit().constData()); if (pedDevice == nullptr) { Log(Log::warning) << xi18nc("@info:status", "Could not access device %1", deviceNode); + Log(Log::warning) << xi18nc("@info:status", "Checking if this device is LVM VG"); + + // Look if this device is a LVM VG + ExternalCommand checkVG(QStringLiteral("lvm"), { QStringLiteral("vgdisplay"), deviceNode }); + + if (checkVG.run(-1) && checkVG.exitCode() == 0) + { + QList availableDevices = scanDevices(); + + LvmDevice::scanSystemLVM(availableDevices); + + for (Device *device : qAsConst(availableDevices)) + if (device->deviceNode() == deviceNode) + return device; + } + return nullptr; } diff --git a/src/plugins/libparted/libpartedbackend.h b/src/plugins/libparted/libpartedbackend.h index 93ed320..238ec03 100644 --- a/src/plugins/libparted/libpartedbackend.h +++ b/src/plugins/libparted/libpartedbackend.h @@ -64,7 +64,7 @@ public: CoreBackendDevice* openDevice(const Device& d) override; CoreBackendDevice* openDeviceExclusive(const Device& d) override; bool closeDevice(CoreBackendDevice* core_device) override; - DiskDevice* scanDevice(const QString& deviceNode) override; + Device* scanDevice(const QString& deviceNode) override; QList scanDevices(bool excludeReadOnly = false) override; FileSystem::Type detectFileSystem(const QString& partitionPath) override; QString readLabel(const QString& deviceNode) const override; diff --git a/src/plugins/sfdisk/sfdiskbackend.cpp b/src/plugins/sfdisk/sfdiskbackend.cpp index 57a510d..bd641e6 100644 --- a/src/plugins/sfdisk/sfdiskbackend.cpp +++ b/src/plugins/sfdisk/sfdiskbackend.cpp @@ -182,6 +182,23 @@ Device* SfdiskBackend::scanDevice(const QString& deviceNode) scanDevicePartitions(*d, partitionTable[QLatin1String("partitions")].toArray()); return d; } + else + { + // Look if this device is a LVM VG + ExternalCommand checkVG(QStringLiteral("lvm"), { QStringLiteral("vgdisplay"), deviceNode }); + + if (checkVG.run(-1) && checkVG.exitCode() == 0) + { + qDebug() << "Trying to find LVM VG"; + QList availableDevices = scanDevices(); + + LvmDevice::scanSystemLVM(availableDevices); + + for (Device *device : qAsConst(availableDevices)) + if (device->deviceNode() == deviceNode) + return device; + } + } return nullptr; }