[gitg] meson: allow dual installation of the application
- From: Alberto Fanjul <albfan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] meson: allow dual installation of the application
- Date: Wed, 16 Jan 2019 18:54:28 +0000 (UTC)
commit cc62927f4aa4d0acd71dbed996cabd34648c4409
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Sun Jan 13 17:31:50 2019 +0100
meson: allow dual installation of the application
meson: set the schema path correctly
window: fix single quotes
python habits
meson: fix various issues with dual installation
Flatpak: don't enforce the branch for gitg
It causes issues with Gitlab CI as we can't test the build on other branches anymore.
remove .gitignore
.gitlab-ci.yml | 4 +-
data/icons/meson.build | 4 +-
data/meson.build | 32 ++++++++++---
...ata.xml.in => org.gnome.gitg.appdata.xml.in.in} | 6 +--
...itg.desktop.in => org.gnome.gitg.desktop.in.in} | 4 +-
data/org.gnome.gitg.gschema.xml.in | 54 +++++++++++-----------
gitg/commit/gitg-commit-dialog.vala | 6 +--
gitg/commit/gitg-commit-paned.vala | 2 +-
gitg/commit/gitg-commit-submodule-diff-view.vala | 2 +-
gitg/commit/gitg-commit.vala | 4 +-
gitg/gitg-application.vala | 6 +--
gitg/gitg-clone-dialog.vala | 2 +-
gitg/gitg-commit-action-create-patch.vala | 2 +-
gitg/gitg-window.vala | 6 ++-
gitg/history/gitg-history-paned.vala | 4 +-
gitg/history/gitg-history-refs-list.vala | 4 +-
gitg/history/gitg-history.vala | 2 +-
gitg/preferences/gitg-preferences-commit.vala | 2 +-
gitg/preferences/gitg-preferences-history.vala | 2 +-
gitg/preferences/gitg-preferences-interface.vala | 2 +-
libgitg/gitg-credentials-manager.vala | 2 +-
libgitg/gitg-diff-view-file-renderer-text.vala | 2 +-
libgitg/gitg-lanes.vala | 2 +-
libgitg/meson.build | 1 +
meson.build | 10 +++-
meson_options.txt | 1 +
org.gnome.gitg.json => org.gnome.gitgDevel.json | 10 ++--
plugins/diff/gitg-diff.vala | 4 +-
plugins/files/gitg-files.vala | 2 +-
po/POTFILES.in | 4 +-
vapi/config.vapi | 4 +-
31 files changed, 113 insertions(+), 79 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6094a830..917c1410 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,11 +12,11 @@ flatpak:
variables:
# Replace with your manifest path
- MANIFEST_PATH: "org.gnome.gitg.json"
+ MANIFEST_PATH: "org.gnome.gitgDevel.json"
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
FLATPAK_MODULE: "gitg"
MESON_ARGS: "-Ddeprecations=true --buildtype=debugoptimized"
- DBUS_ID: "org.gnome.gitg"
+ DBUS_ID: "org.gnome.gitgDevel"
script:
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 44688d57..cde0f25c 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -10,13 +10,13 @@ icon_sizes = [
foreach icon_size: icon_sizes
install_data(
'_'.join(['hicolor', 'apps', icon_size, 'gitg.png']),
- rename: 'org.gnome.gitg.png',
+ rename: '@0@.png'.format(application_id),
install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', icon_size, 'apps'),
)
endforeach
install_data(
'_'.join(['hicolor', 'apps', 'scalable', 'gitg-symbolic.svg']),
- rename: 'org.gnome.gitg-symbolic.svg',
+ rename: '@0 -symbolic svg'.format(application_id),
install_dir: join_paths(gitg_datadir, 'icons', 'hicolor', 'scalable', 'apps'),
)
diff --git a/data/meson.build b/data/meson.build
index f8310441..a8b90fd1 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -2,11 +2,18 @@ subdir('icons')
desktop = 'org.gnome.gitg.desktop'
+desktop_config = configuration_data()
+desktop_config.set('icon', application_id)
+desktop_config.set('binary', gitg_name)
i18n.merge_file(
desktop,
type: 'desktop',
- input: desktop + '.in',
- output: desktop,
+ input: configure_file(
+ input: desktop + '.in.in',
+ output: desktop + '.in',
+ configuration: desktop_config
+ ),
+ output: '@0@.desktop'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(gitg_datadir, 'applications'),
@@ -14,24 +21,35 @@ i18n.merge_file(
schema_conf = configuration_data()
schema_conf.set('GETTEXT_PACKAGE', gitg_gettext)
-
+schema_conf.set('APPLICATION_ID', application_id)
+schema_path = '/org/gnome/gitg'
+if get_option('profile') == 'development'
+ schema_path = '/org/gnome/gitgDevel'
+endif
+schema_conf.set('SCHEMA_PATH', schema_path)
schema = 'org.gnome.gitg.gschema.xml'
configure_file(
input: schema + '.in',
- output: schema,
+ output: '@0 gschema xml'.format(application_id),
configuration: schema_conf,
install: true,
install_dir: join_paths(gitg_datadir, 'glib-2.0', 'schemas'),
)
appdata = 'org.gnome.gitg.appdata.xml'
-
+appdata_config = configuration_data()
+appdata_config.set('app-id', application_id)
+appdata_config.set('gettext', gitg_name)
i18n.merge_file(
appdata,
type: 'xml',
- input: appdata + '.in',
- output: appdata,
+ input: configure_file(
+ input: appdata + '.in.in',
+ output: appdata + '.in',
+ configuration: appdata_config
+ ),
+ output: '@0 appdata xml'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(gitg_datadir, 'metainfo'),
diff --git a/data/org.gnome.gitg.appdata.xml.in b/data/org.gnome.gitg.appdata.xml.in.in
similarity index 94%
rename from data/org.gnome.gitg.appdata.xml.in
rename to data/org.gnome.gitg.appdata.xml.in.in
index 1938522f..a2e33432 100644
--- a/data/org.gnome.gitg.appdata.xml.in
+++ b/data/org.gnome.gitg.appdata.xml.in.in
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
- <id>org.gnome.gitg</id>
+ <id>@app-id@</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<project_group>GNOME</project_group>
@@ -45,9 +45,9 @@
<provides>
<binary>gitg</binary>
</provides>
- <launchable type="desktop-id">org.gnome.gitg.desktop</launchable>
+ <launchable type="desktop-id">@app-id@.desktop</launchable>
<update_contact>albfan gnome org</update_contact>
- <translation type="gettext">gitg</translation>
+ <translation type="gettext">@gettext@</translation>
<content_rating type="oars-1.1" />
<developer_name>The GNOME Project</developer_name>
<url type="homepage">https://wiki.gnome.org/Apps/Gitg</url>
diff --git a/data/org.gnome.gitg.desktop.in b/data/org.gnome.gitg.desktop.in.in
similarity index 87%
rename from data/org.gnome.gitg.desktop.in
rename to data/org.gnome.gitg.desktop.in.in
index 0a333540..b83e0eea 100644
--- a/data/org.gnome.gitg.desktop.in
+++ b/data/org.gnome.gitg.desktop.in.in
@@ -1,12 +1,12 @@
[Desktop Entry]
Name=gitg
Comment=Git repository browser
-Exec=gitg --no-wd %U
+Exec=@binary@ --no-wd %U
TryExec=gitg
Terminal=false
Type=Application
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=org.gnome.gitg
+Icon=@icon@
Categories=GNOME;GTK;Development;
MimeType=x-scheme-handler/gitg;
#X-GNOME-DocPath=gitg/gitg.xml
diff --git a/data/org.gnome.gitg.gschema.xml.in b/data/org.gnome.gitg.gschema.xml.in
index 6c04f10c..baa41f04 100644
--- a/data/org.gnome.gitg.gschema.xml.in
+++ b/data/org.gnome.gitg.gschema.xml.in
@@ -1,27 +1,27 @@
<schemalist>
- <enum id="org.gnome.gitg.Layout">
+ <enum id="@APPLICATION_ID@.Layout">
<value nick="horizontal" value="0"/>
<value nick="vertical" value="1"/>
</enum>
- <enum id="org.gnome.gitg.history.DefaultSelection">
+ <enum id="@APPLICATION_ID@.history.DefaultSelection">
<value nick="current-branch" value="0"/>
<value nick="all-branches" value="1"/>
<value nick="all-commits" value="2"/>
</enum>
- <enum id="org.gnome.gitg.history.RefSortOrder">
+ <enum id="@APPLICATION_ID@.history.RefSortOrder">
<value nick="last-activity" value="0"/>
<value nick="name" value="1"/>
</enum>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences"
path="/org/gnome/gitg/preferences/">
- <child name="main" schema="org.gnome.gitg.preferences.main" />
- <child name="history" schema="org.gnome.gitg.preferences.history" />
- <child name="commit" schema="org.gnome.gitg.preferences.commit" />
- <child name="diff" schema="org.gnome.gitg.preferences.diff" />
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences"
path="@SCHEMA_PATH@/preferences/">
+ <child name="main" schema="@APPLICATION_ID preferences main" />
+ <child name="history" schema="@APPLICATION_ID@.preferences.history" />
+ <child name="commit" schema="@APPLICATION_ID@.preferences.commit" />
+ <child name="diff" schema="@APPLICATION_ID preferences diff" />
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.main"
path="/org/gnome/gitg/preferences/main/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID preferences main"
path="@SCHEMA_PATH@/preferences/main/">
<key name="clone-directory" type="s">
<default>""</default>
<summary>Default Clone Directory</summary>
@@ -31,8 +31,8 @@
</description>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.interface"
path="/org/gnome/gitg/preferences/interface/">
- <key name="orientation" enum="org.gnome.gitg.Layout">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.interface"
path="@SCHEMA_PATH@/preferences/interface/">
+ <key name="orientation" enum="@APPLICATION_ID@.Layout">
<default>'vertical'</default>
<summary>Orientation of the main interface (vertical or horizontal)</summary>
<description>
@@ -74,7 +74,7 @@
<description>Used by GtkSourceView to determine colors for syntax highlighting</description>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.history"
path="/org/gnome/gitg/preferences/history/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.history"
path="@SCHEMA_PATH@/preferences/history/">
<key name="collapse-inactive-lanes" type="i">
<default>2</default>
<summary>When to Collapse Inactive Lanes</summary>
@@ -131,14 +131,14 @@
history for the current HEAD.
</description>
</key>
- <key name="default-selection" enum="org.gnome.gitg.history.DefaultSelection">
+ <key name="default-selection" enum="@APPLICATION_ID@.history.DefaultSelection">
<default>'current-branch'</default>
<summary>Default selection of the history activity</summary>
<description>
Setting that determines the default selection on startup of the history activity.
</description>
</key>
- <key name="reference-sort-order" enum="org.gnome.gitg.history.RefSortOrder">
+ <key name="reference-sort-order" enum="@APPLICATION_ID@.history.RefSortOrder">
<default>'last-activity'</default>
<summary>Reference Sort Order</summary>
<description>
@@ -154,11 +154,11 @@
</description>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.commit"
path="/org/gnome/gitg/preferences/commit/">
- <child name="message" schema="org.gnome.gitg.preferences.commit.message" />
- <child name="diff" schema="org.gnome.gitg.preferences.commit.diff" />
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.commit"
path="@SCHEMA_PATH@/preferences/commit/">
+ <child name="message" schema="@APPLICATION_ID@.preferences.commit.message" />
+ <child name="diff" schema="@APPLICATION_ID preferences commit diff" />
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.commit.message"
path="/org/gnome/gitg/preferences/commit/message/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.preferences.commit.message"
path="@SCHEMA_PATH@/preferences/commit/message/">
<key name="show-markup" type="b">
<default>true</default>
</key>
@@ -212,7 +212,7 @@
</description>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.diff"
path="/org/gnome/gitg/preferences/diff/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID preferences diff"
path="@SCHEMA_PATH@/preferences/diff/">
<key name="patience" type="b">
<default>false</default>
<summary>Use patience algorithm to show diffs</summary>
@@ -260,7 +260,7 @@
</description>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.commit.diff"
path="/org/gnome/gitg/preferences/commit/diff/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID preferences commit diff"
path="@SCHEMA_PATH@/preferences/commit/diff/">
<key name="context-lines" type="i">
<default>3</default>
<summary>Number of Before/After Context Lines</summary>
@@ -279,12 +279,12 @@
</description>
</key>
</schema>
- <schema id="org.gnome.gitg.state" path="/org/gnome/gitg/state/">
- <child name="window" schema="org.gnome.gitg.state.window"/>
- <child name="history" schema="org.gnome.gitg.state.history"/>
- <child name="commit" schema="org.gnome.gitg.state.commit"/>
+ <schema id="@APPLICATION_ID@.state" path="@SCHEMA_PATH@/state/">
+ <child name="window" schema="@APPLICATION_ID@.state.window"/>
+ <child name="history" schema="@APPLICATION_ID@.state.history"/>
+ <child name="commit" schema="@APPLICATION_ID@.state.commit"/>
</schema>
- <schema id="org.gnome.gitg.state.window" path="/org/gnome/gitg/state/window/">
+ <schema id="@APPLICATION_ID@.state.window" path="@SCHEMA_PATH@/state/window/">
<key name="state" type="i">
<default>0</default>
</key>
@@ -304,7 +304,7 @@
<default>200</default>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.state.history"
path="/org/gnome/gitg/state/history/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.state.history"
path="@SCHEMA_PATH@/state/history/">
<key name="paned-sidebar-position" type="i">
<default>200</default>
</key>
@@ -312,7 +312,7 @@
<default>450</default>
</key>
</schema>
- <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.state.commit"
path="/org/gnome/gitg/state/commit/">
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="@APPLICATION_ID@.state.commit"
path="@SCHEMA_PATH@/state/commit/">
<key name="paned-sidebar-position" type="i">
<default>200</default>
</key>
diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala
index 84bd9812..e95e855c 100644
--- a/gitg/commit/gitg-commit-dialog.vala
+++ b/gitg/commit/gitg-commit-dialog.vala
@@ -434,7 +434,7 @@ class Dialog : Gtk.Dialog
BindingFlags.BIDIRECTIONAL |
BindingFlags.SYNC_CREATE);
- d_commit_settings = new Settings("org.gnome.gitg.state.commit");
+ d_commit_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.commit");
d_commit_settings.bind("sign-off",
this,
@@ -442,7 +442,7 @@ class Dialog : Gtk.Dialog
SettingsBindFlags.GET |
SettingsBindFlags.SET);
- d_message_settings = new Settings("org.gnome.gitg.preferences.commit.message");
+ d_message_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.commit.message");
d_message_settings.bind("show-markup",
this,
@@ -479,7 +479,7 @@ class Dialog : Gtk.Dialog
"spell-checking-language",
SettingsBindFlags.GET | SettingsBindFlags.SET);
- var interface_settings = new Settings("org.gnome.gitg.preferences.interface");
+ var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
interface_settings.bind("use-gravatar",
this,
"use-gravatar",
diff --git a/gitg/commit/gitg-commit-paned.vala b/gitg/commit/gitg-commit-paned.vala
index c19cb541..e9c9b528 100644
--- a/gitg/commit/gitg-commit-paned.vala
+++ b/gitg/commit/gitg-commit-paned.vala
@@ -89,7 +89,7 @@ class Paned : Gtk.Paned
construct
{
- var state_settings = new Settings("org.gnome.gitg.state.commit");
+ var state_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.commit");
state_settings.bind("paned-sidebar-position",
this,
diff --git a/gitg/commit/gitg-commit-submodule-diff-view.vala
b/gitg/commit/gitg-commit-submodule-diff-view.vala
index ee4d2998..6cbafb70 100644
--- a/gitg/commit/gitg-commit-submodule-diff-view.vala
+++ b/gitg/commit/gitg-commit-submodule-diff-view.vala
@@ -37,7 +37,7 @@ class SubmoduleDiffView : Gtk.Box
construct
{
- var interface_settings = new Settings("org.gnome.gitg.preferences.interface");
+ var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
interface_settings.bind("orientation",
d_box_diffs,
diff --git a/gitg/commit/gitg-commit.vala b/gitg/commit/gitg-commit.vala
index df779000..5555cec1 100644
--- a/gitg/commit/gitg-commit.vala
+++ b/gitg/commit/gitg-commit.vala
@@ -1934,7 +1934,7 @@ namespace GitgCommit
d_stage_unstage_submodule_commit_callback(model.commit_from_path(path));
});
- var settings = new Settings("org.gnome.gitg.preferences.commit.diff");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.commit.diff");
settings.bind("context-lines",
d_main.diff_view,
@@ -1946,7 +1946,7 @@ namespace GitgCommit
"tab-width",
SettingsBindFlags.GET | SettingsBindFlags.SET);
- settings = new Settings("org.gnome.gitg.preferences.interface");
+ settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
settings.bind("use-gravatar",
d_main.diff_view,
diff --git a/gitg/gitg-application.vala b/gitg/gitg-application.vala
index 81829543..38a9a168 100644
--- a/gitg/gitg-application.vala
+++ b/gitg/gitg-application.vala
@@ -60,7 +60,7 @@ public class Application : Gtk.Application
public Application()
{
- Object(application_id: "org.gnome.gitg",
+ Object(application_id: Gitg.Config.APPLICATION_ID,
flags: ApplicationFlags.HANDLES_OPEN |
ApplicationFlags.HANDLES_COMMAND_LINE |
ApplicationFlags.SEND_ENVIRONMENT);
@@ -236,7 +236,7 @@ public class Application : Gtk.Application
"version", Config.VERSION,
"website", Config.PACKAGE_URL,
"website-label", _("gitg homepage"),
- "logo-icon-name", "org.gnome.gitg",
+ "logo-icon-name", Gitg.Config.APPLICATION_ID,
"license-type", Gtk.License.GPL_2_0);
}
@@ -375,7 +375,7 @@ public class Application : Gtk.Application
}
// Handle the state setting in the application
- d_state_settings = new Settings("org.gnome.gitg.state.window");
+ d_state_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.window");
d_state_settings.delay();
// Application menu entries
diff --git a/gitg/gitg-clone-dialog.vala b/gitg/gitg-clone-dialog.vala
index a32782ee..05ae4901 100644
--- a/gitg/gitg-clone-dialog.vala
+++ b/gitg/gitg-clone-dialog.vala
@@ -62,7 +62,7 @@ public class CloneDialog : Gtk.Dialog
construct
{
- var main_settings = new Settings("org.gnome.gitg.preferences.main");
+ var main_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.main");
set_default_response(Gtk.ResponseType.OK);
diff --git a/gitg/gitg-commit-action-create-patch.vala b/gitg/gitg-commit-action-create-patch.vala
index 5621531d..4dc4a347 100644
--- a/gitg/gitg-commit-action-create-patch.vala
+++ b/gitg/gitg-commit-action-create-patch.vala
@@ -93,7 +93,7 @@ class CommitActionCreatePatch : GitgExt.UIElement, GitgExt.Action, GitgExt.Commi
private Ggit.Diff create_diff_from_commit() throws Error
{
- var settings = new Settings("org.gnome.gitg.preferences.diff");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.diff");
var opts = new Ggit.DiffOptions();
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 36899c40..10eb95ea 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -302,7 +302,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
}
});
- d_interface_settings = new Settings("org.gnome.gitg.preferences.interface");
+ d_interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
d_dash_model = Builder.load_object<MenuModel>("ui/gitg-menus.ui", "win-menu-dash");
@@ -919,6 +919,10 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
d_state_settings.get("size", "(ii)", out width, out height);
resize(width, height);
+ if(Gitg.Config.PROFILE == "development")
+ {
+ this.get_style_context().add_class("devel");
+ }
return true;
}
diff --git a/gitg/history/gitg-history-paned.vala b/gitg/history/gitg-history-paned.vala
index afe85671..90101b6d 100644
--- a/gitg/history/gitg-history-paned.vala
+++ b/gitg/history/gitg-history-paned.vala
@@ -131,7 +131,7 @@ class Paned : Gitg.AnimatedPaned
construct
{
- var state_settings = new Settings("org.gnome.gitg.state.history");
+ var state_settings = new Settings(Gitg.Config.APPLICATION_ID + ".state.history");
position = state_settings.get_int("paned-sidebar-position");
d_paned_panels.position = state_settings.get_int("paned-panels-position");
@@ -144,7 +144,7 @@ class Paned : Gitg.AnimatedPaned
store_paned_position(d_paned_panels, state_settings, "paned-panels-position");
});
- var interface_settings = new Settings("org.gnome.gitg.preferences.interface");
+ var interface_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
interface_settings.bind("orientation",
this,
diff --git a/gitg/history/gitg-history-refs-list.vala b/gitg/history/gitg-history-refs-list.vala
index e5188bc2..75ecd438 100644
--- a/gitg/history/gitg-history-refs-list.vala
+++ b/gitg/history/gitg-history-refs-list.vala
@@ -584,7 +584,7 @@ public class RefsList : Gtk.ListBox
set_sort_func(sort_rows);
set_filter_func(filter_func);
- var settings = new Settings("org.gnome.gitg.preferences.history");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
settings.bind("reference-sort-order",
this,
@@ -1219,7 +1219,7 @@ public class RefsList : Gtk.ListBox
if (sel == null)
{
- var settings = new Settings("org.gnome.gitg.preferences.history");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
var default_selection = (DefaultSelection)settings.get_enum("default-selection");
Gtk.ListBoxRow? srow = null;
diff --git a/gitg/history/gitg-history.vala b/gitg/history/gitg-history.vala
index 6f091ef3..c34eab2d 100644
--- a/gitg/history/gitg-history.vala
+++ b/gitg/history/gitg-history.vala
@@ -126,7 +126,7 @@ namespace GitgHistory
construct
{
- d_settings = new Settings("org.gnome.gitg.preferences.history");
+ d_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
d_settings.changed["topological-order"].connect((s, k) => {
update_sort_mode();
diff --git a/gitg/preferences/gitg-preferences-commit.vala b/gitg/preferences/gitg-preferences-commit.vala
index 3eed47f0..6e4f9b23 100644
--- a/gitg/preferences/gitg-preferences-commit.vala
+++ b/gitg/preferences/gitg-preferences-commit.vala
@@ -53,7 +53,7 @@ public class PreferencesCommit : Gtk.Grid, GitgExt.Preferences
construct
{
- var settings = new Settings("org.gnome.gitg.preferences.commit.message");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.commit.message");
settings.bind("show-markup",
d_check_button_show_markup,
diff --git a/gitg/preferences/gitg-preferences-history.vala b/gitg/preferences/gitg-preferences-history.vala
index d01da5c0..1b4a7dde 100644
--- a/gitg/preferences/gitg-preferences-history.vala
+++ b/gitg/preferences/gitg-preferences-history.vala
@@ -68,7 +68,7 @@ public class PreferencesHistory : Gtk.Grid, GitgExt.Preferences
construct
{
- var settings = new Settings("org.gnome.gitg.preferences.history");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
settings.bind("collapse-inactive-lanes-enabled",
d_collapse_inactive_lanes_enabled,
diff --git a/gitg/preferences/gitg-preferences-interface.vala
b/gitg/preferences/gitg-preferences-interface.vala
index 1c64148f..e4dc5fb7 100644
--- a/gitg/preferences/gitg-preferences-interface.vala
+++ b/gitg/preferences/gitg-preferences-interface.vala
@@ -51,7 +51,7 @@ public class PreferencesInterface : Gtk.Grid, GitgExt.Preferences
construct
{
- d_settings = new Settings("org.gnome.gitg.preferences.interface");
+ d_settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
d_horizontal_layout_enabled.active = d_settings.get_enum("orientation") == 0;
diff --git a/libgitg/gitg-credentials-manager.vala b/libgitg/gitg-credentials-manager.vala
index 78a8b1a1..331aaaf5 100644
--- a/libgitg/gitg-credentials-manager.vala
+++ b/libgitg/gitg-credentials-manager.vala
@@ -39,7 +39,7 @@ public class CredentialsManager
static construct
{
- s_secret_schema = new Secret.Schema("org.gnome.Gitg.Credentials",
+ s_secret_schema = new Secret.Schema(Gitg.Config.APPLICATION_ID + ".Credentials",
Secret.SchemaFlags.NONE,
"scheme", Secret.SchemaAttributeType.STRING,
"host", Secret.SchemaAttributeType.STRING,
diff --git a/libgitg/gitg-diff-view-file-renderer-text.vala b/libgitg/gitg-diff-view-file-renderer-text.vala
index 6d11577f..6b68bb6b 100644
--- a/libgitg/gitg-diff-view-file-renderer-text.vala
+++ b/libgitg/gitg-diff-view-file-renderer-text.vala
@@ -396,7 +396,7 @@ class Gitg.DiffViewFileRendererText : Gtk.SourceView, DiffSelectable, DiffViewFi
buffer.language = language;
buffer.highlight_syntax = true;
- d_stylesettings = try_settings("org.gnome.gitg.preferences.interface");
+ d_stylesettings = try_settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
if (d_stylesettings != null)
{
d_stylesettings.changed["style-scheme"].connect((s, k) => {
diff --git a/libgitg/gitg-lanes.vala b/libgitg/gitg-lanes.vala
index d782bba9..182a85f2 100644
--- a/libgitg/gitg-lanes.vala
+++ b/libgitg/gitg-lanes.vala
@@ -114,7 +114,7 @@ public class Lanes : Object
d_collapsed = new HashTable<Ggit.OId, CollapsedLane>(Ggit.OId.hash,
Ggit.OId.equal);
- var settings = new Settings("org.gnome.gitg.preferences.history");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.history");
settings.bind("collapse-inactive-lanes-enabled",
this,
diff --git a/libgitg/meson.build b/libgitg/meson.build
index b3ff67a6..2961f606 100644
--- a/libgitg/meson.build
+++ b/libgitg/meson.build
@@ -91,6 +91,7 @@ sources += gnome.compile_resources(
)
deps = common_deps + [
+ config_dep,
gitg_platform_support_dep,
gsettings_desktop_schemas_dep,
gtksourceview_dep,
diff --git a/meson.build b/meson.build
index 18433641..0266af10 100644
--- a/meson.build
+++ b/meson.build
@@ -5,9 +5,14 @@ project(
default_options: 'buildtype=debugoptimized',
meson_version: '>= 0.48.0',
)
-
+application_id = 'org.gnome.gitg'
gitg_name = meson.project_name()
+if get_option('profile') == 'development'
+ application_id = 'org.gnome.gitgDevel'
+ gitg_name = meson.project_name() + 'Devel'
+endif
+
gitg_version = meson.project_version()
version_array = gitg_version.split('.')
gitg_major_version = version_array[0].to_int()
@@ -64,6 +69,8 @@ set_defines = [
['PACKAGE_NAME', gitg_name],
['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Gitg'],
['VERSION', gitg_version],
+ ['APPLICATION_ID', application_id],
+ ['PROFILE', get_option('profile')],
# i18n
['GETTEXT_PACKAGE', gitg_gettext],
# gitg
@@ -207,4 +214,5 @@ output += ' Compiler: ' + cc.get_id() + '\n'
output += ' Glade catalog: ' + enable_glade_catalog.to_string() + '\n'
output += ' Debug enabled: ' + gitg_debug.to_string() + '\n'
output += ' Python support: ' + enable_python.to_string() + '\n'
+output += ' Profile: ' + get_option('profile') + '\n'
message(output)
diff --git a/meson_options.txt b/meson_options.txt
index f1973be6..7e455a4a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,3 +2,4 @@ option('glade_catalog', type: 'boolean', value: true, description: 'Install a gl
option('python', type: 'boolean', value: true, description: 'Build with python support')
option('deprecations', type: 'boolean', value: false, description: 'warn about deprecated usages')
option('docs', type: 'boolean', value: false, description: 'enable generating documentation')
+option('profile', type: 'combo', choices: ['default', 'development'], value: 'default')
diff --git a/org.gnome.gitg.json b/org.gnome.gitgDevel.json
similarity index 96%
rename from org.gnome.gitg.json
rename to org.gnome.gitgDevel.json
index b046125b..ccaab62e 100644
--- a/org.gnome.gitg.json
+++ b/org.gnome.gitgDevel.json
@@ -1,10 +1,10 @@
{
- "app-id" : "org.gnome.gitg",
+ "app-id" : "org.gnome.gitgDevel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"branch" : "master",
"sdk" : "org.gnome.Sdk",
- "command" : "gitg",
+ "command" : "gitgDevel",
"tags" : [
"nightly"
],
@@ -149,13 +149,13 @@
"builddir" : true,
"config-opts" : [
"--buildtype=debugoptimized",
- "-Ddeprecations=true"
+ "-Ddeprecations=true",
+ "-Dprofile=development"
],
"sources" : [
{
"type" : "git",
- "url" : "https://gitlab.gnome.org/GNOME/gitg.git",
- "branch" : "master"
+ "url" : "https://gitlab.gnome.org/GNOME/gitg.git"
}
]
}
diff --git a/plugins/diff/gitg-diff.vala b/plugins/diff/gitg-diff.vala
index 73a21a65..51d18706 100644
--- a/plugins/diff/gitg-diff.vala
+++ b/plugins/diff/gitg-diff.vala
@@ -44,7 +44,7 @@ namespace GitgDiff
d_diff.show();
- var settings = new Settings("org.gnome.gitg.preferences.diff");
+ var settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.diff");
settings.bind("ignore-whitespace",
d_diff,
@@ -71,7 +71,7 @@ namespace GitgDiff
"wrap-lines",
SettingsBindFlags.GET | SettingsBindFlags.SET);
- settings = new Settings("org.gnome.gitg.preferences.interface");
+ settings = new Settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
settings.bind("use-gravatar",
d_diff,
diff --git a/plugins/files/gitg-files.vala b/plugins/files/gitg-files.vala
index 87550868..94b7e76a 100644
--- a/plugins/files/gitg-files.vala
+++ b/plugins/files/gitg-files.vala
@@ -155,7 +155,7 @@ namespace GitgFiles
update_font();
}
- d_stylesettings = try_settings("org.gnome.gitg.preferences.interface");
+ d_stylesettings = try_settings(Gitg.Config.APPLICATION_ID + ".preferences.interface");
if (d_stylesettings != null)
{
d_stylesettings.changed["style-scheme"].connect((s, k) => {
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7d710e11..b977d566 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,8 +1,8 @@
# List of source files containing translatable strings.
# This list has been automatically generated by update-potfiles.
contrib/xml/xml-reader.c
-data/org.gnome.gitg.appdata.xml.in
-data/org.gnome.gitg.desktop.in
+data/org.gnome.gitg.appdata.xml.in.in
+data/org.gnome.gitg.desktop.in.in
data/org.gnome.gitg.gschema.xml.in
gitg/commit/gitg-commit-dialog.vala
gitg/commit/gitg-commit.vala
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 2cfe3d35..07ab2207 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -1,6 +1,8 @@
[CCode(cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Gitg.Config
-{
+{
+ public const string APPLICATION_ID;
+ public const string PROFILE;
public const string GETTEXT_PACKAGE;
public const string PACKAGE_NAME;
public const string PACKAGE_VERSION;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]