Commit 47a4f001 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Drop KDigitalValidator class, hasn't been used by anything in a long time

parent dce809f0
......@@ -54,9 +54,6 @@ struct MimeTypes
KfindTabWidget::KfindTabWidget(QWidget *parent)
: QTabWidget(parent)
{
// This validator will be used for all numeric edit fields
//KDigitValidator *digitV = new KDigitValidator(this);
// ************ Page One ************
pages[0] = new QWidget;
......@@ -833,31 +830,6 @@ void KfindTabWidget::slotUpdateByteComboBox(int value)
sizeUnitBox->setItemText(0, i18np("Byte", "Bytes", value));
}
/**
Digit validator. Allows only digits to be typed.
**/
KDigitValidator::KDigitValidator(QWidget *parent)
: QValidator(parent)
{
r = new QRegExp(QStringLiteral("^[0-9]*$"));
}
KDigitValidator::~KDigitValidator()
{
delete r;
}
QValidator::State KDigitValidator::validate(QString &input, int &) const
{
if (r->indexIn(input) < 0) {
// Beep on user if he enters non-digit
QApplication::beep();
return QValidator::Invalid;
} else {
return QValidator::Acceptable;
}
}
//*******************************************************
// Static utility functions
//*******************************************************
......
......@@ -11,7 +11,6 @@
#include <QMimeType>
#include <QTabWidget>
#include <QUrl>
#include <QValidator> // for KDigitValidator
class KUrlComboBox;
class QButtonGroup;
......@@ -21,7 +20,6 @@ class QCheckBox;
class KLineEdit;
class QString;
class QDate;
class QRegExp;
class KDateComboBox;
class KComboBox;
class QSpinBox;
......@@ -119,18 +117,4 @@ private:
QStringList m_AudioTypes;
};
class KDigitValidator : public QValidator
{
Q_OBJECT
public:
explicit KDigitValidator(QWidget *parent);
~KDigitValidator();
QValidator::State validate(QString &input, int &) const override;
private:
QRegExp *r;
};
#endif
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