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 763909 - Update deprecated code
Update deprecated code
Status: RESOLVED FIXED
Product: libchamplain
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libchamplain-maint
libchamplain-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-19 10:19 UTC by Nayan Deshmukh
Modified: 2016-04-02 10:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Update deprecated clutter code (1.46 KB, patch)
2016-03-19 10:21 UTC, Nayan Deshmukh
none Details | Review
Update deprecated libsoup code (2.41 KB, patch)
2016-03-22 10:34 UTC, Nayan Deshmukh
none Details | Review
Update deprecated gdk_cursor method (1.22 KB, patch)
2016-03-30 14:48 UTC, Nayan Deshmukh
none Details | Review
Update deprecated gdk_cursor method (1.19 KB, patch)
2016-04-02 09:19 UTC, Nayan Deshmukh
none Details | Review
Update deprecated gdk_cursor method (1.37 KB, patch)
2016-04-02 09:39 UTC, Nayan Deshmukh
none Details | Review
Update deprecated gdk_cursor method (1.38 KB, patch)
2016-04-02 10:01 UTC, Nayan Deshmukh
none Details | Review

Description Nayan Deshmukh 2016-03-19 10:19:20 UTC
update the deprecated CLUTTER_ACTOR_IS_REALIZED method with clutter_actor_is_realized method.
Comment 1 Nayan Deshmukh 2016-03-19 10:21:29 UTC
Created attachment 324328 [details] [review]
Update deprecated clutter code

Update the deprecated CLUTTER_ACTOR_IS_REALIZED method
with clutter_actor_is_realized method
Comment 2 Nayan Deshmukh 2016-03-22 10:34:12 UTC
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.
Comment 3 Nayan Deshmukh 2016-03-22 10:38:10 UTC
Some stats ubuntu >=14.04, fedora >=19, OpenSUSE >=13.1 has libsoup >=2.42.
Comment 4 Jiri Techet 2016-03-23 15:23:46 UTC
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.
Comment 5 Nayan Deshmukh 2016-03-23 16:36:49 UTC
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.
Comment 6 Nayan Deshmukh 2016-03-23 17:35:45 UTC
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?
Comment 7 Jiri Techet 2016-03-23 18:44:50 UTC
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.
Comment 8 Nayan Deshmukh 2016-03-26 14:04:26 UTC
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.
Comment 9 Nayan Deshmukh 2016-03-30 14:48:08 UTC
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
Comment 10 Jiri Techet 2016-04-02 09:11:53 UTC
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.
Comment 11 Nayan Deshmukh 2016-04-02 09:19:14 UTC
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
Comment 12 Jiri Techet 2016-04-02 09:32:37 UTC
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.
Comment 13 Nayan Deshmukh 2016-04-02 09:39:38 UTC
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
Comment 14 Nayan Deshmukh 2016-04-02 09:40:32 UTC
Sorry for the previous patch I was not aware of it.
Comment 15 Jiri Techet 2016-04-02 09:57:25 UTC
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').
Comment 16 Nayan Deshmukh 2016-04-02 10:01:19 UTC
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
Comment 17 Jiri Techet 2016-04-02 10:14:01 UTC
Success :)
Comment 18 Nayan Deshmukh 2016-04-02 10:17:26 UTC
Thanks for being patient with me :)