Code Monkey home page Code Monkey logo

Comments (4)

diwic avatar diwic commented on September 28, 2024 1
code = code.replace(
  ".annotate(\"org.freedesktop.DBus.Property.EmitsChangedSignal\", \"true\")",
  ".emits_changed_true()",

Well, if it's that simple, consider it done :-) Let me know if it works as expected now. Thanks!

from dbus-rs.

diwic avatar diwic commented on September 28, 2024

Hi!

.get(|_, t: &mut T| t.test_property())

I just pushed a commit that does just what it suggest. Can you try it and see if it resolves the problem for you?

An another thing that I also notice, is that the annotation for the EmitsChangedSignal is ignored and a call to .changed_msg_fn() is not generated. Is that expected?

I guess it is, given the comment I found in the code :-/

        if p.can_set() {
            // TODO: Handle EmitsChangedSignal correctly here.
            *s += &format!("\n            .set(|_, t, value| t.{}(value).map(|_| None))", p.set_fn_name);
        }

from dbus-rs.

anagno avatar anagno commented on September 28, 2024

I just pushed a commit that does just what it suggest. Can you try it and see if it resolves the problem for you?

It does. Thank you for the fix !

I guess it is, given the comment I found in the code :-/

For the moment as a workaround I am just doing in the build.rs something like

    code = code.replace(
        ".annotate(\"org.freedesktop.DBus.Property.EmitsChangedSignal\", \"true\")",
        ".emits_changed_true()",
    );

Probably it could be also a way of implementing in the future. Detect if the value of the annotation is org.freedesktop.DBus.Property.EmitsChangedSignal and depending on the value replace it with the correct calling function ...

from dbus-rs.

anagno avatar anagno commented on September 28, 2024

It works as expected! Thank you !

from dbus-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.