[gnome-software/wip/temp/ubuntu-xenial-rebased: 329/329] More mis-rebase fixes
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/temp/ubuntu-xenial-rebased: 329/329] More mis-rebase fixes
- Date: Fri, 29 Apr 2016 14:13:01 +0000 (UTC)
commit 347c42b3cdf81b727c864c10b4951cad3fd43bab
Author: Iain Lane <iain orangesquash org uk>
Date: Fri Apr 29 10:44:30 2016 +0100
More mis-rebase fixes
src/gs-application.c | 6 +++---
src/gs-plugin-loader.c | 9 +++------
src/gs-shell-details.c | 27 +++++++++++++++------------
src/gs-utils.c | 24 ++++++++++++++++++++++++
4 files changed, 45 insertions(+), 21 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index d827443..4579e75 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -254,7 +254,7 @@ refreshed_cb (GObject *source_object,
if (gs_plugin_loader_refresh_finish (loader, res, NULL)) {
gs_plugin_loader_refresh_async (loader,
0,
- GS_PLUGIN_REFRESH_FLAGS_UPDATES | GS_PLUGIN_REFRESH_FLAGS_UI,
+ GS_PLUGIN_REFRESH_FLAGS_UI,
NULL,
NULL,
NULL);
@@ -270,7 +270,7 @@ start_refresh (GsApplication *app)
gs_plugin_loader_refresh_async (gs_application_get_plugin_loader (app),
0,
- GS_PLUGIN_REFRESH_FLAGS_UPDATES | GS_PLUGIN_REFRESH_FLAGS_UI,
+ GS_PLUGIN_REFRESH_FLAGS_PAYLOAD | GS_PLUGIN_REFRESH_FLAGS_UI,
NULL,
refreshed_cb,
app);
@@ -524,7 +524,7 @@ offline_update_cb (GsPluginLoader *plugin_loader,
{
g_autoptr(GDBusConnection) bus = NULL;
g_autoptr(GError) error = NULL;
- if (!gs_plugin_loader_offline_update_finish (plugin_loader, res, &error)) {
+ if (!gs_plugin_loader_update_finish (plugin_loader, res, &error)) {
g_warning ("Failed to trigger offline update: %s", error->message);
return;
}
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 1492bdb..1b35dff 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2679,8 +2679,6 @@ gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
break;
case GS_PLUGIN_LOADER_ACTION_SET_REVIEW:
state->function_name = "gs_plugin_app_set_review";
- state->state_success = AS_APP_STATE_UNKNOWN;
- state->state_failure = AS_APP_STATE_UNKNOWN;
break;
default:
g_assert_not_reached ();
@@ -3642,7 +3640,6 @@ gs_plugin_loader_file_to_app_thread_cb (GTask *task,
const gchar *function_name = "gs_plugin_file_to_app";
gboolean ret = TRUE;
GError *error = NULL;
- GList *l;
GsPluginLoaderAsyncState *state = (GsPluginLoaderAsyncState *) task_data;
GsPlugin *plugin;
GsPluginFileToAppFunc plugin_func = NULL;
@@ -3668,7 +3665,7 @@ gs_plugin_loader_file_to_app_thread_cb (GTask *task,
plugin->name,
function_name);
g_rw_lock_reader_lock (&plugin->rwlock);
- ret = plugin_func (plugin, &state->list, state->filename,
+ ret = plugin_func (plugin, &state->list, state->file,
cancellable, &error_local);
g_rw_lock_reader_unlock (&plugin->rwlock);
if (!ret) {
@@ -3751,7 +3748,7 @@ gs_plugin_loader_file_to_app_async (GsPluginLoader *plugin_loader,
/* run in a thread */
task = g_task_new (plugin_loader, cancellable, callback, user_data);
g_task_set_task_data (task, state, (GDestroyNotify) gs_plugin_loader_free_async_state);
- g_task_run_in_thread (task, gs_plugin_loader_filename_to_app_thread_cb);
+ g_task_run_in_thread (task, gs_plugin_loader_file_to_app_thread_cb);
}
/**
@@ -3903,7 +3900,7 @@ gs_plugin_loader_update_async (GsPluginLoader *plugin_loader,
/* run in a thread */
task = g_task_new (plugin_loader, cancellable, callback, user_data);
g_task_set_task_data (task, state, (GDestroyNotify) gs_plugin_loader_free_async_state);
- g_task_run_in_thread (task, gs_plugin_loader_offline_update_thread_cb);
+ g_task_run_in_thread (task, gs_plugin_loader_update_thread_cb);
}
/**
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 1f1c381..e2ac370 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1197,9 +1197,9 @@ gs_shell_details_filename_to_app_cb (GObject *source,
}
/* save app */
g_set_object (&self->app,
- gs_plugin_loader_filename_to_app_finish(plugin_loader,
- res,
- &error));
+ gs_plugin_loader_file_to_app_finish(plugin_loader,
+ res,
+ &error));
if (self->app == NULL) {
GtkWidget *dialog;
@@ -1251,16 +1251,19 @@ gs_shell_details_filename_to_app_cb (GObject *source,
void
gs_shell_details_set_filename (GsShellDetails *self, const gchar *filename)
{
+ g_autoptr(GFile) file = NULL;
+
gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_LOADING);
- gs_plugin_loader_filename_to_app_async (self->plugin_loader,
- filename,
- GS_PLUGIN_REFINE_FLAGS_DEFAULT |
- GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
- GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
- GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
- self->cancellable,
- gs_shell_details_filename_to_app_cb,
- self);
+ file = g_file_new_for_path (filename);
+ gs_plugin_loader_file_to_app_async (self->plugin_loader,
+ file,
+ GS_PLUGIN_REFINE_FLAGS_DEFAULT |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
+ GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
+ self->cancellable,
+ gs_shell_details_filename_to_app_cb,
+ self);
}
/**
diff --git a/src/gs-utils.c b/src/gs-utils.c
index 345caf3..6e11971 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -623,4 +623,28 @@ gs_utils_widget_set_custom_css (GtkWidget *widget, const gchar *css)
g_object_unref);
}
+/**
+ * gs_utils_get_desktop_app_info:
+ */
+GDesktopAppInfo *
+gs_utils_get_desktop_app_info (const gchar *id)
+{
+ GDesktopAppInfo *app_info;
+
+ /* try to get the standard app-id */
+ app_info = g_desktop_app_info_new (id);
+
+ /* KDE is a special project because it believes /usr/share/applications
+ * isn't KDE enough. For this reason we support falling back to the
+ * "kde4-" prefixed ID to avoid educating various self-righteous
+ * upstreams about the correct ID to use in the AppData file. */
+ if (app_info == NULL) {
+ g_autofree gchar *kde_id = NULL;
+ kde_id = g_strdup_printf ("%s-%s", "kde4", id);
+ app_info = g_desktop_app_info_new (kde_id);
+ }
+
+ return app_info;
+}
+
/* vim: set noexpandtab: */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]