gsettings

Reading gsettings from C++ program

末鹿安然 提交于 2019-12-25 16:42:47
问题 I need to programmatically get the value of com.ubuntu.user-interface scale-factor from gsettings in my C++ program. Is there any elegant way to do this, instead of calling gsettings binary and parsing it's output? 回答1: There is a C++ binding to gsettings in glibmm. With it, reading a value from a schema can be done as shown below. Note that I do not have an Ubuntu system on which to test this, so specifics rely on a short look into the documentation that told me scale-factor is an integral

meld - GLib-GIO-ERROR**: No GSettings schemas are installed on the system

不羁的心 提交于 2019-12-13 01:13:29
问题 I have installed meld 3.14.2, at last (on NFS share in Redhat 6.3 server), after nearly 40 hours of efforts , installing each and every dependency and at last seems to be successful. But one finale error needs to be solved: (meld:20703): GLib-GIO-ERROR **: No GSettings schemas are installed on the system Trace/breakpoint trap (core dumped) There was answer here: GLib-GIO-ERROR**: No GSettings schemas are installed on the system I am not aware of these jargons before. So, please explain in

How to handle errors while using Glib.Settings in Vala?

帅比萌擦擦* 提交于 2019-12-07 09:44:23
问题 I am using Glib.Settings in my Vala application. And I want to make sure that my program will work okay even when the schema or key is not available. So I've added a try/catch block, but if I'm using the key that doesn't exist, the program segfaults. As I understood, it doesn't even reach the catch statement. Here is the function that uses settings: GLib.Settings settings; string token = ""; try { settings = new GLib.Settings (my_scheme); token = settings.get_string("token1"); } catch (Error

How to handle errors while using Glib.Settings in Vala?

◇◆丶佛笑我妖孽 提交于 2019-12-05 17:27:00
I am using Glib.Settings in my Vala application. And I want to make sure that my program will work okay even when the schema or key is not available. So I've added a try/catch block, but if I'm using the key that doesn't exist, the program segfaults. As I understood, it doesn't even reach the catch statement. Here is the function that uses settings: GLib.Settings settings; string token = ""; try { settings = new GLib.Settings (my_scheme); token = settings.get_string("token1"); } catch (Error e) { print("error"); token = ""; } return token; And the program output is: (main:27194): GLib-GIO