From 849137c20b876e3bca101a6f1fd5bd3fe07cceab Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 28 Jul 2016 17:42:45 +0200 Subject: [PATCH] Use UUIDs instead of paths to match osprober entries with partitions. --- src/modules/partition/core/PartitionModel.cpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/modules/partition/core/PartitionModel.cpp b/src/modules/partition/core/PartitionModel.cpp index beb7ea633..ae15b5c91 100644 --- a/src/modules/partition/core/PartitionModel.cpp +++ b/src/modules/partition/core/PartitionModel.cpp @@ -205,27 +205,37 @@ PartitionModel::data( const QModelIndex& index, int role ) const // Osprober roles: case OsproberNameRole: foreach ( const OsproberEntry& osproberEntry, m_osproberEntries ) - if ( osproberEntry.path == partition->partitionPath() ) + if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone && + !partition->fileSystem().uuid().isEmpty() && + osproberEntry.uuid == partition->fileSystem().uuid() ) return osproberEntry.prettyName; return QVariant(); case OsproberPathRole: foreach ( const OsproberEntry& osproberEntry, m_osproberEntries ) - if ( osproberEntry.path == partition->partitionPath() ) + if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone && + !partition->fileSystem().uuid().isEmpty() && + osproberEntry.uuid == partition->fileSystem().uuid() ) return osproberEntry.path; return QVariant(); case OsproberCanBeResizedRole: foreach ( const OsproberEntry& osproberEntry, m_osproberEntries ) - if ( osproberEntry.path == partition->partitionPath() ) + if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone && + !partition->fileSystem().uuid().isEmpty() && + osproberEntry.uuid == partition->fileSystem().uuid() ) return osproberEntry.canBeResized; return QVariant(); case OsproberRawLineRole: foreach ( const OsproberEntry& osproberEntry, m_osproberEntries ) - if ( osproberEntry.path == partition->partitionPath() ) + if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone && + !partition->fileSystem().uuid().isEmpty() && + osproberEntry.uuid == partition->fileSystem().uuid() ) return osproberEntry.line; return QVariant(); case OsproberHomePartitionPathRole: foreach ( const OsproberEntry& osproberEntry, m_osproberEntries ) - if ( osproberEntry.path == partition->partitionPath() ) + if ( partition->fileSystem().supportGetUUID() != FileSystem::cmdSupportNone && + !partition->fileSystem().uuid().isEmpty() && + osproberEntry.uuid == partition->fileSystem().uuid() ) return osproberEntry.homePath; return QVariant(); // end Osprober roles.