Merge lp://qastaging/~3v1n0/libindicator/parent-object-fixes into lp://qastaging/libindicator/0.5

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Ted Gould
Approved revision: 451
Merged at revision: 445
Proposed branch: lp://qastaging/~3v1n0/libindicator/parent-object-fixes
Merge into: lp://qastaging/libindicator/0.5
Diff against target: 207 lines (+68/-17)
3 files modified
libindicator/indicator-object.c (+26/-1)
tests/dummy-indicator-signaler.c (+17/-4)
tests/test-loader.c (+25/-12)
To merge this branch: bzr merge lp://qastaging/~3v1n0/libindicator/parent-object-fixes
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Charles Kerr (community) Needs Fixing
Review via email: mp+90083@code.qastaging.launchpad.net

Description of the change

IndicatorObjectEntry's parent_object value doesn't get set by libindicator.
I think this is somewhat that the library should take care of, instead of delegating that to the child indicators.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Having indicator-object take care of this makes sense.

In indicator_object_entry_being_removed() and indicator_object_entry_was_added(), the assignment to entry->parent_object should be unconditional and come before the "if (function_pointer != NULL)" blocks, just as the assignment to EntryPrivate's 'visibility' field is.

Also, just wondering aloud -- do we have any use cases where an entry is reparented? Does it make sense to let this field be changed after construction?

review: Needs Fixing
Revision history for this message
Ted Gould (ted) wrote :

On Wed, 2012-01-25 at 13:21 +0000, charles wrote:
> Also, just wondering aloud -- do we have any use cases where an
> entry is reparented? Does it make sense to let this field be changed
> after construction?

No, since they're allocated in the memory space of the object that'd be
nearly impossible. I don't know that we have any way we could limit it
from changing though.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Having indicator-object take care of this makes sense.
>
> In indicator_object_entry_being_removed() and
> indicator_object_entry_was_added(), the assignment to entry->parent_object
> should be unconditional and come before the "if (function_pointer != NULL)"
> blocks, just as the assignment to EntryPrivate's 'visibility' field is.

Yes, your're right, and it's what I did on first place (see the first commit), but this was breaking the tests.
Because in test_loader_filename_dummy_signaler you're actually setting the entry pointer value to a defined invalid value (5), and you're currently avoiding crashes only because some class functions are set to NULL.

So, I was just wondering what to do here... I'd prefer to change the test by the way.

Revision history for this message
Charles Kerr (charlesk) wrote :

Ah, that makes sense. dummy-signaler predates this other entry-related code. Its the author probably just threw in a number because he didn't need a real entry, and an int pointer was fast & easy to test.

I agree with you, it would be better to bring the test up-to-date.

Revision history for this message
Ted Gould (ted) wrote :

On Wed, 2012-01-25 at 15:07 +0000, Marco Trevisan (Treviño) wrote:
> So, I was just wondering what to do here... I'd prefer to change the test
> by the way.

I think changing the test is the right answer. The tests shouldn't
restrict us from doing the right thing in the code that people actually
use.

448. By Marco Trevisan (Treviño)

IndicatorObject: update object parent in any case.

449. By Marco Trevisan (Treviño)

Tests: update dummy signaler to work with real IndicatorObjectEntry

This fixes a crash due to the parent/unparent.

450. By Marco Trevisan (Treviño)

Test loader: check also for parent changes

451. By Marco Trevisan (Treviño)

tests, DummyIndicatorSignaler: free the allocated memory.

Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches