From bfa8e9ab17cc6588d8244d063431bdc0b2fc3743 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 22 May 2024 17:59:52 +0200 Subject: [PATCH] Doxygen - drop obvious cases of deprecated code --- gnucash/gnome/window-autoclear.c | 2 +- libgnucash/engine/Split.h | 2 - libgnucash/engine/Transaction.h | 2 - libgnucash/engine/gnc-date.h | 4 -- libgnucash/engine/gnc-uri-utils.c | 22 ---------- libgnucash/engine/gnc-uri-utils.h | 48 --------------------- libgnucash/engine/qofbook-p.h | 5 --- libgnucash/engine/qofquery.cpp | 43 ++++++++---------- libgnucash/engine/qofquery.h | 7 --- libgnucash/engine/test/test-gnc-uri-utils.c | 4 +- 10 files changed, 22 insertions(+), 117 deletions(-) diff --git a/gnucash/gnome/window-autoclear.c b/gnucash/gnome/window-autoclear.c index 7f9cc18cf10..c9039f5aa35 100644 --- a/gnucash/gnome/window-autoclear.c +++ b/gnucash/gnome/window-autoclear.c @@ -105,7 +105,7 @@ show_cleared_splits (GList *splits) for (GList *iter = splits; iter; iter = iter->next) { - GncGUID guid = xaccSplitReturnGUID (iter->data); + GncGUID guid = iter->data ? *xaccSplitGetGUID (iter->data) : *guid_null() ; xaccQueryAddGUIDMatch (guid_query, &guid, GNC_ID_SPLIT, QOF_QUERY_OR); } book_query = qof_query_merge (book_query, guid_query, QOF_QUERY_AND); diff --git a/libgnucash/engine/Split.h b/libgnucash/engine/Split.h index 0877edcb00a..e3889c832f4 100644 --- a/libgnucash/engine/Split.h +++ b/libgnucash/engine/Split.h @@ -555,8 +555,6 @@ gnc_numeric xaccSplitVoidFormerValue(const Split *split); /** \deprecated */ #define xaccSplitGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X)) -/** \deprecated */ -#define xaccSplitReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null())) #ifdef __cplusplus } /* extern "C" */ diff --git a/libgnucash/engine/Transaction.h b/libgnucash/engine/Transaction.h index 04b7f3cebd5..b58310ddf90 100644 --- a/libgnucash/engine/Transaction.h +++ b/libgnucash/engine/Transaction.h @@ -802,8 +802,6 @@ void xaccTransRecordPrice (Transaction *trans, PriceSource source); #define xaccTransGetBook(X) qof_instance_get_book (QOF_INSTANCE(X)) /** \deprecated */ #define xaccTransGetGUID(X) qof_entity_get_guid(QOF_INSTANCE(X)) -/** \deprecated */ -#define xaccTransReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_INSTANCE(X))) : *(guid_null())) #ifdef __cplusplus } /* extern "C" */ diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h index 2193d0de107..2b0c2518625 100644 --- a/libgnucash/engine/gnc-date.h +++ b/libgnucash/engine/gnc-date.h @@ -141,10 +141,6 @@ typedef enum QOF_DATE_COMPLETION_SLIDING, /**< use sliding 12-month window */ } QofDateCompletion; -/** \deprecated qof_date_format_get_format has been replaced -by qof_date_text_format_get_string */ -#define qof_date_format_get_format qof_date_text_format_get_string - /** * This is how to format the month, as a number, an abbreviated string, * or the full name. diff --git a/libgnucash/engine/gnc-uri-utils.c b/libgnucash/engine/gnc-uri-utils.c index 599c1ef920b..fd962dc2bb1 100755 --- a/libgnucash/engine/gnc-uri-utils.c +++ b/libgnucash/engine/gnc-uri-utils.c @@ -427,25 +427,3 @@ gchar *gnc_uri_add_extension ( const gchar *uri, const gchar *extension ) /* Ok, all tests passed, let's add the extension */ return g_strconcat( uri, extension, NULL ); } - - -/* Deprecated functions - * ********************/ - -/* replaced with gnc_uri_get_scheme */ -gchar *gnc_uri_get_protocol (const gchar *uri) -{ - return gnc_uri_get_scheme (uri); -} - -/* replaced with gnc_uri_is_known_scheme */ -gboolean gnc_uri_is_known_protocol (const gchar *protocol) -{ - return gnc_uri_is_known_scheme(protocol); -} - -/* replaced with gnc_uri_is_file_scheme */ -gboolean gnc_uri_is_file_protocol (const gchar *protocol) -{ - return gnc_uri_is_file_scheme (protocol); -} diff --git a/libgnucash/engine/gnc-uri-utils.h b/libgnucash/engine/gnc-uri-utils.h index 492c048dde2..68e4aca2b71 100644 --- a/libgnucash/engine/gnc-uri-utils.h +++ b/libgnucash/engine/gnc-uri-utils.h @@ -266,54 +266,6 @@ gboolean gnc_uri_targets_local_fs (const gchar *uri); */ gchar *gnc_uri_add_extension ( const gchar *uri, const gchar *extension ); - -/** @name Deprecated functions - * @{ - */ - -/** Extracts the protocol from a uri - * - * @deprecated This function has been deprecated in gnucash 3.4. Please use gnc_uri_get_scheme instead. - * - * The function allocates memory for the protocol. The calling function should - * free this memory with g_free if it no longer needs the string. - * - * @param uri The uri to extract the protocol from - * - * @return The protocol for this uri. If the uri didn't have an - * explicit protocol, NULL will be returned. - */ - -gchar *gnc_uri_get_protocol (const gchar *uri) - GNC_DEPRECATED("Please use gnc_uri_get_scheme instead (since 3.4)"); - -/** Checks if there is a backend that explicitly stated to handle the given protocol. - * - * @deprecated This function has been deprecated in gnucash 3.4. Please use gnc_uri_is_known_scheme instead. - * - * @param protocol The protocol to check - * - * @return TRUE if at least one backend explicitly handles this protocol, otherwise FALSE - */ -gboolean gnc_uri_is_known_protocol (const gchar *protocol) - GNC_DEPRECATED("Please use gnc_uri_known_scheme instead (since 3.4)"); - - -/** Checks if the given protocol is used to refer to a file - * (as opposed to a network service like a database or web url) - * - * @deprecated This function has been deprecated in gnucash 3.4. Please use gnc_uri_is_file_scheme instead. - * - * @param protocol The protocol to check - * - * @return TRUE if the protocol is used with files, FALSE of the protocol - * is normally used with network services (database, web url,...) - */ -gboolean gnc_uri_is_file_protocol (const gchar *protocol) - GNC_DEPRECATED("Please use gnc_uri_is_file_scheme instead (since 3.4)"); - -/** @} */ - #ifdef __cplusplus } #endif diff --git a/libgnucash/engine/qofbook-p.h b/libgnucash/engine/qofbook-p.h index adbf4369b44..80a79f7bea7 100644 --- a/libgnucash/engine/qofbook-p.h +++ b/libgnucash/engine/qofbook-p.h @@ -59,11 +59,6 @@ void qof_book_set_backend (QofBook *book, QofBackend *be); /* Register books with the engine */ gboolean qof_book_register (void); -/** @deprecated use qof_instance_set_guid instead but only in -backends (when reading the GncGUID from the data source). */ -#define qof_book_set_guid(book,guid) \ - qof_instance_set_guid(QOF_INSTANCE(book), guid) - /** Validate a counter format string with a given format specifier. * If valid, returns a normalized format string, * that is whatever long int specifier was used will be replaced with the value of diff --git a/libgnucash/engine/qofquery.cpp b/libgnucash/engine/qofquery.cpp index 354724fe7b6..b36a0ba3b11 100644 --- a/libgnucash/engine/qofquery.cpp +++ b/libgnucash/engine/qofquery.cpp @@ -110,6 +110,25 @@ typedef struct _QofQueryCB gint count; } QofQueryCB; +/* Query Print functions for use with qof_log_set_level, static prototypes */ +static GList *qof_query_printSearchFor (QofQuery * query, GList * output); +static GList *qof_query_printTerms (QofQuery * query, GList * output); +static GList *qof_query_printSorts (QofQuerySort *s[], const gint numSorts, + GList * output); +static GList *qof_query_printAndTerms (GList * terms, GList * output); +static const char *qof_query_printStringForHow (QofQueryCompare how); +static const char *qof_query_printStringMatch (QofStringMatch s); +static const char *qof_query_printDateMatch (QofDateMatch d); +static const char *qof_query_printNumericMatch (QofNumericMatch n); +static const char *qof_query_printGuidMatch (QofGuidMatch g); +static const char *qof_query_printCharMatch (QofCharMatch c); +static GList *qof_query_printPredData (QofQueryPredData *pd, GList *lst); +static GString *qof_query_printParamPath (QofQueryParamList * parmList); +static void qof_query_printValueForParam (QofQueryPredData *pd, GString * gs); +static void qof_query_printOutput (GList * output); +static void qof_query_print (QofQuery * query); + + /* initial_term will be owned by the new Query */ static void query_init (QofQuery *q, QofQueryTerm *initial_term) { @@ -1493,30 +1512,6 @@ gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2) /* Query Print functions for use with qof_log_set_level. */ -/* Static prototypes */ -static GList *qof_query_printSearchFor (QofQuery * query, GList * output); -static GList *qof_query_printTerms (QofQuery * query, GList * output); -static GList *qof_query_printSorts (QofQuerySort *s[], const gint numSorts, - GList * output); -static GList *qof_query_printAndTerms (GList * terms, GList * output); -static const char *qof_query_printStringForHow (QofQueryCompare how); -static const char *qof_query_printStringMatch (QofStringMatch s); -static const char *qof_query_printDateMatch (QofDateMatch d); -static const char *qof_query_printNumericMatch (QofNumericMatch n); -static const char *qof_query_printGuidMatch (QofGuidMatch g); -static const char *qof_query_printCharMatch (QofCharMatch c); -static GList *qof_query_printPredData (QofQueryPredData *pd, GList *lst); -static GString *qof_query_printParamPath (QofQueryParamList * parmList); -static void qof_query_printValueForParam (QofQueryPredData *pd, GString * gs); -static void qof_query_printOutput (GList * output); - -/** \deprecated access via qof_log instead. - The query will be logged automatically if - qof_log_set_level(QOF_MOD_QUERY, ...) is set to QOF_LOG_DEBUG. - - This function cycles through a QofQuery object, and - prints out the values of the various members of the query -*/ void qof_query_print (QofQuery * query) { diff --git a/libgnucash/engine/qofquery.h b/libgnucash/engine/qofquery.h index 1bfc70cb035..791315c6cee 100644 --- a/libgnucash/engine/qofquery.h +++ b/libgnucash/engine/qofquery.h @@ -368,13 +368,6 @@ void qof_query_set_max_results (QofQuery *q, int n); */ gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2); -/** Log the Query - * - * \deprecated Do not call directly, use the standard log - * module code: ::qof_log_set_level(QOF_MOD_QUERY, QOF_LOG_DEBUG); - */ -void qof_query_print (QofQuery *query); - /** Return the type of data we're querying for */ /*@ dependent @*/ QofIdType qof_query_get_search_for (const QofQuery *q); diff --git a/libgnucash/engine/test/test-gnc-uri-utils.c b/libgnucash/engine/test/test-gnc-uri-utils.c index 2f4bbd8c5d3..171fbdf28f8 100644 --- a/libgnucash/engine/test/test-gnc-uri-utils.c +++ b/libgnucash/engine/test/test-gnc-uri-utils.c @@ -228,7 +228,7 @@ test_gnc_uri_get_components() } } -/* TEST: gnc_uri_get_protocol */ +/* TEST: gnc_uri_get_scheme */ static void test_gnc_uri_get_scheme() { @@ -291,7 +291,7 @@ test_gnc_uri_normalize_uri() } } -/* TEST: gnc_uri_is_file_protocol */ +/* TEST: gnc_uri_is_file_scheme */ static void test_gnc_uri_is_file_scheme() {