After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662852 - CheeseCameraDeviceMonitor::added should have CheeseCameraDevice argument
CheeseCameraDeviceMonitor::added should have CheeseCameraDevice argument
Status: RESOLVED FIXED
Product: cheese
Classification: Applications
Component: general
git master
Other Linux
: Normal enhancement
: 3.4
Assigned To: Patricia Santana Cruz
Cheese Maintainer(s)
Depends on:
Blocks: 603612
 
 
Reported: 2011-10-27 14:00 UTC by David King
Modified: 2011-10-28 15:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Improved CheeseCameraDeviceMonitor::added signal. (7.41 KB, patch)
2011-10-28 15:06 UTC, Patricia Santana Cruz
committed Details | Review

Description David King 2011-10-27 14:00:07 UTC
Currently, the CheeseCameraDeviceMonitor::added signal has several strings as arguments:

http://developer.gnome.org/cheese/unstable/CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-added

The ::removed signal has just the ID string:

http://developer.gnome.org/cheese/unstable/CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-removed

As the handler for the ::added signal inside CheeseCamera already creates a CheeseCameraDevice from these strings, the ::added signal should be changed to just provide a CheeseCameraDevice directly as an argument. The ::removed signal should also be changed to do the same. This would make the hotplug code inside CheeseCamera simpler, as it would not have to construct the CheeseCameraDevice.
Comment 1 Patricia Santana Cruz 2011-10-28 15:06:16 UTC
Created attachment 200177 [details] [review]
Improved CheeseCameraDeviceMonitor::added signal.

This patch should fix this bug. Regarding the ::removed signal, this was not possible due to the way that the device object is created. When a new cheese device is created, the device must be present, to retrieve all the information that is needed for its creation. Since the callback is call right after removing the device, and therefore, the device will not be present, cheese breaks prompting different errors to communicate what I just explained. Because of this reason, and until this is solved, we need to go on using the device *id as the argument of this signal.
Comment 2 David King 2011-10-28 15:40:22 UTC
Comment on attachment 200177 [details] [review]
Improved CheeseCameraDeviceMonitor::added signal.

Pushed to master as commit 054a929303468353537442b4ba77590449c90a73, thanks!