diff options
author | Slávek Banko <[email protected]> | 2014-03-03 13:46:44 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2014-03-03 13:46:44 +0100 |
commit | 2e02da046d3e56cdf4744f644af35ad07424f48b (patch) | |
tree | f2dcf353aa2338eae1c2ff2c41af971c580c2762 /src/upcvalidator.cpp | |
parent | 3c13229d98167ae4ae0710d5eeef23fef5005bf0 (diff) | |
download | tellico-2e02da046d3e56cdf4744f644af35ad07424f48b.tar.gz tellico-2e02da046d3e56cdf4744f644af35ad07424f48b.zip |
Update to upstream version 1.3.6
Diffstat (limited to 'src/upcvalidator.cpp')
-rw-r--r-- | src/upcvalidator.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/upcvalidator.cpp b/src/upcvalidator.cpp index 73cc0d6..e3aca4e 100644 --- a/src/upcvalidator.cpp +++ b/src/upcvalidator.cpp @@ -13,6 +13,7 @@ #include "upcvalidator.h" #include "isbnvalidator.h" +#include "tellico_debug.h" #include <kmdcodec.h> @@ -24,7 +25,7 @@ UPCValidator::UPCValidator(TQObject* parent_, const char* name_/*=0*/) TQValidator::State UPCValidator::validate(TQString& input_, int& pos_) const { // check if it's a cuecat first - State catState = decodeCat(input_); + State catState = CueCat::decode(input_); if(catState == Acceptable) { pos_ = input_.length(); return catState; @@ -91,18 +92,18 @@ void UPCValidator::fixup(TQString& input_) const { } } -TQValidator::State UPCValidator::decodeCat(TQString& input_) const { +TQValidator::State Tellico::CueCat::decode(TQString& input_) { if(input_.length() < 3) { - return Intermediate; + return TQValidator::Intermediate; } if(!input_.startsWith(TQString::fromLatin1(".C3"))) { // all cuecat codes start with .C3 - return Invalid; + return TQValidator::Invalid; } const int periods = input_.contains('.'); if(periods < 4) { - return Intermediate; // not enough yet + return TQValidator::Intermediate; // not enough yet } else if(periods > 4) { - return Invalid; + return TQValidator::Invalid; } // ok, let's have a go, take the third token @@ -127,7 +128,7 @@ TQValidator::State UPCValidator::decodeCat(TQString& input_) const { } input_ = code; - return Acceptable; + return TQValidator::Acceptable; } #include "upcvalidator.moc" |