[gnome-documents] utils: Simplify gd_show_about_dialog
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] utils: Simplify gd_show_about_dialog
- Date: Wed, 7 Jun 2017 19:39:48 +0000 (UTC)
commit 82982e3794c85e9de09994d6612401b8b6c3679d
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Jun 7 20:37:41 2017 +0200
utils: Simplify gd_show_about_dialog
Some of the values needed by the AboutDialog are already available by
other means. Since we are using GLib.set_application_name, there is no
need to explicitly set GtkAboutDialog:program-name. Similarly the
icon-name of the log is the same as the application ID. There is no
need to duplicate them.
https://bugzilla.gnome.org/show_bug.cgi?id=783527
src/lib/gd-utils.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index d319482..bc40059 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -23,6 +23,7 @@
#include "gd-utils.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gio/gio.h>
#include <glib/gi18n.h>
#include <string.h>
#include <math.h>
@@ -302,6 +303,8 @@ void
gd_show_about_dialog (GtkWindow *parent,
gboolean is_books)
{
+ GApplication *app;
+
const char *artists[] = {
"Jakub Steiner <jimmac gmail com>",
NULL
@@ -315,20 +318,19 @@ gd_show_about_dialog (GtkWindow *parent,
NULL
};
- const char *program_name, *comments, *logo_icon_name, *website;
+ const char *app_id, *comments, *website;
+
+ app = g_application_get_default ();
+ app_id = g_application_get_application_id (app);
if(!is_books)
{
- program_name = _("Documents");
comments = _("A document manager application");
- logo_icon_name = "org.gnome.Documents";
website = "https://wiki.gnome.org/Apps/Documents";
}
else
{
- program_name = _("Books");
comments = _("An e-books manager application");
- logo_icon_name = "org.gnome.Books";
website = "https://wiki.gnome.org/Apps/Books";
}
@@ -336,9 +338,8 @@ gd_show_about_dialog (GtkWindow *parent,
"artists", artists,
"authors", authors,
"translator-credits", _("translator-credits"),
- "program-name", program_name,
"comments", comments,
- "logo-icon-name", logo_icon_name,
+ "logo-icon-name", app_id,
"website", website,
"copyright", "Copyright © 2011-2014 Red Hat, Inc.",
"license-type", GTK_LICENSE_GPL_2_0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]