Commit 69f0efd3 authored by Volker Krause's avatar Volker Krause
Browse files

Clean up no longer needed context date in the barcode JS API

parent 46fe5a68
...@@ -145,7 +145,6 @@ ExtractorResult ExtractorScriptEngine::execute(const ScriptExtractor *extractor, ...@@ -145,7 +145,6 @@ ExtractorResult ExtractorScriptEngine::execute(const ScriptExtractor *extractor,
}); });
d->m_jsonLdApi->setContextDate(node.contextDateTime()); d->m_jsonLdApi->setContextDate(node.contextDateTime());
d->m_barcodeApi->setContextDate(node.contextDateTime());
const auto nodeArg = d->m_engine.toScriptValue(node); const auto nodeArg = d->m_engine.toScriptValue(node);
const auto dataArg = nodeArg.property(QLatin1String("content")); const auto dataArg = nodeArg.property(QLatin1String("content"));
......
...@@ -97,11 +97,6 @@ QVariant JsApi::Barcode::toBitArray(const QVariant &b) const ...@@ -97,11 +97,6 @@ QVariant JsApi::Barcode::toBitArray(const QVariant &b) const
return QVariant::fromValue(JsApi::BitArray(b.toByteArray())); return QVariant::fromValue(JsApi::BitArray(b.toByteArray()));
} }
void JsApi::Barcode::setContextDate(const QDateTime &dt)
{
m_contextDate = dt;
}
QString JsApi::Barcode::byteArrayToString(const QVariant &b) const QString JsApi::Barcode::byteArrayToString(const QVariant &b) const
{ {
const auto ba = b.toByteArray(); const auto ba = b.toByteArray();
......
...@@ -70,14 +70,12 @@ public: ...@@ -70,14 +70,12 @@ public:
Q_INVOKABLE QString byteArrayToString(const QVariant &b) const; Q_INVOKABLE QString byteArrayToString(const QVariant &b) const;
///@cond internal ///@cond internal
void setContextDate(const QDateTime &dt);
void setDecoder(BarcodeDecoder *decoder); void setDecoder(BarcodeDecoder *decoder);
///@endcond ///@endcond
private: private:
QString decodeBarcode(const QVariant &img, BarcodeDecoder::BarcodeTypes hints) const; QString decodeBarcode(const QVariant &img, BarcodeDecoder::BarcodeTypes hints) const;
QDateTime m_contextDate;
BarcodeDecoder *m_decoder = nullptr; BarcodeDecoder *m_decoder = nullptr;
}; };
......
Supports Markdown
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