Skip to content
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

Add dbus method and mcetool option for requesting settings reset #250

Merged
merged 2 commits into from Feb 17, 2015
Merged

Add dbus method and mcetool option for requesting settings reset #250

merged 2 commits into from Feb 17, 2015

Conversation

spiiroin
Copy link
Contributor

No description provided.

Allows resetting mce settings back to defaults without needing to
know what the defaults are and/or stopping mce service.

To reset all settings to defaults, use:
  mcetool --reset-settings

To reset for example only display related settings, use:
  mcetool --reset-settings=/display/

[mce] Add dbus method for requesting settings reset. Fixes JB#24286
static const char *gconf_entry_get_default(const GConfEntry *entry)
{
/* Brightness values are a special because the config
* defaults use legacy 1-5 range and are migrated to
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this looks ugly. Doesn't it know whether or not it has already migrated the data, so that we can - in mce's source code - just place all the new values, and when mce is set up for the first time, the config is written "in the new format" (with the newer version number), but when an old config is opened, it's migrated (values converted + new format version number written into config).

IMHO this whole function is just a workaround for what should be handled on the settings side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whether the migration has happened is deduced from the values. On startup all values are either in legacy/current state. During reset they change one by one. But I'll check if there is some way to deal with it without causing ringing on dbus / misfiring re-migration etc.

@thp
Copy link

thp commented Feb 17, 2015

I'd like to get the special handling of pre-migrated keys removed. Other than that, looks good.

For the brightness migration to work, it needs needs all three related
settings to be either in legacy or current state. Dealing with this
by using special logic during settings reset is efficient but not nice.

By forcing refreshing of all three values during sanitizing of the trio
we effectively do re-migration from reset defaults again. This adds
otherwise unneeded cpu load to normal brightness setting change, but
the amount of extra work is negligible.
spiiroin added a commit that referenced this pull request Feb 17, 2015
Add dbus method  and mcetool option for requesting settings reset
@spiiroin spiiroin merged commit 409352e into nemomobile:master Feb 17, 2015
@spiiroin spiiroin deleted the jb24286_config_reset branch February 17, 2015 10:11
@thp
Copy link

thp commented Feb 17, 2015

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants