Disable MountPointDialog for swap, lvm pv and unknown partitions.

This commit is contained in:
Andrius Štikonas 2016-05-24 17:26:12 +01:00
parent 3d57b3211a
commit 0c70c66aae
5 changed files with 19 additions and 2 deletions

View File

@ -21,6 +21,7 @@
#include "util/externalcommand.h" #include "util/externalcommand.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <QDebug>
namespace FS namespace FS
{ {
@ -134,9 +135,9 @@ QString linuxswap::unmountTitle() const
bool linuxswap::canMount(const QString& deviceNode, const QString& mountPoint) const { bool linuxswap::canMount(const QString& deviceNode, const QString& mountPoint) const {
Q_UNUSED(deviceNode); Q_UNUSED(deviceNode);
Q_UNUSED(mountPoint);
// linux swap doesn't require mount point to activate // linux swap doesn't require mount point to activate
return true; qDebug() << mountPoint;
return mountPoint != QStringLiteral("/");
} }
bool linuxswap::mount(Report& report, const QString& deviceNode, const QString& mountPoint) bool linuxswap::mount(Report& report, const QString& deviceNode, const QString& mountPoint)

View File

@ -110,4 +110,11 @@ bool lvm2_pv::updateUUID(Report& report, const QString& deviceNode) const
ExternalCommand cmd(report, QStringLiteral("lvm"), { QStringLiteral("pvchange"), QStringLiteral("--uuid"), deviceNode }); ExternalCommand cmd(report, QStringLiteral("lvm"), { QStringLiteral("pvchange"), QStringLiteral("--uuid"), deviceNode });
return cmd.run(-1) && cmd.exitCode() == 0; return cmd.run(-1) && cmd.exitCode() == 0;
} }
bool lvm2_pv::canMount(const QString & deviceNode, const QString & mountPoint) const
{
Q_UNUSED(deviceNode)
Q_UNUSED(mountPoint)
return false;
}
} }

View File

@ -50,6 +50,7 @@ public:
// bool resize(Report& report, const QString& deviceNode, qint64 length) const override; // bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
// bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override; // bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
bool updateUUID(Report& report, const QString& deviceNode) const override; bool updateUUID(Report& report, const QString& deviceNode) const override;
bool canMount(const QString & deviceNode, const QString & mountPoint) const override;
CommandSupportType supportGetUsed() const override { CommandSupportType supportGetUsed() const override {
return m_GetUsed; return m_GetUsed;

View File

@ -23,4 +23,11 @@ unknown::unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, cons
FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Unknown) FileSystem(firstsector, lastsector, sectorsused, label, FileSystem::Unknown)
{ {
} }
bool unknown::canMount(const QString & deviceNode, const QString & mountPoint) const
{
Q_UNUSED(deviceNode)
Q_UNUSED(mountPoint)
return false;
}
} }

View File

@ -39,6 +39,7 @@ public:
bool supportToolFound() const override { bool supportToolFound() const override {
return true; return true;
} }
bool canMount(const QString & deviceNode, const QString & mountPoint) const override;
}; };
} }