Commit 0c70c66a authored by Andrius Štikonas's avatar Andrius Štikonas

Disable MountPointDialog for swap, lvm pv and unknown partitions.

parent 3d57b321
......@@ -21,6 +21,7 @@
#include "util/externalcommand.h"
#include <KLocalizedString>
#include <QDebug>
namespace FS
{
......@@ -134,9 +135,9 @@ QString linuxswap::unmountTitle() const
bool linuxswap::canMount(const QString& deviceNode, const QString& mountPoint) const {
Q_UNUSED(deviceNode);
Q_UNUSED(mountPoint);
// 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)
......
......@@ -110,4 +110,11 @@ bool lvm2_pv::updateUUID(Report& report, const QString& deviceNode) const
ExternalCommand cmd(report, QStringLiteral("lvm"), { QStringLiteral("pvchange"), QStringLiteral("--uuid"), deviceNode });
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;
}
}
......@@ -50,6 +50,7 @@ public:
// bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
// bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
bool updateUUID(Report& report, const QString& deviceNode) const override;
bool canMount(const QString & deviceNode, const QString & mountPoint) const override;
CommandSupportType supportGetUsed() const override {
return m_GetUsed;
......
......@@ -23,4 +23,11 @@ unknown::unknown(qint64 firstsector, qint64 lastsector, qint64 sectorsused, cons
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;
}
}
......@@ -39,6 +39,7 @@ public:
bool supportToolFound() const override {
return true;
}
bool canMount(const QString & deviceNode, const QString & mountPoint) const override;
};
}
......
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