Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KFind
Commits
47a4f001
Commit
47a4f001
authored
Jul 13, 2021
by
Ahmad Samir
Browse files
Drop KDigitalValidator class, hasn't been used by anything in a long time
parent
dce809f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/kftabdlg.cpp
View file @
47a4f001
...
...
@@ -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
//*******************************************************
...
...
src/kftabdlg.h
View file @
47a4f001
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment