gnc-uri - refer to 'scheme' instead of 'protocol' as that's the more formal term used in uris

This involves renaming 3 functions:
gnc_uri_get_protocol -> gnc_uri_get_scheme
gnc_uri_is_known_protocol -> gnc_uri_is_known_scheme
gnc_uri_is_file_protocol -> gnc_uri_is_file_scheme

The *_protocol variants are marked as deprecated.
Additionally a number of local variables have been renamed from
protocol to scheme to support this change.
This commit is contained in:
Geert Janssens
2018-12-27 22:28:29 +01:00
parent 74ed802eae
commit d22e1db340
9 changed files with 224 additions and 159 deletions

View File

@@ -152,11 +152,11 @@ struct UriStrings
UriStrings::UriStrings(const std::string& uri)
{
gchar *protocol, *host, *username, *password, *dbname;
gchar *scheme, *host, *username, *password, *dbname;
int portnum;
gnc_uri_get_components(uri.c_str(), &protocol, &host, &portnum, &username,
gnc_uri_get_components(uri.c_str(), &scheme, &host, &portnum, &username,
&password, &dbname);
m_protocol = std::string{protocol};
m_protocol = std::string{scheme};
m_host = std::string{host};
m_dbname = std::string{dbname};
if (username)
@@ -164,7 +164,7 @@ UriStrings::UriStrings(const std::string& uri)
if (password)
m_password = std::string{password};
m_portnum = portnum;
g_free(protocol);
g_free(scheme);
g_free(host);
g_free(username);
g_free(password);

View File

@@ -248,7 +248,7 @@ setup_business (Fixture* fixture, gconstpointer pData)
static void
destroy_database (gchar* url)
{
gchar* protocol = NULL;
gchar* scheme = NULL;
gchar* host = NULL;
gchar* dbname = NULL;
gchar* username = NULL;
@@ -263,9 +263,9 @@ destroy_database (gchar* url)
dbi_result tables;
StrVec tblnames;
gnc_uri_get_components (url, &protocol, &host, &portnum,
gnc_uri_get_components (url, &scheme, &host, &portnum,
&username, &password, &dbname);
if (g_strcmp0 (protocol, "postgres") == 0)
if (g_strcmp0 (scheme, "postgres") == 0)
#if HAVE_LIBDBI_R
conn = dbi_conn_new_r (pgsql, dbi_instance);
#else
@@ -273,7 +273,7 @@ destroy_database (gchar* url)
#endif
else
#if HAVE_LIBDBI_R
conn = dbi_conn_new_r (protocol, dbi_instance);
conn = dbi_conn_new_r (scheme, dbi_instance);
#else
conn = dbi_conn_new (protocol);
#endif