Skip to content

Commit

Permalink
Doxygen - drop obvious cases of deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanssens committed May 22, 2024
1 parent 05538f2 commit bfa8e9a
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 117 deletions.
2 changes: 1 addition & 1 deletion gnucash/gnome/window-autoclear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions libgnucash/engine/Split.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" */
Expand Down
2 changes: 0 additions & 2 deletions libgnucash/engine/Transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" */
Expand Down
4 changes: 0 additions & 4 deletions libgnucash/engine/gnc-date.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 0 additions & 22 deletions libgnucash/engine/gnc-uri-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
48 changes: 0 additions & 48 deletions libgnucash/engine/gnc-uri-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions libgnucash/engine/qofbook-p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 19 additions & 24 deletions libgnucash/engine/qofquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
7 changes: 0 additions & 7 deletions libgnucash/engine/qofquery.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions libgnucash/engine/test/test-gnc-uri-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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()
{
Expand Down

0 comments on commit bfa8e9a

Please sign in to comment.