GNOME Bugzilla – Bug 763909
Update deprecated code
Last modified: 2016-04-02 10:17:26 UTC
update the deprecated CLUTTER_ACTOR_IS_REALIZED method with clutter_actor_is_realized method.
Created attachment 324328 [details] [review] Update deprecated clutter code Update the deprecated CLUTTER_ACTOR_IS_REALIZED method with clutter_actor_is_realized method
Created attachment 324530 [details] [review] Update deprecated libsoup code Replaced deprected soup_session_async_new_with_options () method with the soup_session_new_with_options(). Since most of the distros come with libsoup >2.42.
Some stats ubuntu >=14.04, fedora >=19, OpenSUSE >=13.1 has libsoup >=2.42.
The soup patch looks fine to me. The clutter_actor_is_realized one however depends on too new clutter version so I'd rather keep using the old way for now. However, if you want to fix one more depreciation warning, I'm getting champlain-label.c: In function 'pick': champlain-label.c:273:3: warning: 'cogl_set_source_color4ub' is deprecated (declared at /usr/include/cogl/cogl/cogl1-context.h:675) [-Wdeprecated-declarations] cogl_set_source_color4ub (color->red, ^ during the compilation (plus once more in champlain-point.c). The pick() method in which it is called determines the area where mouse events should be passed to the actor - this is done by "drawing" the actor shape with the provided color which is set using cogl_set_source_color4ub(). From the documentation it's not clear to me what should be used instead of cogl_set_source_color4ub() - I haven't investigated this myself but you could search for some existing code or maybe ask on the clutter mailing list what the up-to-date way to set color for the pick() operation is.
I agree with you the CLUTTER_ACTOR_IS_REALIZED patch requires new clutter and should be avoided for now. I had looked at the warning in champlain-label, we need to provide a cogl pipeline argument to cogl_set_source_color4ub. I am working on it.
In cogl 2.0 CoglMaterials is replaced by CoglPipeine, but some clutter public apis depend on CoglMaterials so clutter creates a CoglMaterials class itself. Since we are importing clutter in libchamplain so we can use cogl_set_source_color4ub(). If we want to use CoglPipeline we need to import cogl in libchamplain explicitly. Any thoughts Jiri?
I think it's no problem to include cogl explicitly - cogl is required by clutter and we depend on it anyway so it should be available.
If we want to avoid the use of cogl_set_source_color4ub() then we need to supply an additional pipeline argument to cogl_path_fill() but when I checked the cogl-1.22 branch it was behind the master and the cogl_path_fill() was the old method which takes only one argument. So at the moment, we have work with the deprecated method.
Created attachment 325020 [details] [review] Update deprecated gdk_cursor method Update the deprecated gdk_cursor_new() method with the gdk_cursor_new_for_display() method
Review of attachment 325020 [details] [review]: You mustn't unref the display returned by gdk_display_get_default() - it's a singleton. This just makes any demo crash on my machine.
Created attachment 325208 [details] [review] Update deprecated gdk_cursor method Update the deprecated gdk_cursor_new() method with the gdk_cursor_new_for_display() method
Review of attachment 325208 [details] [review]: Forgot to mention before - please declare GdkDisplay *display at the beginning of the function. With the coding style libchamplain uses variables are declared at the beginning of a function or a block.
Created attachment 325209 [details] [review] Update deprecated gdk_cursor method Update the deprecated gdk_cursor_new() method with the gdk_cursor_new_for_display() method
Sorry for the previous patch I was not aware of it.
Review of attachment 325209 [details] [review]: No problem. By the way this is still not what I had in my mind - just declare the variable at the top but assign it at the place where you originally did (similar thing is done with the variable 'stage').
Created attachment 325212 [details] [review] Update deprecated gdk_cursor method Update the deprecated gdk_cursor_new() method with the gdk_cursor_new_for_display() method
Success :)
Thanks for being patient with me :)