summaryrefslogtreecommitdiff
path: root/search-provider
diff options
context:
space:
mode:
authorIain Lane <iain@orangesquash.org.uk>2017-12-06 19:01:12 +0000
committerIain Lane <iain@orangesquash.org.uk>2017-12-08 17:41:04 +0000
commit6a2b5bbd8b039a2b0d50dc14ddcf2ce5c75ed964 (patch)
treef8b172a617f490e069e2747b956f9fc5c2b15658 /search-provider
parent3f3c4bed874b9f8e6cbd071a292564d3006dccbb (diff)
downloadgnome-control-center-6a2b5bbd8b039a2b0d50dc14ddcf2ce5c75ed964.tar.gz
search-provider: Populate the model in startup
If the translations are stripped off into gettext .mo files, as happens on Ubuntu, we need to be operating in the right locale so that g_desktop_app_info_get_description (et al.) read them out correctly. Previously we were doing work in init(), which is after gtk_init() calls setlocale(). Move the population of the model to startup(), and chain up first, so that it happens after we're fully initialised (including the locale). https://bugzilla.gnome.org/show_bug.cgi?id=791035
Diffstat (limited to 'search-provider')
-rw-r--r--search-provider/control-center-search-provider.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/search-provider/control-center-search-provider.c b/search-provider/control-center-search-provider.c
index 78ecec3f7..dfe0dc51c 100644
--- a/search-provider/control-center-search-provider.c
+++ b/search-provider/control-center-search-provider.c
@@ -85,11 +85,7 @@ cc_search_provider_app_dispose (GObject *object)
static void
cc_search_provider_app_init (CcSearchProviderApp *self)
{
- self->model = cc_shell_model_new ();
- cc_panel_loader_fill_model (self->model);
-
self->search_provider = cc_search_provider_new ();
-
g_application_set_inactivity_timeout (G_APPLICATION (self),
INACTIVITY_TIMEOUT);
@@ -99,6 +95,19 @@ cc_search_provider_app_init (CcSearchProviderApp *self)
}
static void
+cc_search_provider_app_startup (GApplication *application)
+{
+ CcSearchProviderApp *self;
+
+ self = CC_SEARCH_PROVIDER_APP (application);
+
+ G_APPLICATION_CLASS (cc_search_provider_app_parent_class)->startup (application);
+
+ self->model = cc_shell_model_new ();
+ cc_panel_loader_fill_model (self->model);
+}
+
+static void
cc_search_provider_app_class_init (CcSearchProviderAppClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -108,6 +117,7 @@ cc_search_provider_app_class_init (CcSearchProviderAppClass *klass)
app_class->dbus_register = cc_search_provider_app_dbus_register;
app_class->dbus_unregister = cc_search_provider_app_dbus_unregister;
+ app_class->startup = cc_search_provider_app_startup;
}
CcShellModel *