[gnome-software] trivial: Rename some internal GsPlugin functionality
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Rename some internal GsPlugin functionality
- Date: Wed, 8 Jun 2016 20:13:22 +0000 (UTC)
commit 57d3df4412e56008a1668d5c4b413751b9071f0e
Author: Richard Hughes <richard hughsie com>
Date: Wed Jun 8 20:46:22 2016 +0100
trivial: Rename some internal GsPlugin functionality
src/gs-plugin-loader.c | 30 +++++++++++++++---------------
src/gs-plugin-private.h | 6 +++---
src/gs-plugin.c | 21 ++++++++++-----------
3 files changed, 28 insertions(+), 29 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 835f174..28e384e 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -221,7 +221,7 @@ gs_plugin_loader_run_adopt (GsPluginLoader *plugin_loader, GsAppList *list)
guint i;
guint j;
- /* go through each plugin in priority order */
+ /* go through each plugin in order */
for (i = 0; i < priv->plugins->len; i++) {
GsPluginAdoptAppFunc adopt_app_func = NULL;
GsPlugin *plugin = g_ptr_array_index (priv->plugins, i);
@@ -3340,9 +3340,9 @@ gs_plugin_loader_plugin_sort_fn (gconstpointer a, gconstpointer b)
{
GsPlugin **pa = (GsPlugin **) a;
GsPlugin **pb = (GsPlugin **) b;
- if (gs_plugin_get_priority (*pa) < gs_plugin_get_priority (*pb))
+ if (gs_plugin_get_order (*pa) < gs_plugin_get_order (*pb))
return -1;
- if (gs_plugin_get_priority (*pa) > gs_plugin_get_priority (*pb))
+ if (gs_plugin_get_order (*pa) > gs_plugin_get_order (*pb))
return 1;
return 0;
}
@@ -3449,15 +3449,15 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
}
if (!gs_plugin_get_enabled (dep))
continue;
- if (gs_plugin_get_priority (plugin) <= gs_plugin_get_priority (dep)) {
+ if (gs_plugin_get_order (plugin) <= gs_plugin_get_order (dep)) {
g_debug ("%s [%i] to be ordered after %s [%i] "
"so promoting to [%i]",
gs_plugin_get_name (plugin),
- gs_plugin_get_priority (plugin),
+ gs_plugin_get_order (plugin),
gs_plugin_get_name (dep),
- gs_plugin_get_priority (dep),
- gs_plugin_get_priority (dep) + 1);
- gs_plugin_set_priority (plugin, gs_plugin_get_priority (dep) + 1);
+ gs_plugin_get_order (dep),
+ gs_plugin_get_order (dep) + 1);
+ gs_plugin_set_order (plugin, gs_plugin_get_order (dep) + 1);
changes = TRUE;
}
}
@@ -3478,15 +3478,15 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
}
if (!gs_plugin_get_enabled (dep))
continue;
- if (gs_plugin_get_priority (plugin) >= gs_plugin_get_priority (dep)) {
+ if (gs_plugin_get_order (plugin) >= gs_plugin_get_order (dep)) {
g_debug ("%s [%i] to be ordered before %s [%i] "
"so promoting to [%i]",
gs_plugin_get_name (plugin),
- gs_plugin_get_priority (plugin),
+ gs_plugin_get_order (plugin),
gs_plugin_get_name (dep),
- gs_plugin_get_priority (dep),
- gs_plugin_get_priority (dep) + 1);
- gs_plugin_set_priority (dep, gs_plugin_get_priority (plugin) + 1);
+ gs_plugin_get_order (dep),
+ gs_plugin_get_order (dep) + 1);
+ gs_plugin_set_order (dep, gs_plugin_get_order (plugin) + 1);
changes = TRUE;
}
}
@@ -3523,7 +3523,7 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
}
}
- /* sort by priority */
+ /* sort by order */
g_ptr_array_sort (priv->plugins,
gs_plugin_loader_plugin_sort_fn);
@@ -3587,7 +3587,7 @@ gs_plugin_loader_dump_state (GsPluginLoader *plugin_loader)
plugin = g_ptr_array_index (priv->plugins, i);
g_debug ("[%s]\t%i\t->\t%s",
gs_plugin_get_enabled (plugin) ? "enabled" : "disabld",
- gs_plugin_get_priority (plugin),
+ gs_plugin_get_order (plugin),
gs_plugin_get_name (plugin));
}
}
diff --git a/src/gs-plugin-private.h b/src/gs-plugin-private.h
index caf6df1..ea318f2 100644
--- a/src/gs-plugin-private.h
+++ b/src/gs-plugin-private.h
@@ -40,9 +40,9 @@ void gs_plugin_action_start (GsPlugin *plugin,
void gs_plugin_action_stop (GsPlugin *plugin);
void gs_plugin_set_scale (GsPlugin *plugin,
guint scale);
-guint gs_plugin_get_priority (GsPlugin *plugin);
-void gs_plugin_set_priority (GsPlugin *plugin,
- guint priority);
+guint gs_plugin_get_order (GsPlugin *plugin);
+void gs_plugin_set_order (GsPlugin *plugin,
+ guint order);
void gs_plugin_set_locale (GsPlugin *plugin,
const gchar *locale);
void gs_plugin_set_profile (GsPlugin *plugin,
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index 26dc443..4a19832 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -67,7 +67,7 @@ typedef struct
gchar *locale; /* allow-none */
gchar *name;
gint scale;
- guint priority;
+ guint order;
guint timer_id;
GMutex timer_mutex;
} GsPluginPrivate;
@@ -391,34 +391,34 @@ gs_plugin_set_scale (GsPlugin *plugin, guint scale)
}
/**
- * gs_plugin_get_priority:
+ * gs_plugin_get_order:
* @plugin: a #GsPlugin
*
- * Gets the plugin priority, where higher numbers are run after lower
+ * Gets the plugin order, where higher numbers are run after lower
* numbers.
*
* Returns: the integer value
**/
guint
-gs_plugin_get_priority (GsPlugin *plugin)
+gs_plugin_get_order (GsPlugin *plugin)
{
GsPluginPrivate *priv = gs_plugin_get_instance_private (plugin);
- return priv->priority;
+ return priv->order;
}
/**
- * gs_plugin_set_priority:
+ * gs_plugin_set_order:
* @plugin: a #GsPlugin
- * @priority: a integer value
+ * @order: a integer value
*
- * Sets the plugin priority, where higher numbers are run after lower
+ * Sets the plugin order, where higher numbers are run after lower
* numbers.
**/
void
-gs_plugin_set_priority (GsPlugin *plugin, guint priority)
+gs_plugin_set_order (GsPlugin *plugin, guint order)
{
GsPluginPrivate *priv = gs_plugin_get_instance_private (plugin);
- priv->priority = priority;
+ priv->order = order;
}
/**
@@ -1050,7 +1050,6 @@ gs_plugin_init (GsPlugin *plugin)
priv->rules[i] = g_ptr_array_new_with_free_func (g_free);
priv->enabled = TRUE;
- priv->priority = 0.f;
priv->scale = 1;
priv->profile = as_profile_new ();
priv->cache = g_hash_table_new_full (g_str_hash,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]