diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:33 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:33 +0200 |
| commit | e1c678ef00f0159bbeb5571e5ebb0d4697121334 (patch) | |
| tree | 6547edef81a62a812a4d0f64e03fda226b5f0a7e /validators | |
| parent | b9daa22c4c3ad51cd4bc0ef624a19f21d01c9305 (diff) | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
Update upstream source from tag 'upstream/3.0.0_rc1+repack'
Update to upstream version '3.0.0~rc1+repack'
with Debian dir 68c212e23136fecf9ebc6f12ff355579224d27ee
Diffstat (limited to 'validators')
| -rwxr-xr-x | validators/LiveFrequencyValidator.cpp | 8 | ||||
| -rwxr-xr-x | validators/LiveFrequencyValidator.hpp | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/validators/LiveFrequencyValidator.cpp b/validators/LiveFrequencyValidator.cpp index 01034c54..6bd826d7 100755 --- a/validators/LiveFrequencyValidator.cpp +++ b/validators/LiveFrequencyValidator.cpp @@ -14,6 +14,7 @@ LiveFrequencyValidator::LiveFrequencyValidator (QComboBox * combo_box , Bands const * bands
, FrequencyList_v2_101 const * frequencies
, Frequency const * nominal_frequency
+ , bool kHz_without_k
, QWidget * parent)
: QRegExpValidator {
QRegExp { // frequency in MHz or band
@@ -33,6 +34,7 @@ LiveFrequencyValidator::LiveFrequencyValidator (QComboBox * combo_box , frequencies_ {frequencies}
, nominal_frequency_ {nominal_frequency}
, combo_box_ {combo_box}
+ , kHz_without_k_ {kHz_without_k}
{
}
@@ -49,7 +51,7 @@ void LiveFrequencyValidator::fixup (QString& input) const QRegExpValidator::fixup (input);
if (!bands_->oob ().startsWith (input))
{
- if (input.contains ('m', Qt::CaseInsensitive))
+ if (input.contains ('m', Qt::CaseSensitive))
{
input = input.toLower ();
@@ -70,7 +72,7 @@ void LiveFrequencyValidator::fixup (QString& input) const input = QString {};
}
}
- else if (input.contains (QChar {'k'}, Qt::CaseInsensitive))
+ else if ((input.contains (QChar {'k'}, Qt::CaseInsensitive)) or (kHz_without_k_ && !input.contains (QChar {'M'}, Qt::CaseSensitive)))
{
// kHz in current MHz input
auto f = Radio::frequency (input.remove (QChar {'k'}, Qt::CaseInsensitive), 3);
@@ -81,7 +83,7 @@ void LiveFrequencyValidator::fixup (QString& input) const else
{
// frequency input
- auto f = Radio::frequency (input, 6);
+ auto f = Radio::frequency (input.remove (QChar {'M'}, Qt::CaseSensitive), 6);
input = bands_->find (f);
Q_EMIT valid (f);
}
diff --git a/validators/LiveFrequencyValidator.hpp b/validators/LiveFrequencyValidator.hpp index 48c78dc1..7f19c25a 100755 --- a/validators/LiveFrequencyValidator.hpp +++ b/validators/LiveFrequencyValidator.hpp @@ -5,6 +5,7 @@ #include <QRegExpValidator>
#include "Radio.hpp"
+#include "Configuration.hpp"
class Bands;
class FrequencyList_v2_101;
@@ -37,6 +38,7 @@ public: , Bands const * bands // bands model
, FrequencyList_v2_101 const * frequencies // working frequencies model
, Frequency const * nominal_frequency
+ , bool kHz_without_k
, QWidget * parent = nullptr);
State validate (QString& input, int& pos) const override;
@@ -49,6 +51,7 @@ private: FrequencyList_v2_101 const * frequencies_;
Frequency const * nominal_frequency_;
QComboBox * combo_box_;
+ bool kHz_without_k_ = false;
};
#endif
|
