Skip to content

Commit

Permalink
[Cruft Reduction] Remove unused functions from src/gnome-utils.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21578 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
jralls committed Nov 18, 2011
1 parent 921bba1 commit e1ce730
Show file tree
Hide file tree
Showing 22 changed files with 12 additions and 1,594 deletions.
31 changes: 0 additions & 31 deletions src/gnome-utils/assistant-utils.c
Expand Up @@ -32,37 +32,6 @@
#include "qof.h"
#include "gnc-gnome-utils.h"

void
gnc_assistant_set_watermark_images (GtkAssistant *assistant,
const char *top_path,
const char *side_path)
{
GdkPixbuf *top_pixbuf, *side_pixbuf;
GList *page_list, *item;
GtkWidget *page;
GtkAssistantPageType page_type;

page_list = gtk_container_get_children(GTK_CONTAINER(assistant));
top_pixbuf = gnc_gnome_get_gdkpixbuf(top_path);
side_pixbuf = gnc_gnome_get_gdkpixbuf(side_path);

for (item = page_list; item; item = g_list_next(item))
{
page = item->data;
page_type = gtk_assistant_get_page_type(assistant, page);

gtk_assistant_set_page_header_image (assistant, page, top_pixbuf);
if ( (page_type == GTK_ASSISTANT_PAGE_INTRO) ||
(page_type == GTK_ASSISTANT_PAGE_SUMMARY) ||
(page_type == GTK_ASSISTANT_PAGE_CONFIRM) )
gtk_assistant_set_page_side_image (assistant, page, side_pixbuf);
}

g_object_unref (G_OBJECT(side_pixbuf));
g_object_unref (G_OBJECT(top_pixbuf));
g_list_free(page_list);
}

void
gnc_assistant_set_colors (GtkAssistant *assistant)
{
Expand Down
3 changes: 0 additions & 3 deletions src/gnome-utils/assistant-utils.h
Expand Up @@ -27,9 +27,6 @@

#include <gtk/gtk.h>

void gnc_assistant_set_watermark_images (GtkAssistant *assistant,
const char *top_path,
const char *side_path);
void gnc_assistant_set_colors (GtkAssistant *assistant);

#endif
13 changes: 0 additions & 13 deletions src/gnome-utils/gnc-gnome-utils.c
Expand Up @@ -189,19 +189,6 @@ gnc_gnome_locate_pixmap (const char *name)
return fullname;
}

char *
gnc_gnome_locate_file (GnomeFileDomain domain, const char *name)
{
char *fullname;

g_return_val_if_fail(name, NULL);
fullname = gnome_program_locate_file(gnucash_program,
domain, name, TRUE, NULL);
if (!fullname)
PERR ("Could not locate file %s", name);
return fullname;
}

char *
gnc_gnome_locate_data_file (const char *name)
{
Expand Down
15 changes: 0 additions & 15 deletions src/gnome-utils/gnc-gnome-utils.h
Expand Up @@ -82,21 +82,6 @@ char *gnc_gnome_locate_data_file (const char *name);
*/
char *gnc_gnome_locate_ui_file (const char *name);

/** Given a file name, find the file in the directories associated
* with the given file domain. This routine will display an error
* message if it can't find the file.
*
* @param domain The GnomeFileDomain, e.g. GNOME_FILE_DOMAIN_APP_HELP
*
* @param name The name of the file to be found.
*
* @return the full path name of the file, or NULL of the file can't
* be found.
*
* @note It is the caller's responsibility to free the returned string.
*/
char *gnc_gnome_locate_file (GnomeFileDomain domain, const char *name);

/** Launch the default gnome help browser and open to a given link
* within a given file. This routine will display an error message
* if it can't find the help file or can't open the help browser.
Expand Down
30 changes: 0 additions & 30 deletions src/gnome-utils/gnc-tree-model-account-types.c
Expand Up @@ -172,13 +172,6 @@ gnc_tree_model_account_types_is_valid (GtkTreeModel *model,
return (valid_types & (1 << type)) ? TRUE : FALSE;
}

GtkTreeModel *
gnc_tree_model_account_types_valid (void)
{
return gnc_tree_model_account_types_filter_using_mask(
xaccAccountTypesValid());
}

GtkTreeModel *
gnc_tree_model_account_types_filter_using_mask (guint32 types)
{
Expand Down Expand Up @@ -212,29 +205,6 @@ gnc_tree_model_account_types_get_mask (GtkTreeModel *f_model)
return GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (f_model), TYPE_MASK));
}

guint32
gnc_tree_model_account_types_get_selected (GncTreeModelAccountTypes * model)
{
GncTreeModelAccountTypesPrivate *priv;

g_return_val_if_fail (model != NULL, 0);

priv = GNC_TREE_MODEL_ACCOUNT_TYPES_GET_PRIVATE(model);
return priv->selected;
}

void
gnc_tree_model_account_types_set_selected (GncTreeModelAccountTypes * model,
guint32 selected)
{
GncTreeModelAccountTypesPrivate *priv;

g_return_if_fail (model != NULL);

priv = GNC_TREE_MODEL_ACCOUNT_TYPES_GET_PRIVATE(model);
priv->selected = selected;
}

guint32
gnc_tree_model_account_types_get_selection (GtkTreeSelection *sel)
{
Expand Down
11 changes: 0 additions & 11 deletions src/gnome-utils/gnc-tree-model-account-types.h
Expand Up @@ -97,11 +97,6 @@ GType gnc_tree_model_account_types_get_type (void);

/*************** Method 1 functions ***************/

/* Returns a GtkTreeModelFilter that wraps the model. Deprecated and root
account types will be filtered. Caller is responsible for
ref/unref. */
GtkTreeModel * gnc_tree_model_account_types_valid (void);

/* Returns a GtkTreeModelFilter that wraps the model. Only account
types specified by the 'types' bitmask are visible. To force the
visibility of deprecated account types, pass
Expand Down Expand Up @@ -147,12 +142,6 @@ void gnc_tree_model_account_types_set_selection(GtkTreeSelection *sel,

GtkTreeModel *gnc_tree_model_account_types_new(guint32 selected);

guint32 gnc_tree_model_account_types_get_selected(
GncTreeModelAccountTypes * model);

void gnc_tree_model_account_types_set_selected(
GncTreeModelAccountTypes * model, guint32 selected);


G_END_DECLS

Expand Down
35 changes: 0 additions & 35 deletions src/gnome-utils/gnc-tree-model-commodity.c
Expand Up @@ -1070,41 +1070,6 @@ gnc_tree_model_commodity_get_iter_from_namespace (GncTreeModelCommodity *model,
return TRUE;
}

/*
* Convert a model/namespace pair into a gtk_tree_model_path. This
* routine should only be called from the file
* gnc-tree-view-commodity.c.
*/
GtkTreePath *
gnc_tree_model_commodity_get_path_from_namespace (GncTreeModelCommodity *model,
gnc_commodity_namespace *namespace)
{
GtkTreeIter tree_iter;
GtkTreePath *tree_path;

ENTER("model %p, namespace %p", model, namespace);
g_return_val_if_fail (GNC_IS_TREE_MODEL_COMMODITY (model), NULL);
g_return_val_if_fail (namespace != NULL, NULL);

if (!gnc_tree_model_commodity_get_iter_from_namespace (model, namespace, &tree_iter))
{
LEAVE("no iter");
return NULL;
}

tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &tree_iter);
if (tree_path)
{
gchar *path_string = gtk_tree_path_to_string(tree_path);
LEAVE("path (2) %s", path_string);
g_free(path_string);
}
else
{
LEAVE("no path");
}
return tree_path;
}

/************************************************************/
/* Commodity Tree Model - Engine Event Handling Functions */
Expand Down
13 changes: 0 additions & 13 deletions src/gnome-utils/gnc-tree-model-commodity.h
Expand Up @@ -209,19 +209,6 @@ gboolean gnc_tree_model_commodity_get_iter_from_commodity (GncTreeModelCommodity
gnc_commodity *commodity,
GtkTreeIter *iter);

/** Convert a commodity namespace pointer into a GtkTreePath.
*
* @param model A pointer to the commodity tree model.
*
* @param namespace A pointer to the gnucash commodity namespace.
*
* @return A pointer to a GtkTreePath describing the location of this
* namespace. This pointer must be freed by the caller when no
* longer needed. This routine will return NULL if the namespace
* does not exist in the tree. */
GtkTreePath *gnc_tree_model_commodity_get_path_from_namespace (GncTreeModelCommodity *model,
gnc_commodity_namespace *namespace);

/** Convert a commodity pointer into a GtkTreePath.
*
* @param model A pointer to the commodity tree model.
Expand Down
72 changes: 0 additions & 72 deletions src/gnome-utils/gnc-tree-model-price.c
Expand Up @@ -1296,42 +1296,6 @@ gnc_tree_model_price_get_iter_from_commodity (GncTreeModelPrice *model,
return TRUE;
}

/*
* Convert a model/commodity pair into a gtk_tree_model_path. This
* routine should only be called from the file
* gnc-tree-view-price.c.
*/
GtkTreePath *
gnc_tree_model_price_get_path_from_commodity (GncTreeModelPrice *model,
gnc_commodity *commodity)
{
GtkTreeIter tree_iter;
GtkTreePath *tree_path;

ENTER("model %p, commodity %p", model, commodity);
g_return_val_if_fail (GNC_IS_TREE_MODEL_PRICE (model), NULL);
g_return_val_if_fail (commodity != NULL, NULL);

if (!gnc_tree_model_price_get_iter_from_commodity (model, commodity, &tree_iter))
{
LEAVE("no iter");
return NULL;
}

tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &tree_iter);
if (tree_path)
{
gchar *path_string = gtk_tree_path_to_string(tree_path);
LEAVE("path (2) %s", path_string);
g_free(path_string);
}
else
{
LEAVE("no path");
}
return tree_path;
}

/*
* Convert a model/namespace pair into a gtk_tree_model_iter. This
* routine should only be called from the file
Expand Down Expand Up @@ -1370,42 +1334,6 @@ gnc_tree_model_price_get_iter_from_namespace (GncTreeModelPrice *model,
return TRUE;
}

/*
* Convert a model/namespace pair into a gtk_tree_model_path. This
* routine should only be called from the file
* gnc-tree-view-price.c.
*/
GtkTreePath *
gnc_tree_model_price_get_path_from_namespace (GncTreeModelPrice *model,
gnc_commodity_namespace *namespace)
{
GtkTreeIter tree_iter;
GtkTreePath *tree_path;

ENTER("model %p, namespace %p", model, namespace);
g_return_val_if_fail (GNC_IS_TREE_MODEL_PRICE (model), NULL);
g_return_val_if_fail (namespace != NULL, NULL);

if (!gnc_tree_model_price_get_iter_from_namespace (model, namespace, &tree_iter))
{
LEAVE("no iter");
return NULL;
}

tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &tree_iter);
if (tree_path)
{
gchar *path_string = gtk_tree_path_to_string(tree_path);
LEAVE("path (2) %s", path_string);
g_free(path_string);
}
else
{
LEAVE("no path");
}
return tree_path;
}

/************************************************************/
/* Price Tree Model - Engine Event Handling Functions */
/************************************************************/
Expand Down
26 changes: 0 additions & 26 deletions src/gnome-utils/gnc-tree-model-price.h
Expand Up @@ -251,32 +251,6 @@ gboolean gnc_tree_model_price_get_iter_from_price (GncTreeModelPrice *model,
GNCPrice *price,
GtkTreeIter *iter);

/** Convert a commodity namespace pointer into a GtkTreePath.
*
* @param model A pointer to the price tree model.
*
* @param namespace A pointer to the gnucash commodity namespace.
*
* @return A pointer to a GtkTreePath describing the location of this
* namespace. This pointer must be freed by the caller when no
* longer needed. This routine will return NULL if the namespace
* does not exist in the tree. */
GtkTreePath *gnc_tree_model_price_get_path_from_namespace (GncTreeModelPrice *model,
gnc_commodity_namespace *namespace);

/** Convert a commodity pointer into a GtkTreePath.
*
* @param model A pointer to the price tree model.
*
* @param commodity A pointer to the gnucash commodity.
*
* @return A pointer to a GtkTreePath describing the location of this
* commodity. This pointer must be freed by the caller when no
* longer needed. This routine will return NULL if the commodity
* does not exist in the tree. */
GtkTreePath *gnc_tree_model_price_get_path_from_commodity (GncTreeModelPrice *model,
gnc_commodity *commodity);

/** Convert a price pointer into a GtkTreePath.
*
* @param model A pointer to the price tree model.
Expand Down

0 comments on commit e1ce730

Please sign in to comment.