DataSourceRegistry should have GetDataSourceForId method

Bug #691690 reported by Jeremy Whiting
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
Low
Siegfried Gevatter

Bug Description

DataSourceRegistry should have a way to get a DataSource from it's id especially because the DataSourceEnabled signal only sends an id rather than a DataSource in the signal.

Related branches

Seif Lotfy (seif)
Changed in zeitgeist:
status: New → Confirmed
milestone: none → 0.7.0
Changed in zeitgeist:
assignee: nobody → Siegfried Gevatter (rainct)
status: Confirmed → In Progress
Revision history for this message
Siegfried Gevatter (rainct) wrote :

OK, so as I see it there are various ways to fix this:

a) Not a bug - If they care about data-sources they should keep track of them (GetDataSources at start and DataSourceRegistered after that). However, what should be fixed is the DataSourceDisconnected signal, it is currently sending the whole data-source information while just the unique id should be enough.

b) Change DataSourceEnabled to send the whole data-source, so it's consistent with DataSourceRegistered and DataSourceDisconnected.

c) Leave DataSourceEnabled as it is, fix DataSourceDisconnected to only return the unique id (see A) and add a GetDataSourceForId method.

Personally I don't see what a) or b) would bring us. If you're a data-source yourself you'll probably just want to check whether the ID is yours to know what happened to you. If you're a data-source management GUI, which wants to update the information when something is enabled/disabled, you'll be keep track of all data-sources anyway, through a GetDataSources call at startup and successive updates thanks to DataSourceRegistered signals. This means that when you get a DataSourceEnabled signal you already have the information about the event, and getting a full copy of it won't make your work any easier than just having the unique ID.

Changed in zeitgeist:
importance: Undecided → Low
status: In Progress → New
Revision history for this message
Jeremy Whiting (jeremy-whiting) wrote :

Ah, I see, yeah I agree with the analysis above. I suggest solution c at this point.

Seif Lotfy (seif)
Changed in zeitgeist:
status: New → Confirmed
Revision history for this message
Siegfried Gevatter (rainct) wrote :

(Uhm, I had send out an e-mail about this earlier but it looks like Launchpad lost it:)

There's a typo in my first comment, what I meant is "b) or c)", not "a) or b)". That is, the solution I'd prefer is a). After that I'd choose b), since a GetDataSourceForId method by itself (without the signals) isn't really useful -- you need to know the IDs to ask for them.

Thoughts?

Revision history for this message
Jeremy Whiting (jeremy-whiting) wrote :

Oh, I see what you meant. Yeah, b would be helpful I believe from our standpoint. Then the signals would be consistent.

Revision history for this message
Siegfried Gevatter (rainct) wrote :

Fine with me. Unless someone else comments, I'll implement solution b) once the branch I've currently waiting gets merged.

Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : Re: [Zeitgeist] [Bug 691690] Re: DataSourceRegistry should have GetDataSourceForId method

Siegfried; what you propose is breaking the DBus API, which will force
me to break ABI and API of libzeitgeist => mikkel becomes unpopular.

That said, I do see the merit in what you are proposing. It just has
some consequences...

Revision history for this message
Seif Lotfy (seif) wrote :

Solution b is not an option since as Mikkel stated it will break the API and ABI
I think we are stuck with adding the GetDataSourceForid method. It wont harm any1 and will satisfy the case we have

Seif Lotfy (seif)
Changed in zeitgeist:
milestone: 0.7.0 → 0.8.0
Changed in zeitgeist:
status: Confirmed → Fix Committed
Seif Lotfy (seif)
Changed in zeitgeist:
milestone: 0.8.0 → 0.8.1
Changed in zeitgeist:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.