[gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 325/331] More mis-rebase fixes
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 325/331] More mis-rebase fixes
- Date: Wed, 4 May 2016 14:25:51 +0000 (UTC)
commit 66b66a134a18526367192354b41c341218d7b758
Author: Iain Lane <iain orangesquash org uk>
Date: Fri Apr 29 10:44:30 2016 +0100
More mis-rebase fixes
src/gs-application.c | 4 ++--
src/gs-plugin-loader.c | 8 +++-----
src/gs-shell-details.c | 27 +++++++++++++++------------
src/gs-utils.c | 24 ++++++++++++++++++++++++
4 files changed, 44 insertions(+), 19 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 8d7381e..dfc353c 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);
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index b480f06..fe73929 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2676,8 +2676,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 ();
@@ -3665,7 +3663,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) {
@@ -3755,7 +3753,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);
}
/**
@@ -3907,7 +3905,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]