[gnome-dictionary/ebassi/for-master: 1/3] Add a development profile




commit 745fcb17851dc004fbc53ee91a98258417a7d40f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Sep 21 21:24:59 2020 +0100

    Add a development profile
    
    We begin the GNOME 40 development cycle by adding the ability to define
    a development build of Dictionary, with its own application identifier.
    
    We use the same application identifier across the binary, so that the
    shell can match our desktop file with it; and we use a different label
    in the About dialog, depending on whether we are using a development
    build or not.
    
    It's possible to enable the development build by using a build option;
    otherwise, we're going to check if the current version is one of the
    three development stages of a GNOME release.

 data/icons/meson.build                             |  6 +-
 data/icons/scalable/org.gnome.Dictionary.Devel.svg | 98 ++++++++++++++++++++++
 data/meson.build                                   | 15 +++-
 ...sktop.in => org.gnome.Dictionary.desktop.in.in} |  2 +-
 data/org.gnome.Dictionary.service.in               |  2 +-
 libgdict/meson.build                               |  4 +-
 meson.build                                        | 13 ++-
 meson_options.txt                                  |  1 +
 po/POTFILES.in                                     |  2 +-
 src/gdict-about.c                                  | 31 +++----
 src/gdict-app.c                                    |  4 +-
 src/gdict-common.c                                 | 10 +++
 src/gdict-common.h                                 |  4 +-
 src/main.c                                         |  2 +-
 src/meson.build                                    | 25 ++++--
 15 files changed, 182 insertions(+), 37 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 7b04bb9..1e5ad69 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,5 +1,7 @@
-install_data(
-  'scalable/org.gnome.Dictionary.svg',
+install_data([
+    'scalable/org.gnome.Dictionary.svg',
+    'scalable/org.gnome.Dictionary.Devel.svg',
+  ],
   install_dir: gdict_datadir / 'icons/hicolor/scalable/apps',
 )
 
diff --git a/data/icons/scalable/org.gnome.Dictionary.Devel.svg 
b/data/icons/scalable/org.gnome.Dictionary.Devel.svg
new file mode 100644
index 0000000..ab366be
--- /dev/null
+++ b/data/icons/scalable/org.gnome.Dictionary.Devel.svg
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink";>
+    <defs>
+        <linearGradient id="a" gradientUnits="userSpaceOnUse" x1="95.999944" x2="103.999944" y1="83" y2="83">
+            <stop offset="0" stop-color="#f6f5f4"/>
+            <stop offset="0.5" stop-color="#f6f5f4"/>
+            <stop offset="1" stop-color="#c0bfbc"/>
+        </linearGradient>
+        <filter id="b" height="100%" width="100%" x="0%" y="0%">
+            <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 
0"/>
+        </filter>
+        <mask id="c">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.3" height="128" width="128"/>
+            </g>
+        </mask>
+        <mask id="d">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.1" height="128" width="128"/>
+            </g>
+        </mask>
+        <mask id="e">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.3" height="128" width="128"/>
+            </g>
+        </mask>
+        <clipPath id="f">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <g id="g" clip-path="url(#f)">
+            <path d="m 26 8 h 2 v 72 h -2 z m 0 0" fill="#ffffff"/>
+        </g>
+        <mask id="h">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.1" height="128" width="128"/>
+            </g>
+        </mask>
+        <clipPath id="i">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <g id="j" clip-path="url(#i)">
+            <path d="m 236.000225 223.5 h 104 m -128 -16 h 65.5 m -33.5 -16 h 128 m -152 -16 h 128" 
stroke="#000000" stroke-linecap="round" stroke-width="8" transform="matrix(0.25 0 0 0.25 -0.000056 53.125)"/>
+        </g>
+        <clipPath id="k">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <clipPath id="l">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <mask id="m">
+            <g clip-path="url(#l)" filter="url(#b)">
+                <g clip-path="url(#k)">
+                    <path d="m 24 28 v 92 h 72 c 4.433594 0 8 -3.566406 8 -8 v -76 c 0 -4.433594 -3.566406 
-8 -8 -8 z m 0 0" fill="#26a269"/>
+                    <path d="m 26 48 v 70 h 70 c 4.433594 0 8 -3.566406 8 -8 v -54 c 0 -4.433594 -3.566406 
-8 -8 -8 z m 0 0" fill="url(#a)"/>
+                    <path d="m 24 16 v 66 h 72 c 4.433594 0 8 -3.566406 8 -8 v -50 c 0 -4.433594 -3.566406 
-8 -8 -8 z m 0 0" fill="#26a269"/>
+                    <path d="m 24 8 v 72 h 72 c 4.433594 0 8 -3.566406 8 -8 v -56 c 0 -4.433594 -3.566406 -8 
-8 -8 z m 0 0" fill="#2ec27e"/>
+                    <path d="m 24 20.125 h 80 v 48 h -80 z m 0 0" fill="#57e389"/>
+                    <use mask="url(#e)" xlink:href="#g"/>
+                    <use mask="url(#h)" xlink:href="#j"/>
+                    <path d="m 32 88.125 h 16 v 20 l -8 -7 l -8 7 z m 0 0" fill="#ed333b"/>
+                    <path d="m 49.96875 44.40625 c -0.878906 0 -1.160156 -0.121094 -1.039062 -0.519531 l 
3.558593 -8.960938 h 0.28125 l 3.28125 9.480469 z m -4.320312 8.160156 l 2.121093 -5.5625 c 0.199219 
-0.519531 0.441407 -0.679687 1.398438 -0.679687 h 7.601562 l 2.238281 6.519531 c 0.5625 1.640625 -1.078124 
1.480469 -2.957031 1.601562 c -0.242187 0.238282 -0.242187 1.121094 0 1.359376 c 1.480469 -0.039063 5.277344 
-0.078126 6.839844 -0.078126 c 1.640625 0 3.878906 0.039063 5.359375 0.078126 c 0.238281 -0.238282 0.238281 
-1.121094 0 -1.359376 c -1.558594 -0.121093 -2.878906 -0.121093 -3.601562 -2.160156 l -8.238282 -22.878906 c 
-0.601562 0.359375 -3 1.757812 -4.441406 1.757812 l -8.640625 20.480469 c -1.039063 2.480469 -2.277344 
2.679688 -4 2.800781 c -0.238281 0.238282 -0.238281 1.121094 0 1.359376 c 1.480469 -0.039063 2.203125 
-0.078126 3.761719 -0.078126 c 1.640625 0 3.839844 0.039063 5.320312 0.078126 c 0.238282 -0.238282 0.238282 
-1.121094 0 -1.359376 c -1.519531 -0.082031 -
 3.402344 -0.242187 -2.761718 -1.878906 z m 0 0" fill="#1f8455"/>
+                    <path d="m 79.992188 53.804688 c 0.277343 1.601562 1.359374 2.320312 3.117187 2.320312 c 
2.199219 0 3.761719 -0.839844 5.242187 -2.238281 c -0.121093 -0.441407 -0.28125 -0.761719 -0.722656 -1.121094 
c -0.519531 0.398437 -0.917968 0.558594 -1.679687 0.558594 c -0.878907 0 -1.117188 -0.71875 -1.117188 
-2.679688 l 0.078125 -5.757812 c 0 -5.761719 -3.558594 -6.921875 -6.839844 -6.921875 c -2.921874 0 -7.441406 
1.679687 -7.441406 4.320312 c 0 1.160156 0.480469 2.039063 2.082032 2.039063 c 1.398437 0 2.480468 -0.878907 
2.480468 -1.878907 c 0 -0.519531 -0.28125 -1.199218 -0.199218 -1.878906 c 0.078124 -0.441406 0.359374 
-0.921875 1.71875 -0.921875 c 1.679687 0 3.078124 0.71875 3.078124 5.800781 l -2.679687 0.839844 c -4.238281 
1.320313 -7.160156 2.480469 -7.160156 5.640625 c 0 2.757813 1.519531 4.199219 5 4.199219 c 1.160156 0 
3.480469 -1.28125 4.800781 -2.320312 z m -0.203126 -6.800782 v 5.28125 c -1 0.800782 -2 1.441406 -2.71875 
1.441406 c -1.71875 0 -2.320312 -1.1601
 56 -2.320312 -2.402343 c 0 -1.480469 0.121094 -2.679688 2.960938 -3.640625 z m 0 0" fill="#1f8455"/>
+                </g>
+            </g>
+        </mask>
+        <mask id="n">
+            <g filter="url(#b)">
+                <rect fill-opacity="0.8" height="128" width="128"/>
+            </g>
+        </mask>
+        <linearGradient id="o" gradientTransform="matrix(0 0.37 -0.98462 0 295.38501 -30.360001)" 
gradientUnits="userSpaceOnUse" x1="300" x2="428" y1="235" y2="235">
+            <stop offset="0" stop-color="#f9f06b"/>
+            <stop offset="1" stop-color="#f5c211"/>
+        </linearGradient>
+        <clipPath id="p">
+            <rect height="128" width="128"/>
+        </clipPath>
+        <clipPath id="q">
+            <rect height="128" width="128"/>
+        </clipPath>
+    </defs>
+    <path d="m 24 28 v 92 h 72 c 4.433594 0 8 -3.566406 8 -8 v -76 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="#26a269"/>
+    <path d="m 26 48 v 70 h 70 c 4.433594 0 8 -3.566406 8 -8 v -54 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="url(#a)"/>
+    <path d="m 24 16 v 66 h 72 c 4.433594 0 8 -3.566406 8 -8 v -50 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="#26a269"/>
+    <path d="m 24 8 v 72 h 72 c 4.433594 0 8 -3.566406 8 -8 v -56 c 0 -4.433594 -3.566406 -8 -8 -8 z m 0 0" 
fill="#2ec27e"/>
+    <path d="m 24 20.125 h 80 v 48 h -80 z m 0 0" fill="#57e389"/>
+    <use mask="url(#c)" xlink:href="#g"/>
+    <use mask="url(#d)" xlink:href="#j"/>
+    <path d="m 32 88.125 h 16 v 20 l -8 -7 l -8 7 z m 0 0" fill="#ed333b"/>
+    <path d="m 49.96875 44.40625 c -0.878906 0 -1.160156 -0.121094 -1.039062 -0.519531 l 3.558593 -8.960938 
h 0.28125 l 3.28125 9.480469 z m -4.320312 8.160156 l 2.121093 -5.5625 c 0.199219 -0.519531 0.441407 
-0.679687 1.398438 -0.679687 h 7.601562 l 2.238281 6.519531 c 0.5625 1.640625 -1.078124 1.480469 -2.957031 
1.601562 c -0.242187 0.238282 -0.242187 1.121094 0 1.359376 c 1.480469 -0.039063 5.277344 -0.078126 6.839844 
-0.078126 c 1.640625 0 3.878906 0.039063 5.359375 0.078126 c 0.238281 -0.238282 0.238281 -1.121094 0 
-1.359376 c -1.558594 -0.121093 -2.878906 -0.121093 -3.601562 -2.160156 l -8.238282 -22.878906 c -0.601562 
0.359375 -3 1.757812 -4.441406 1.757812 l -8.640625 20.480469 c -1.039063 2.480469 -2.277344 2.679688 -4 
2.800781 c -0.238281 0.238282 -0.238281 1.121094 0 1.359376 c 1.480469 -0.039063 2.203125 -0.078126 3.761719 
-0.078126 c 1.640625 0 3.839844 0.039063 5.320312 0.078126 c 0.238282 -0.238282 0.238282 -1.121094 0 
-1.359376 c -1.519531 -0.082031 -3.402344 -0.2421
 87 -2.761718 -1.878906 z m 0 0" fill="#1f8455"/>
+    <path d="m 79.992188 53.804688 c 0.277343 1.601562 1.359374 2.320312 3.117187 2.320312 c 2.199219 0 
3.761719 -0.839844 5.242187 -2.238281 c -0.121093 -0.441407 -0.28125 -0.761719 -0.722656 -1.121094 c 
-0.519531 0.398437 -0.917968 0.558594 -1.679687 0.558594 c -0.878907 0 -1.117188 -0.71875 -1.117188 -2.679688 
l 0.078125 -5.757812 c 0 -5.761719 -3.558594 -6.921875 -6.839844 -6.921875 c -2.921874 0 -7.441406 1.679687 
-7.441406 4.320312 c 0 1.160156 0.480469 2.039063 2.082032 2.039063 c 1.398437 0 2.480468 -0.878907 2.480468 
-1.878907 c 0 -0.519531 -0.28125 -1.199218 -0.199218 -1.878906 c 0.078124 -0.441406 0.359374 -0.921875 
1.71875 -0.921875 c 1.679687 0 3.078124 0.71875 3.078124 5.800781 l -2.679687 0.839844 c -4.238281 1.320313 
-7.160156 2.480469 -7.160156 5.640625 c 0 2.757813 1.519531 4.199219 5 4.199219 c 1.160156 0 3.480469 
-1.28125 4.800781 -2.320312 z m -0.203126 -6.800782 v 5.28125 c -1 0.800782 -2 1.441406 -2.71875 1.441406 c 
-1.71875 0 -2.320312 -1.160156 -2.320312 -2.
 402343 c 0 -1.480469 0.121094 -2.679688 2.960938 -3.640625 z m 0 0" fill="#1f8455"/>
+    <g clip-path="url(#q)" mask="url(#m)">
+        <g clip-path="url(#p)" mask="url(#n)">
+            <path d="m 128 80.640625 v 47.359375 h -128 v -47.359375 z m 0 0" fill="url(#o)"/>
+            <path d="m 13.308594 80.640625 l 47.355468 47.359375 h 21.214844 l -47.359375 -47.359375 z m 
42.421875 0 l 47.363281 47.359375 h 21.214844 l -47.363282 -47.359375 z m 42.429687 0 l 29.839844 29.839844 v 
-21.210938 l -8.628906 -8.628906 z m -98.160156 7.90625 v 21.214844 l 18.238281 18.238281 h 21.214844 z m 0 
0"/>
+        </g>
+    </g>
+</svg>
diff --git a/data/meson.build b/data/meson.build
index 813ff7a..022bec1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,6 +1,14 @@
+desktop_conf = configuration_data()
+desktop_conf.set('icon', application_id)
+desktop_conf.set('application_id', application_id)
+
 i18n.merge_file('desktop',
-  input: 'org.gnome.Dictionary.desktop.in',
-  output: 'org.gnome.Dictionary.desktop',
+  input: configure_file(
+    input: 'org.gnome.Dictionary.desktop.in.in',
+    output: 'org.gnome.Dictionary.desktop.in',
+    configuration: desktop_conf,
+  ),
+  output: application_id + '.desktop',
   install: true,
   install_dir: gdict_datadir / 'applications',
   po_dir: po_dir,
@@ -35,8 +43,9 @@ endif
 
 service_conf = configuration_data ()
 service_conf.set('bindir', gdict_bindir)
+service_conf.set('application_id', application_id)
 configure_file(input: 'org.gnome.Dictionary.service.in',
-  output: 'org.gnome.Dictionary.service',
+  output: application_id + '.service',
   configuration: service_conf,
   install_dir: gdict_servicedir,
 )
diff --git a/data/org.gnome.Dictionary.desktop.in b/data/org.gnome.Dictionary.desktop.in.in
similarity index 95%
rename from data/org.gnome.Dictionary.desktop.in
rename to data/org.gnome.Dictionary.desktop.in.in
index 3694979..d1c97ae 100644
--- a/data/org.gnome.Dictionary.desktop.in
+++ b/data/org.gnome.Dictionary.desktop.in.in
@@ -7,7 +7,7 @@ Exec=gnome-dictionary
 Terminal=false
 Type=Application
 # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=org.gnome.Dictionary
+Icon=@application_id@
 StartupNotify=true
 Categories=GNOME;GTK;Office;Dictionary;
 NotShowIn=KDE;
diff --git a/data/org.gnome.Dictionary.service.in b/data/org.gnome.Dictionary.service.in
index e33fc01..9bf55d3 100644
--- a/data/org.gnome.Dictionary.service.in
+++ b/data/org.gnome.Dictionary.service.in
@@ -1,3 +1,3 @@
 [D-BUS Service]
-Name=org.gnome.Dictionary
+Name=@application_id@
 Exec=@bindir@/gnome-dictionary --gapplication-service
diff --git a/libgdict/meson.build b/libgdict/meson.build
index ce07079..18bd715 100644
--- a/libgdict/meson.build
+++ b/libgdict/meson.build
@@ -45,8 +45,8 @@ libgdict_marshal = gnome.genmarshal('gdict-marshal',
 
 libgdict_version = meson.project_version().split('.')
 libgdict_major = libgdict_version[0].to_int()
-libgdict_minor = libgdict_version[1].to_int()
-libgdict_micro = libgdict_version[2].to_int()
+libgdict_minor = libgdict_version[1] in ['alpha', 'beta', 'rc'] ? 0 : libgdict_version[1].to_int()
+libgdict_micro = 0
 
 libgdict_cflags = [
   '-D_GNU_SOURCE',
diff --git a/meson.build b/meson.build
index 9a3d52d..3be6c46 100644
--- a/meson.build
+++ b/meson.build
@@ -1,4 +1,4 @@
-project('gnome-dictionary', 'c', version: '3.26.2',
+project('gnome-dictionary', 'c', version: '40.alpha',
         default_options: [
           'buildtype=debugoptimized',
           'c_std=c99',
@@ -7,6 +7,10 @@ project('gnome-dictionary', 'c', version: '3.26.2',
         license: 'GPLv2+',
         meson_version: '>= 0.54.0')
 
+gdict_version = meson.project_version().split('.')
+gdict_major_version = gdict_version[0].to_int()
+gdict_minor_version = gdict_version[1]
+
 # Paths for the pkg-config file
 gdict_prefix = get_option('prefix')
 gdict_bindir = gdict_prefix / get_option('bindir')
@@ -70,11 +74,18 @@ endif
 
 common_cflags = cc.get_supported_arguments(test_cflags)
 
+profile = get_option('profile')
 debug = get_option('debug')
 optimization = get_option('optimization')
 buildtype = get_option('buildtype')
 debug_cflags = []
 
+if profile == 'devel' or gdict_minor_version in ['alpha', 'beta', 'rc']
+  application_id = 'org.gnome.Dictionary.Devel'
+else
+  application_id = 'org.gnome.Dictionary'
+endif
+
 if debug
   debug_cflags += '-DGDICT_ENABLE_DEBUG'
 elif optimization in ['2', '3', 's']
diff --git a/meson_options.txt b/meson_options.txt
index 4c1b206..9d1a5dd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,2 +1,3 @@
 option('use_ipv6', type: 'boolean', value: true, description: 'Enable IPv6 support')
 option('build_man', type: 'boolean', value: true, description: 'Generate man page (requires xsltproc)')
+option('profile', type: 'combo', choices: ['stable', 'devel'], value: 'stable', description: 'The build 
profile')
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 15574ac..474065f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,7 +2,7 @@
 # Please keep this file sorted alphabetically.
 data/default.desktop.in
 data/org.gnome.Dictionary.appdata.xml.in
-data/org.gnome.Dictionary.desktop.in
+data/org.gnome.Dictionary.desktop.in.in
 data/org.gnome.dictionary.gschema.xml
 data/spanish.desktop.in
 data/thai.desktop.in
diff --git a/src/gdict-about.c b/src/gdict-about.c
index 689ca7c..3125487 100644
--- a/src/gdict-about.c
+++ b/src/gdict-about.c
@@ -28,6 +28,7 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
 #include "gdict-about.h"
+#include "gdict-common.h"
 
 void
 gdict_show_about_dialog (GtkWidget *parent)
@@ -49,21 +50,23 @@ gdict_show_about_dialog (GtkWidget *parent)
   };
 
   const gchar *translator_credits = _("translator-credits");
-  const gchar *copyright = "Copyright \xc2\xa9 2005-2006 Emmanuele Bassi";
+  const gchar *copyright = "Copyright \xc2\xa9 2005 Emmanuele Bassi";
   const gchar *comments = _("Look up words in dictionaries");
   
-  g_return_if_fail (GTK_IS_WIDGET (parent));
+  g_return_if_fail (GTK_IS_WINDOW (parent));
   
-  gtk_show_about_dialog (GTK_IS_WINDOW (parent) ? GTK_WINDOW (parent) : NULL,
-                        "program-name", _("Dictionary"),
-                        "version", VERSION,
-                        "copyright", copyright,
-                        "comments", comments,
-                        "authors", authors,
-                        "documenters", documenters,
-                        "translator-credits", translator_credits,
-                        "logo-icon-name", "org.gnome.Dictionary",
-                        "license-type", GTK_LICENSE_GPL_2_0,
-                        "screen", gtk_widget_get_screen (parent),
-                        NULL);
+  gtk_show_about_dialog (GTK_WINDOW (parent),
+                         "program-name",
+                           gdict_is_devel_build ()
+                             ? _("Dictionary (development build)")
+                             : _("Dictionary"),
+                         "version", VERSION,
+                         "copyright", copyright,
+                         "comments", comments,
+                         "authors", authors,
+                         "documenters", documenters,
+                         "translator-credits", translator_credits,
+                         "logo-icon-name", APPLICATION_ID,
+                         "license-type", GTK_LICENSE_GPL_2_0,
+                         NULL);
 }
diff --git a/src/gdict-app.c b/src/gdict-app.c
index 4189f88..12021f2 100644
--- a/src/gdict-app.c
+++ b/src/gdict-app.c
@@ -365,14 +365,14 @@ gdict_app_init (GdictApp *app)
   g_application_add_main_option_entries (G_APPLICATION (app), gdict_app_goptions);
 
   /* Set main application icon */
-  gtk_window_set_default_icon_name ("org.gnome.Dictionary");
+  gtk_window_set_default_icon_name (APPLICATION_ID);
 }
 
 GApplication *
 gdict_app_new (void)
 {
   return g_object_new (gdict_app_get_type (),
-                       "application-id", "org.gnome.Dictionary",
+                       "application-id", APPLICATION_ID,
                        "resource-base-path", "/org/gnome/Dictionary",
                        "flags", G_APPLICATION_HANDLES_COMMAND_LINE,
                        NULL);
diff --git a/src/gdict-common.c b/src/gdict-common.c
index c9c788f..ad2e77a 100644
--- a/src/gdict-common.c
+++ b/src/gdict-common.c
@@ -241,3 +241,13 @@ gdict_show_gerror_dialog (GtkWindow   *parent,
   g_error_free (error);
   error = NULL;
 }
+
+gboolean
+gdict_is_devel_build (void)
+{
+#ifdef DEVELOPMENT_BUILD
+  return TRUE;
+#else
+  return FALSE;
+#endif
+}
diff --git a/src/gdict-common.h b/src/gdict-common.h
index 234ab1d..c9a646d 100644
--- a/src/gdict-common.h
+++ b/src/gdict-common.h
@@ -25,7 +25,7 @@
 
 G_BEGIN_DECLS
 
-gchar *  gdict_get_data_dir    (void) G_GNUC_MALLOC;
+gchar *  gdict_get_data_dir       (void) G_GNUC_MALLOC;
 gchar *  gdict_get_old_data_dir   (void) G_GNUC_MALLOC;
 gchar *  gdict_get_config_dir     (void) G_GNUC_MALLOC;
 
@@ -39,6 +39,8 @@ void     gdict_show_gerror_dialog (GtkWindow   *parent,
                                   const gchar *message,
                                   GError      *error);
 
+gboolean gdict_is_devel_build     (void);
+
 G_END_DECLS
 
 #endif /* __GDICT_COMMON_H__ */
diff --git a/src/main.c b/src/main.c
index c7e36e6..da855f6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -34,7 +34,7 @@ main (int argc, char *argv[])
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
 
-  g_set_prgname ("gnome-dictionary");
+  g_set_prgname (APPLICATION_ID);
 
   if (!gdict_create_config_dir ())
     exit (1);
diff --git a/src/meson.build b/src/meson.build
index 8823968..915331a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -17,18 +17,27 @@ resources = gnome.compile_resources ('gdict-resources',
   c_name: 'gdict',
 )
 
+gdict_cflags = [
+  '-DPREFIX="@0@"'.format(gdict_prefix),
+  '-DSYSCONFDIR="@0@"'.format(gdict_sysconfdir),
+  '-DLIBDIR="@0@"'.format(gdict_libdir),
+  '-DDATADIR="@0@"'.format(gdict_datadir),
+  '-DPKGDATADIR="@0@"'.format(join_paths(gdict_datadir, 'gnome-dictionary')),
+  '-DGNOMELOCALEDIR="@0@"'.format(join_paths(gdict_datadir, 'locale')),
+  '-DAPPLICATION_ID="@0@"'.format(application_id),
+]
+
+if profile == 'devel' or gdict_minor_version in ['alpha', 'beta', 'rc']
+  gdict_cflags += [
+    '-DDEVELOPMENT_BUILD',
+  ]
+endif
+
 mathlib = cc.find_library('m', required: false)
 
 executable('gnome-dictionary',
   sources: app_sources + resources,
-  c_args: [
-    '-DPREFIX="@0@"'.format(gdict_prefix),
-    '-DSYSCONFDIR="@0@"'.format(gdict_sysconfdir),
-    '-DLIBDIR="@0@"'.format(gdict_libdir),
-    '-DDATADIR="@0@"'.format(gdict_datadir),
-    '-DPKGDATADIR="@0@"'.format(join_paths(gdict_datadir, 'gnome-dictionary')),
-    '-DGNOMELOCALEDIR="@0@"'.format(join_paths(gdict_datadir, 'locale')),
-  ],
+  c_args: gdict_cflags,
   dependencies: [ libgdict_dep, mathlib ],
   include_directories: root_inc,
   install: true,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]