diff --git a/glabels/BarcodeBackends.cpp b/glabels/BarcodeBackends.cpp index 48956dc..bef51ca 100644 --- a/glabels/BarcodeBackends.cpp +++ b/glabels/BarcodeBackends.cpp @@ -22,9 +22,7 @@ #include "glbarcode/Factory.h" -#if HAVE_QRENCODE #include "BarcodeBackends/QrEncode.h" -#endif // HAVE_QRENCODE namespace glabels @@ -80,7 +78,7 @@ namespace glabels // registerBackend( "qrencode", "QREncode" ); - glbarcode::Factory::registerType( "qrencode::qrcode", barcode::QrEncode::createQrCode ); + glbarcode::Factory::registerType( "qrencode::qrcode", QrEncode::QrCode::create ); registerStyle( "qrcode", "qrencode", tr("IEC18004 (QRCode)"), false, false, true, false, "1234567890AB", false, 12 ); diff --git a/glabels/BarcodeBackends/QrEncode.cpp b/glabels/BarcodeBackends/QrEncode.cpp index bd5b27a..aa41e87 100644 --- a/glabels/BarcodeBackends/QrEncode.cpp +++ b/glabels/BarcodeBackends/QrEncode.cpp @@ -27,22 +27,22 @@ namespace glabels { - namespace barcode + namespace QrEncode { /* * Static QrCode barcode creation method */ - glbarcode::Barcode* QrEncode::createQrCode() + glbarcode::Barcode* QrCode::create() { - return new QrEncode(); + return new QrCode(); } /* - * QrEncode data validation, implements glbarcode::Barcode2dBase::validate() + * QrCode data validation, implements glbarcode::Barcode2dBase::validate() */ - bool QrEncode::validate( const std::string& rawData ) + bool QrCode::validate( const std::string& rawData ) { if ( rawData.size() == 0 ) { @@ -53,9 +53,9 @@ namespace glabels /* - * QrEncode data encoding, implements glbarcode::Barcode2dBase::encode() + * QrCode data encoding, implements glbarcode::Barcode2dBase::encode() */ - bool QrEncode::encode( const std::string& cookedData, glbarcode::Matrix& encodedData ) + bool QrCode::encode( const std::string& cookedData, glbarcode::Matrix& encodedData ) { QRcode *qrcode = QRcode_encodeString( cookedData.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1 ); if ( qrcode == NULL ) diff --git a/glabels/BarcodeBackends/QrEncode.h b/glabels/BarcodeBackends/QrEncode.h index a266d1e..641e41e 100644 --- a/glabels/BarcodeBackends/QrEncode.h +++ b/glabels/BarcodeBackends/QrEncode.h @@ -21,35 +21,37 @@ #ifndef barcode_QrEncode_h #define barcode_QrEncode_h +#if HAVE_QRENCODE #include "glbarcode/Barcode2dBase.h" namespace glabels { - namespace barcode + namespace QrEncode { /** - * LibQREncode barcode backend + * QrEncode::QrCode QR Code Barcode * * Implements glbarcode::Barcode2dBase. */ - class QrEncode : public glbarcode::Barcode2dBase + class QrCode : public glbarcode::Barcode2dBase { public: - static Barcode* createQrCode(); - + static Barcode* create(); private: bool validate( const std::string& rawData ) override; bool encode( const std::string& cookedData, glbarcode::Matrix& encodedData ) override; - }; } } + +#endif // HAVE_QRENCODE + #endif // barcode_QrEncode_h diff --git a/translations/glabels_C.ts b/translations/glabels_C.ts index 41e774b..fc227c4 100644 --- a/translations/glabels_C.ts +++ b/translations/glabels_C.ts @@ -744,62 +744,62 @@ glabels::BarcodeBackends - + POSTNET (any) - + POSTNET-5 (ZIP only) - + POSTNET-9 (ZIP+4) - + POSTNET-11 (DPBC) - + CEPNET - + USPS Intelligent Mail - + IEC16022 (DataMatrix) - + IEC18004 (QRCode) - + Code 39 - + Code 39 Extended - + UPC-A - + EAN-13