-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to GSettings #470
Port to GSettings #470
Conversation
This refactors the configuration infrastructure away from the deprecated GConf library and towards GSettings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this migration.
Looks like you know what you are doing, good !
waf
has a buit-in functionality to install schemas (#64 (comment)).
Let's use that standard if possible ?
About that, from https://developer.gnome.org/GSettings/
There are several examples in the wild of projects that use .gschema.xml.in files.
This is almost always wrong.
You should absolutely never use intltool or itstool-based XML "translation merging" functionality with schema files.
So that will need to be changed as well, to be standard,
but let's wait for @GeraldJansen to review and test this first.
Another link https://developer.gnome.org/gio/stable/GSettings.html
the default values in GSettings schemas can be localized
But maybe are you also already familiar with this internationalization stuff ?
src/hamster/idle.py
Outdated
client = gconf.Client.get_default() | ||
self.timeout_minutes = client.get_int(delay_key) | ||
settings = gio.Settings() | ||
self.timeout_minutes = client.get_value(delay_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A guess
self.timeout_minutes = client.get_value(delay_key) | |
self.timeout_minutes = settings.get_value(delay_key) |
Not sure about the importance of this build message:
and also
Then
|
Works for me. |
The one thing that I wonder is whether we should rename the schema. I
realized only after I finished the patch that the schema name really
ought to rename the DBus name.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes found while looking for the schema name.
@bgamari The DBus interface should remain stable ( Line 52 in 3375db5
So we should keep this name. Maybe one day this application will get back under the gnome organization umbrella; that's not planned, but who knows. @GeraldJansen Does it mean that we should rename the database directory to |
For me, .local/share/hamster-time-tracker is consistent with /usr/share/hamster-time-tracker and other installation directories and file names. Either rename everything to just hamster or use hamster-time-tracker consistently, I'd say. |
Agreed. |
@GeraldJansen would you have time to implement the directory names changes (#472) and |
@ederag I'm willing to try. |
@GeraldJansen If @bgamari is not available at this time |
@ederag Well, I'm out of my depth here, both concerning advanced git techniques and gsettings. I've created a replacement PR (take 2) with a single additional commit (1e08ebe) which merges in current master and adds a couple minimal changes. If you prefer to add the last commit to this PR and close the other, that would be fine by me too. |
That went well, thanks ! |
Tried to contact @bgamari also by private email but got no response. |
external, desktop and idle have to be removed first (#493), |
@ederag I am currently traveling and will not be able to work on this until January. Please feel free to proceed. |
Sure, already started (that's why it was added to maintenance). |
https://developer.gnome.org/GSettings/ > You should absolutely never use intltool or itstool-based XML > "translation merging" functionality with schema files.
@bgamari Your PR was great, only slightly polished.
Is it OK to merge ? |
The schema localization works on openSUSE Leap-15.1, after an update of the french > LANGUAGE=fr gsettings describe org.gnome.Hamster last-report-folder
Le dernier répertoire utilisé pour enregistrer un rapport @bgamari |
This refactors the configuration infrastructure away from the deprecated
GConf library and towards GSettings.