Skip to content

Commit 65a94ad

Browse files
committed
build: Use version suffix instead of name suffix
Over the last cycles, apps added to GNOME core are not using the suffix in their names for development versions. Instead, they are adding a suffix to the app version following the running commit. Since it simplifies build files a bit and translators work, let's go that route as well.
1 parent 15de64f commit 65a94ad

8 files changed

+16
-19
lines changed

data/com.mattjakeman.ExtensionManager.desktop.in.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Desktop Entry]
2-
Name=@app_title@
2+
Name=Extension Manager
33
Exec=extension-manager %U
44
Icon=@app_id@
55
Terminal=false

data/com.mattjakeman.ExtensionManager.metainfo.xml.in.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<id>@app_id@.desktop</id>
44
<metadata_license>CC0-1.0</metadata_license>
55
<project_license>GPL-3.0-or-later</project_license>
6-
<name>@app_title@</name>
6+
<name>Extension Manager</name>
77
<summary>Browse, install, and manage GNOME Shell Extensions</summary>
88
<content_rating type="oars-1.1" />
99
<developer_name translatable="no">Matthew Jakeman</developer_name>

data/meson.build

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
desktop_file_in_config = configuration_data()
22
desktop_file_in_config.set('app_id', app_id)
3-
desktop_file_in_config.set('app_title', app_title)
4-
desktop_file_in_config.set('app_version', meson.project_version())
53
desktop_file_in = configure_file(
64
input: 'com.mattjakeman.ExtensionManager.desktop.in.in',
75
output: '@0@.desktop.in'.format(app_id),
@@ -26,7 +24,6 @@ endif
2624

2725
appconf = configuration_data()
2826
appconf.set('app_id', app_id)
29-
appconf.set('app_title', app_title)
3027
appstream_file_in = configure_file(
3128
input: 'com.mattjakeman.ExtensionManager.metainfo.xml.in.in',
3229
output: 'com.mattjakeman.ExtensionManager.metainfo.xml.in',

meson.build

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,26 @@ project('extension-manager', 'c',
99
i18n = import('i18n')
1010

1111
if get_option('development')
12-
app_title = 'Extension Manager (Development)'
1312
app_id = 'com.mattjakeman.ExtensionManager.Devel'
13+
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
14+
if vcs_tag == ''
15+
version_suffix = '-devel'
16+
else
17+
version_suffix = '-@0@'.format(vcs_tag)
18+
endif
1419
else
15-
app_title = 'Extension Manager'
1620
app_id = 'com.mattjakeman.ExtensionManager'
21+
version_suffix = ''
1722
endif
1823

1924
config_h = configuration_data()
20-
config_h.set_quoted('APP_VERSION', meson.project_version())
25+
config_h.set_quoted('APP_VERSION', meson.project_version() + version_suffix)
2126
config_h.set_quoted('GETTEXT_PACKAGE', 'extension-manager')
2227
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
2328
config_h.set_quoted('APP_ID', app_id)
2429
config_h.set_quoted('PKG_NAME', get_option('package'))
2530
config_h.set_quoted('PKG_DISTRIBUTOR', get_option('distributor'))
2631
config_h.set10('IS_OFFICIAL', get_option('official'))
27-
config_h.set10('IS_DEVEL', get_option('development'))
2832
config_h.set10('WITH_BACKTRACE', get_option('backtrace'))
2933
configure_file(
3034
output: 'exm-config.h',

src/exm-application.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,12 @@ exm_application_show_about (GSimpleAction *action,
168168

169169
window = gtk_application_get_active_window (GTK_APPLICATION (self));
170170

171-
about_window = adw_about_window_new_from_appdata ("/com/mattjakeman/ExtensionManager/com.mattjakeman.ExtensionManager.metainfo.xml", APP_VERSION);
171+
about_window = adw_about_window_new_from_appdata ("/com/mattjakeman/ExtensionManager/com.mattjakeman.ExtensionManager.metainfo.xml",
172+
strstr (APP_ID, ".Devel") == NULL ? APP_VERSION : NULL);
172173
gtk_window_set_modal (GTK_WINDOW (about_window), TRUE);
173174
gtk_window_set_transient_for (GTK_WINDOW (about_window), window);
174175

176+
adw_about_window_set_version (ADW_ABOUT_WINDOW (about_window), APP_VERSION);
175177
adw_about_window_set_comments (ADW_ABOUT_WINDOW (about_window), _("Browse, install, and manage GNOME Shell Extensions."));
176178
adw_about_window_set_developers (ADW_ABOUT_WINDOW (about_window), authors);
177179
adw_about_window_set_translator_credits (ADW_ABOUT_WINDOW (about_window), _("translator-credits"));

src/exm-error-dialog.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ exm_error_dialog_set_property (GObject *object,
101101
GString *string_builder = g_string_new ("Support Log\n");
102102
g_string_append_printf (string_builder, "----\n");
103103
g_string_append_printf (string_builder, "Version: %s\n", APP_VERSION);
104-
g_string_append_printf (string_builder, "Development: %s\n", IS_DEVEL ? "Yes" : "No");
105104
g_string_append_printf (string_builder, "Package Format: %s\n", PKG_NAME);
106105
g_string_append_printf (string_builder, "Status: %s\n", IS_OFFICIAL ? "Official" : "Third Party");
107106
g_string_append_printf (string_builder, "----\n");

src/exm-window.blp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ template $ExmWindow : Adw.ApplicationWindow {
66
default-height: 600;
77
width-request: 360;
88
height-request: 294;
9+
title: _("Extension Manager");
910

1011
Adw.Breakpoint main_breakpoint {
1112
condition ("max-width: 400sp")
@@ -20,6 +21,7 @@ template $ExmWindow : Adw.ApplicationWindow {
2021

2122
Adw.NavigationPage main_view {
2223
can-pop: false;
24+
title: bind template.title;
2325

2426
Adw.ToolbarView {
2527

src/exm-window.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,22 +454,15 @@ do_version_check (ExmWindow *self)
454454
static void
455455
exm_window_init (ExmWindow *self)
456456
{
457-
gchar *title;
458-
459457
gtk_widget_init_template (GTK_WIDGET (self));
460458

461-
if (IS_DEVEL) {
459+
if (strstr (APP_ID, ".Devel") != NULL) {
462460
gtk_widget_add_css_class (GTK_WIDGET (self), "devel");
463461
}
464462

465463
self->manager = exm_manager_new ();
466464
g_signal_connect (self->manager, "error-occurred", on_error, self);
467465

468-
title = IS_DEVEL ? _("Extension Manager (Development)") : _("Extension Manager");
469-
470-
gtk_window_set_title (GTK_WINDOW (self), title);
471-
adw_navigation_page_set_title (self->main_view, title);
472-
473466
g_object_set (self->installed_page, "manager", self->manager, NULL);
474467
g_object_set (self->browse_page, "manager", self->manager, NULL);
475468
g_object_set (self->detail_view, "manager", self->manager, NULL);

0 commit comments

Comments
 (0)