@dusted/anqst 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/src/emit.js +8 -1
  2. package/package.json +1 -1
package/dist/src/emit.js CHANGED
@@ -1287,6 +1287,7 @@ function renderWidgetHeader(spec, cppTypes, cppCodecCatalog) {
1287
1287
  }
1288
1288
  else {
1289
1289
  publicSlots.push(`void ${member.name}Slot(const ${cppType}& value);`);
1290
+ fields.push(`bool m_${member.name}Published{false};`);
1290
1291
  }
1291
1292
  }
1292
1293
  else if (member.kind === "DropTarget" && member.payloadTypeText) {
@@ -1885,7 +1886,12 @@ function renderCppStub(spec, cppTypes, cppCodecCatalog) {
1885
1886
  lines.push("}");
1886
1887
  lines.push("");
1887
1888
  lines.push(`void ${widgetClassName}::set${cap}(const ${cppType}& value) {`);
1888
- lines.push(` if (m_${member.name} == value) return;`);
1889
+ if (member.kind === "Output") {
1890
+ lines.push(` if (m_${member.name}Published && m_${member.name} == value) return;`);
1891
+ }
1892
+ else {
1893
+ lines.push(` if (m_${member.name} == value) return;`);
1894
+ }
1889
1895
  if (member.kind === "Output") {
1890
1896
  lines.push(` QVariant encodedValue;`);
1891
1897
  lines.push(` try {`);
@@ -1919,6 +1925,7 @@ function renderCppStub(spec, cppTypes, cppCodecCatalog) {
1919
1925
  }
1920
1926
  lines.push(` m_${member.name} = value;`);
1921
1927
  if (member.kind === "Output") {
1928
+ lines.push(` m_${member.name}Published = true;`);
1922
1929
  lines.push(` setOutputValue(QStringLiteral("${service.name}"), QStringLiteral("${member.name}"), encodedValue);`);
1923
1930
  }
1924
1931
  lines.push(` emit ${member.name}Changed(value);`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dusted/anqst",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Opinionated backend generator for webapps.",
5
5
  "keywords": [
6
6
  "nodejs",