Skip to content

Commit a56d506

Browse files
rbujraveit65
authored andcommitted
Read authors (updated) from pluma.about file
1 parent e27a451 commit a56d506

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

pluma/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ AM_CPPFLAGS = \
1313
$(WARN_CFLAGS) \
1414
$(INTROSPECTION_CFLAGS) \
1515
-DDATADIR=\""$(datadir)"\" \
16+
-DPLUMA_DATADIR=\""$(datadir)/pluma"\" \
1617
-DLIBDIR=\""$(libdir)"\"
1718

1819
pluma_SOURCES = \
@@ -172,13 +173,19 @@ pluma-marshal.c: pluma-marshal.list $(GLIB_GENMARSHAL)
172173
$(AM_V_GEN) echo "#include \"pluma-marshal.h\"" > $@ && \
173174
$(GLIB_GENMARSHAL) $< --body --prefix=pluma_marshal >> $@
174175

176+
aboutdir = $(datadir)/pluma/
177+
about_DATA = \
178+
pluma.about \
179+
$(NULL)
180+
175181
uidir = $(datadir)/pluma/ui/
176182
ui_DATA = \
177183
pluma-ui.xml \
178184
pluma-print-preferences.ui
179185

180186
EXTRA_DIST = \
181187
$(ui_DATA) \
188+
$(about_DATA) \
182189
pluma-enum-types.h.template \
183190
pluma-enum-types.c.template \
184191
pluma-marshal.list \

pluma/pluma-commands-help.c

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <config.h>
3636
#endif
3737

38+
#include <glib.h>
3839
#include <glib/gi18n.h>
3940
#include <gtk/gtk.h>
4041

@@ -50,21 +51,11 @@ void _pluma_cmd_help_contents(GtkAction* action, PlumaWindow* window)
5051
pluma_help_display(GTK_WINDOW(window), NULL, NULL);
5152
}
5253

54+
#define ABOUT_GROUP "About"
55+
#define EMAILIFY(string) (g_strdelimit ((string), "%", '@'))
56+
5357
void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
5458
{
55-
static const gchar* const authors[] = {
56-
"Paolo Maggi <paolo@gnome.org>",
57-
"Paolo Borelli <pborelli@katamail.com>",
58-
"Steve Fr\303\251cinaux <steve@istique.net>",
59-
"Jesse van den Kieboom <jessevdk@gnome.org>",
60-
"Ignacio Casal Quinteiro <icq@gnome.org>",
61-
"James Willcox <jwillcox@gnome.org>",
62-
"Chema Celorio",
63-
"Federico Mena Quintero <federico@novell.com>",
64-
"Perberos <perberos@gmail.com>",
65-
NULL
66-
};
67-
6859
static const gchar* documenters[] = {
6960
N_("MATE Documentation Team"),
7061
N_("GNOME Documentation Team"),
@@ -90,10 +81,28 @@ void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
9081
};
9182

9283
gchar *license_trans;
84+
GKeyFile *key_file;
85+
GError *error = NULL;
86+
char **authors;
87+
gsize n_authors = 0, i;
9388
static const gchar **p;
9489

9590
pluma_debug (DEBUG_COMMANDS);
9691

92+
key_file = g_key_file_new ();
93+
if (!g_key_file_load_from_file (key_file, PLUMA_DATADIR G_DIR_SEPARATOR_S "pluma.about", 0, &error)) {
94+
g_warning ("Couldn't load about data: %s\n", error->message);
95+
g_error_free (error);
96+
g_key_file_free (key_file);
97+
return;
98+
}
99+
100+
authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL);
101+
g_key_file_free (key_file);
102+
103+
for (i = 0; i < n_authors; ++i)
104+
authors[i] = EMAILIFY (authors[i]);
105+
97106
license_trans = g_strjoin ("\n\n", _(license[0]), _(license[1]), _(license[2]), NULL);
98107

99108
for (p = documenters; *p; ++p)
@@ -119,5 +128,6 @@ void _pluma_cmd_help_about(GtkAction* action, PlumaWindow* window)
119128
"website", "http://mate-desktop.org",
120129
NULL);
121130

131+
g_strfreev (authors);
122132
g_free (license_trans);
123133
}

pluma/pluma-dirs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ gchar* pluma_dirs_get_user_accels_file(void)
6969

7070
gchar* pluma_dirs_get_pluma_data_dir(void)
7171
{
72-
return g_build_filename(DATADIR, "pluma", NULL);
72+
return g_build_filename(PLUMA_DATADIR, NULL);
7373
}
7474

7575
gchar* pluma_dirs_get_pluma_locale_dir(void)

pluma/pluma.about

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[About]
2+
Authors=Adam Erdman <hekel%archlinux.info>;Alexander van der Meij <alexandervdm%gliese.me>;Alexander von Gluck IV <kallisti5%unixzen.com>;Andrew Fowlie <andrew.j.fowlie%qq.com>;Balló György <ballogyor%gmail.com>;Björn Esser <besser82%fedoraproject.org>;Clement Lefebvre <clement.lefebvre%linuxmint.com>;Daggerbot <daggerbot%gmail.com>;Gabriel Cormier-Affleck <bl0ckedusersoft%gmail.com>;Ignacio Casal Quinteiro <icq%gnome.org>;John Church <sleeveroller%gmail.com>;Marcel Dijkstra <marcel.dykstra%gmail.com>;Martin Wimpress <martin%mate-desktop.org>;OBATA Akio <obache%users.noreply.github.com>;Pablo Barciela <scow%riseup.net>;Paolo Borelli <pborelli%gnome.org>;Patrick Monnerat <pm%datasphere.ch>;Perberos <perberos%gmail.com>;Piotr Drąg <piotrdrag%gmail.com>;Robert Buj <robert.buj%gmail.com>;Ryan Q <ryan.q%linux.com>;Sander Sweers <infirit%gmail.com>;Sorokin Alexei <sor.alexei%meowr.ru>;Stefano Karapetsas <stefano%karapetsas.com>;Steve Zesch <stevezesch2%gmail.com>;Sébastien Wilmet <wilmet%gnome.org>;V.Barkov <neverscaired%gmail.com>;Vadim Barkov <vbrkov%gmail.com>;Vlad Orlov <monsta%inbox.ru>;Wolfgang Ulbrich <mate%raveit.de>;Wu Xiaotian <yetist%gmail.com>;Yaakov Selkowitz <yselkowitz%users.sourceforge.net>;ZenWalker <scow%riseup.net>;

0 commit comments

Comments
 (0)