[gnome-software/gnome-3-30] packagekit: Fire the new "reload" signal when the repo list changes
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-30] packagekit: Fire the new "reload" signal when the repo list changes
- Date: Tue, 18 Dec 2018 01:14:18 +0000 (UTC)
commit 74e7866d48779d5c3386280472b54c95ee948797
Author: Kalev Lember <klember redhat com>
Date: Mon Dec 17 18:11:17 2018 +0100
packagekit: Fire the new "reload" signal when the repo list changes
This also adapts the repositories dialog to connect to the "reload"
signal, instead of "updates-changed".
plugins/packagekit/gs-plugin-packagekit-refine.c | 12 +++++++++---
src/gs-repos-dialog.c | 9 ++++-----
2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/plugins/packagekit/gs-plugin-packagekit-refine.c
b/plugins/packagekit/gs-plugin-packagekit-refine.c
index a329cfcf..924b74a4 100644
--- a/plugins/packagekit/gs-plugin-packagekit-refine.c
+++ b/plugins/packagekit/gs-plugin-packagekit-refine.c
@@ -44,11 +44,17 @@ struct GsPluginData {
};
static void
-gs_plugin_packagekit_cache_invalid_cb (PkControl *control, GsPlugin *plugin)
+gs_plugin_packagekit_updates_changed_cb (PkControl *control, GsPlugin *plugin)
{
gs_plugin_updates_changed (plugin);
}
+static void
+gs_plugin_packagekit_repo_list_changed_cb (PkControl *control, GsPlugin *plugin)
+{
+ gs_plugin_reload (plugin);
+}
+
void
gs_plugin_initialize (GsPlugin *plugin)
{
@@ -56,9 +62,9 @@ gs_plugin_initialize (GsPlugin *plugin)
priv->client = pk_client_new ();
priv->control = pk_control_new ();
g_signal_connect (priv->control, "updates-changed",
- G_CALLBACK (gs_plugin_packagekit_cache_invalid_cb), plugin);
+ G_CALLBACK (gs_plugin_packagekit_updates_changed_cb), plugin);
g_signal_connect (priv->control, "repo-list-changed",
- G_CALLBACK (gs_plugin_packagekit_cache_invalid_cb), plugin);
+ G_CALLBACK (gs_plugin_packagekit_repo_list_changed_cb), plugin);
pk_client_set_background (priv->client, FALSE);
pk_client_set_cache_age (priv->client, G_MAXUINT);
diff --git a/src/gs-repos-dialog.c b/src/gs-repos-dialog.c
index 6f8ebacd..de9bc870 100644
--- a/src/gs-repos-dialog.c
+++ b/src/gs-repos-dialog.c
@@ -752,8 +752,7 @@ get_os_name (void)
}
static void
-updates_changed_cb (GsPluginLoader *plugin_loader,
- GsReposDialog *dialog)
+reload_cb (GsPluginLoader *plugin_loader, GsReposDialog *dialog)
{
reload_sources (dialog);
reload_third_party_repo (dialog);
@@ -763,8 +762,8 @@ static void
set_plugin_loader (GsReposDialog *dialog, GsPluginLoader *plugin_loader)
{
dialog->plugin_loader = g_object_ref (plugin_loader);
- g_signal_connect (dialog->plugin_loader, "updates-changed",
- G_CALLBACK (updates_changed_cb), dialog);
+ g_signal_connect (dialog->plugin_loader, "reload",
+ G_CALLBACK (reload_cb), dialog);
}
static void
@@ -773,7 +772,7 @@ gs_repos_dialog_dispose (GObject *object)
GsReposDialog *dialog = GS_REPOS_DIALOG (object);
if (dialog->plugin_loader != NULL) {
- g_signal_handlers_disconnect_by_func (dialog->plugin_loader, updates_changed_cb, dialog);
+ g_signal_handlers_disconnect_by_func (dialog->plugin_loader, reload_cb, dialog);
g_clear_object (&dialog->plugin_loader);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]