Bug 53547

Summary: Add introspectable API to set the model in ConfigRec
Product: libxklavier Reporter: Manuel Quiñones <manuel.por.aca>
Component: GeneralAssignee: Sergey V. Udaltsov <svu>
Status: RESOLVED FIXED QA Contact: Sergey V. Udaltsov <svu>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Testcase

Description Manuel Quiñones 2012-08-15 17:42:19 UTC
Either adding a setter function for this field or registiring it as a gobject property.  Previously the Python bindings provided it:

  import xklavier
  configrec = xklavier.ConfigRec()
  configrec.set_model(model)

Now that's not possible with introspection.  The python test script does not show how to set the model.

http://cgit.freedesktop.org/libxklavier/tree/tests/test_gi.py

The bug I filed to pygobject is: https://bugzilla.gnome.org/show_bug.cgi?id=681566

And as they said the issue may be in libxklavier itself.
Comment 1 Sergey V. Udaltsov 2012-08-17 07:12:22 UTC
Actually, there is no set_model function in C either:) I will add it and make introspectable.
Comment 2 Sergey V. Udaltsov 2012-08-20 21:54:30 UTC
Committed. Please check.
Comment 3 Manuel Quiñones 2012-08-22 13:00:40 UTC
Created attachment 65953 [details] [review]
Testcase
Comment 4 Manuel Quiñones 2012-08-22 13:03:55 UTC
Thanks Sergey!  I attach a testcase for the python bindings, adds code to test_gi.py .  Is failing for me with:

  Changing model to "pc105"...
  Traceback (most recent call last):
    File "tests/test_gi.py", line 108, in <module>
      rec.set_model("pc105")
    File "/usr/lib64/python2.7/site-packages/gi/types.py", line 43, in function
      return info.invoke(*args, **kwargs)
  gi._glib.GError: Could not locate xkl_config_rec_set_model: `xkl_config_rec_set_model': /usr/lib64/libxklavier.so.16: undefined symbol: xkl_config_rec_set_model
Comment 5 Sergey V. Udaltsov 2012-08-22 13:05:27 UTC
Are you sure you rebuilt libxklavier?
What is the result of

ls -l /usr/lib64/libxklavier.so*
Comment 6 Manuel Quiñones 2012-08-22 13:13:49 UTC
I'm not installing it system-wide, after "make" I'm running the testcase with:

  LD_LIBRARY_PATH=libxklavier/.libs/ tests/test_gi.py

As commit caa0924e says.  Without my change, it success.  With it, it fails.
Comment 7 Daniel Narvaez 2012-08-22 14:11:34 UTC
I don't get this

Traceback (most recent call last):
  File "tests/test_gi.py", line 108, in <module>
    rec.set_model("pc105")
  File "/home/dnarvaez/Development/sugar-build/shell-port/install/lib64/python2.7/site-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: Could not locate xkl_config_rec_set_model: `xkl_config_rec_set_model': /home/dnarvaez/Development/sugar-build/shell-port/install/lib64/libxklavier.so.16: undefined symbol: xkl_config_rec_set_model


[sugar-build libxklavier]$ nm /home/dnarvaez/Development/sugar-build/shell-port/install/lib64/libxklavier.so.16 | grep xkl_config_rec_set_model
00000000000104a0 t xkl_config_rec_set_model
Comment 8 Sergey V. Udaltsov 2012-08-22 14:15:15 UTC
I think I know!

Check the file libxklavier/libxklavier.public! Please add that function there. Will that help?
Comment 9 Daniel Narvaez 2012-08-22 14:21:53 UTC
Yup, that works!
Comment 10 Sergey V. Udaltsov 2012-08-22 14:23:10 UTC
Will commit tonight
Comment 11 Manuel Quiñones 2012-08-22 14:29:10 UTC
Thanks!  Please commit also the testcase, to make me and Martin Pitt happy :)
Comment 12 Sergey V. Udaltsov 2012-08-22 20:18:05 UTC
should be ok now

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.