Disable some characters in FAT label input.
This commit is contained in:
parent
fbf7e78efe
commit
0f2ab468eb
|
@ -25,6 +25,7 @@
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <QRegularExpressionValidator>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
@ -101,6 +102,13 @@ qint64 fat16::maxLabelLength() const
|
||||||
return 11;
|
return 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QValidator* fat16::labelValidator(QObject *parent) const
|
||||||
|
{
|
||||||
|
QRegularExpressionValidator *m_LabelValidator = new QRegularExpressionValidator(parent);
|
||||||
|
m_LabelValidator->setRegularExpression(QRegularExpression(QStringLiteral(R"(^[^*?.,;:\/\\|+=<>\[\]"]*$)")));
|
||||||
|
return m_LabelValidator;
|
||||||
|
}
|
||||||
|
|
||||||
qint64 fat16::readUsedCapacity(const QString& deviceNode) const
|
qint64 fat16::readUsedCapacity(const QString& deviceNode) const
|
||||||
{
|
{
|
||||||
ExternalCommand cmd(QStringLiteral("fsck.fat"), { QStringLiteral("-n"), QStringLiteral("-v"), deviceNode });
|
ExternalCommand cmd(QStringLiteral("fsck.fat"), { QStringLiteral("-n"), QStringLiteral("-v"), deviceNode });
|
||||||
|
|
|
@ -88,6 +88,7 @@ public:
|
||||||
qint64 minCapacity() const override;
|
qint64 minCapacity() const override;
|
||||||
qint64 maxCapacity() const override;
|
qint64 maxCapacity() const override;
|
||||||
qint64 maxLabelLength() const override;
|
qint64 maxLabelLength() const override;
|
||||||
|
QValidator* labelValidator(QObject *parent) const override;
|
||||||
SupportTool supportToolName() const override;
|
SupportTool supportToolName() const override;
|
||||||
bool supportToolFound() const override;
|
bool supportToolFound() const override;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue