[gnome-software] Small code cleanup
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Small code cleanup
- Date: Fri, 23 Aug 2013 22:33:07 +0000 (UTC)
commit 1ebc8af332ee7d23d3f2a2552baf64e6be6b1c67
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Aug 23 18:32:08 2013 -0400
Small code cleanup
gtk_builder_new_from_resource is preferable, since this can't really
fail, so the GError argument of gtk_builder_add_from_resource is
a distraction.
src/gs-shell.c | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index eda7a54..725f4a1 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -269,8 +269,6 @@ gs_shell_set_overview_mode_cb (GsShellOverview *shell_overview,
GtkWindow *
gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *cancellable)
{
- GError *error = NULL;
- gint retval;
GsShellPrivate *priv = shell->priv;
GtkWidget *main_window = NULL;
GtkWidget *widget;
@@ -281,16 +279,7 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
priv->cancellable = g_object_ref (cancellable);
/* get UI */
- priv->builder = gtk_builder_new ();
- retval = gtk_builder_add_from_resource (priv->builder,
- "/org/gnome/software/gnome-software.ui",
- &error);
- if (retval == 0) {
- g_warning ("failed to load ui: %s",
- error->message);
- g_error_free (error);
- goto out;
- }
+ priv->builder = gtk_builder_new_from_resource ("/org/gnome/software/gnome-software.ui");
/* add application specific icons to search path */
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
@@ -357,7 +346,7 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
/* show main UI */
gtk_widget_show (main_window);
gs_shell_set_overview_mode (shell, priv->app_startup_mode, NULL, NULL);
-out:
+
return GTK_WINDOW (main_window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]