Commit 3896b422 authored by Gleb Popov's avatar Gleb Popov

Improve the predicate in Block::hintIgnore()

Perform the partition type check for all non-usb drives, instead of looking at the device name.
parent d48b8ccf0f08
......@@ -30,6 +30,7 @@
#include "bsdisks.h"
#include "block.h"
#include "drive.h"
Block::Block(QObject* parent) :
QObject(parent), bFilesystem(nullptr),
......@@ -116,13 +117,10 @@ qulonglong Block::blockSize() const
bool Block::hintIgnore() const
{
if(bPartition)
if(bPartition && parentDrive)
{
// there should be better predicate for this, probably
// right now ignore efi partitions on ada/ad, these usually contain bootloader
// stuff and not needed to be mounted by regular user
QFileInfo devInfo(device());
if(bPartition->partitionType == "efi" && devInfo.fileName().startsWith("ad"))
if(bPartition->partitionType == "efi" && parentDrive->connectionBus() != "usb")
return true;
}
......
......@@ -39,6 +39,8 @@
#include "blockpartition.h"
#include "blockparttable.h"
class Drive;
class Block : public QObject,
public QDBusContext
{
......@@ -65,6 +67,7 @@ public:
bool registered;
bool hasNoDrive;
Drive* parentDrive;
QString driveName() const;
......
......@@ -323,6 +323,7 @@ bool ObjectManager::registerBlock(Block* b, bool tryPostponed)
if(!b->registered)
{
b->registered = true;
b->parentDrive = m_driveObjects.value(b->driveName(), nullptr);
QString devPath = b->dbusPath.path();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment