Skip to content

Commit

Permalink
GSettings Upgrade - change schema prefix from org.gnucash to org.gnuc…
Browse files Browse the repository at this point in the history
…ash.GnuCash

The latter is the prefix format prescribed by gsettings itself. The former never
was an issue until flatpak decided to not accept the shorter prefix when
requesting a settings migration from host system to flatpak sandbox.

In order to allow for migration, keep the old schema around in
org.gnucash.GnuCash.deprecated.gschema.in

While we're at it, make the new prefix an internal implementation detail.
There's no need for it to be visible to the rest of the gnucash code.
  • Loading branch information
gjanssens committed Sep 21, 2021
1 parent 6674b1b commit 02fbf21
Show file tree
Hide file tree
Showing 32 changed files with 1,780 additions and 173 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -2,7 +2,6 @@
*.gmo
*.go
*.gschema.xml
*.gschema.xml.in
*.gschema.valid
*.la
*.lo
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/CMakeLists.txt
Expand Up @@ -8,7 +8,7 @@ gnc_add_swig_guile_command (swig-gnome-utils-c
${CMAKE_CURRENT_SOURCE_DIR}/gnome-utils.i ""
)

set (WARNINGS_SCHEMA ${DATADIR_BUILD}/glib-2.0/schemas/org.gnucash.warnings.gschema.xml)
set (WARNINGS_SCHEMA ${DATADIR_BUILD}/glib-2.0/schemas/org.gnucash.GnuCash.warnings.gschema.xml)
set (GNC_WARNINGS_C ${CMAKE_CURRENT_BINARY_DIR}/gnc-warnings.c)
set (GNC_WARNINGS_H ${CMAKE_CURRENT_BINARY_DIR}/gnc-warnings.h)

Expand Down
8 changes: 4 additions & 4 deletions gnucash/gnome-utils/make-gnc-warnings-c.xsl
Expand Up @@ -9,13 +9,13 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
* displayed to the user always or once. *
* *
* ATTENTION: this file is autogenerated based on the gsettings *
* schema file org.gnucash.warnings.gschema.xml.in *
* schema file org.gnucash.GnuCash.warnings.gschema.xml.in *
* *
* If you need any modifications in this file, please update the *
* schema source file (or the xsl translation file depending on the *
* kind of change required) instead. *
* *
* Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
* Copyright (C) 2013 Geert Janssens <geert@kobaltwit.be> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
Expand All @@ -40,7 +40,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
#include <gnc-warnings.h>

static GncWarningSpec warning_spec [] =
{<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
{<xsl:for-each select="//schema[@id='org.gnucash.GnuCash.warnings.permanent']/key">
{ GNC_PREF_WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/>,
"<xsl:value-of select="summary"/>",
"<xsl:value-of select="description"/>",
Expand All @@ -56,4 +56,4 @@ const GncWarningSpec *gnc_get_warnings (void)
<xsl:variable name="smallcase" select="'-abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />

</xsl:stylesheet>
</xsl:stylesheet>
10 changes: 5 additions & 5 deletions gnucash/gnome-utils/make-gnc-warnings-h.xsl
Expand Up @@ -9,13 +9,13 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
* displayed to the user always or once. *
* *
* ATTENTION: this file is autogenerated based on the gsettings *
* schema file org.gnucash.warnings.gschema.xml.in *
* schema file org.gnucash.GnuCash.warnings.gschema.xml.in *
* *
* If you need any modifications in this file, please update the *
* schema source file (or the xsl translation file depending on the *
* kind of change required) instead. *
* *
* Copyright (C) 2013 Geert Janssens &lt;geert@kobaltwit.be&gt; *
* Copyright (C) 2013 Geert Janssens &lt;geert@kobaltwit.be&gt; *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
Expand All @@ -41,10 +41,10 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

#include &lt;glib.h&gt;

<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
<xsl:for-each select="//schema[@id='org.gnucash.GnuCash.warnings.permanent']/key">
#define GNC_PREF_WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/> "<xsl:value-of select="@name"/>"</xsl:for-each>

enum {<xsl:for-each select="//schema[@id='org.gnucash.warnings.permanent']/key">
enum {<xsl:for-each select="//schema[@id='org.gnucash.GnuCash.warnings.permanent']/key">
WARN_<xsl:value-of select="translate(@name,$smallcase,$uppercase)"/>,</xsl:for-each>
};

Expand All @@ -62,4 +62,4 @@ const GncWarningSpec *gnc_get_warnings (void);
<xsl:variable name="smallcase" select="'-abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />

</xsl:stylesheet>
</xsl:stylesheet>
35 changes: 18 additions & 17 deletions gnucash/gschemas/CMakeLists.txt
@@ -1,22 +1,23 @@

set(gschema_SOURCES
org.gnucash.dialogs.business.gschema.xml
org.gnucash.dialogs.checkprinting.gschema.xml
org.gnucash.dialogs.commodities.gschema.xml
org.gnucash.dialogs.export.csv.gschema.xml
org.gnucash.dialogs.gschema.xml
org.gnucash.dialogs.import.csv.gschema.xml
org.gnucash.dialogs.import.generic.gschema.xml
org.gnucash.dialogs.import.qif.gschema.xml
org.gnucash.dialogs.reconcile.gschema.xml
org.gnucash.dialogs.sxs.gschema.xml
org.gnucash.dialogs.totd.gschema.xml
org.gnucash.general.finance-quote.gschema.xml
org.gnucash.gschema.xml
org.gnucash.history.gschema.xml
org.gnucash.warnings.gschema.xml
org.gnucash.window.pages.account.tree.gschema.xml
org.gnucash.window.pages.gschema.xml
org.gnucash.GnuCash.deprecated.gschema.xml
org.gnucash.GnuCash.dialogs.business.gschema.xml
org.gnucash.GnuCash.dialogs.checkprinting.gschema.xml
org.gnucash.GnuCash.dialogs.commodities.gschema.xml
org.gnucash.GnuCash.dialogs.export.csv.gschema.xml
org.gnucash.GnuCash.dialogs.gschema.xml
org.gnucash.GnuCash.dialogs.import.csv.gschema.xml
org.gnucash.GnuCash.dialogs.import.generic.gschema.xml
org.gnucash.GnuCash.dialogs.import.qif.gschema.xml
org.gnucash.GnuCash.dialogs.reconcile.gschema.xml
org.gnucash.GnuCash.dialogs.sxs.gschema.xml
org.gnucash.GnuCash.dialogs.totd.gschema.xml
org.gnucash.GnuCash.general.finance-quote.gschema.xml
org.gnucash.GnuCash.gschema.xml
org.gnucash.GnuCash.history.gschema.xml
org.gnucash.GnuCash.warnings.gschema.xml
org.gnucash.GnuCash.window.pages.account.tree.gschema.xml
org.gnucash.GnuCash.window.pages.gschema.xml
)

add_gschema_targets("${gschema_SOURCES}")
Expand Down

0 comments on commit 02fbf21

Please sign in to comment.