Skip to content

Commit

Permalink
Remove I7App parameter from i7_app_foreach_installed_extension callbacks
Browse files Browse the repository at this point in the history
It is no longer needed.
  • Loading branch information
ptomato committed Apr 8, 2024
1 parent 3c94719 commit ee7ed5a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ i7_app_foreach_installed_extension(I7App *self, gboolean builtin, I7AppAuthorFun
continue;

if(author_func)
author_result = author_func(self, author_info, author_func_data);
author_result = author_func(author_info, author_func_data);
else
author_result = NULL;

Expand All @@ -965,7 +965,7 @@ i7_app_foreach_installed_extension(I7App *self, gboolean builtin, I7AppAuthorFun
continue;

if(extension_func)
extension_func(self, author_file, extension_info, author_result, extension_func_data);
extension_func(author_file, extension_info, author_result, extension_func_data);

g_object_unref(extension_info);
}
Expand Down Expand Up @@ -994,7 +994,7 @@ i7_app_foreach_installed_extension(I7App *self, gboolean builtin, I7AppAuthorFun

/* Helper function: Add author to tree store callback */
static GtkTreeIter *
add_author_to_tree_store(I7App *app, GFileInfo *info, GtkTreeStore *store)
add_author_to_tree_store(GFileInfo *info, GtkTreeStore *store)
{
GtkTreeIter parent_iter;
const char *author_display_name = g_file_info_get_display_name(info);
Expand All @@ -1016,7 +1016,7 @@ add_author_to_tree_store(I7App *app, GFileInfo *info, GtkTreeStore *store)

/* Helper function: add extension to tree store as a non-built-in extension */
static void
add_extension_to_tree_store(I7App *app, GFile *parent, GFileInfo *info, GtkTreeIter *parent_iter, GtkTreeStore *store)
add_extension_to_tree_store(GFile *parent, GFileInfo *info, GtkTreeIter *parent_iter, GtkTreeStore *store)
{
GError *error = NULL;
const char *extension_name = g_file_info_get_name(info);
Expand Down Expand Up @@ -1055,7 +1055,7 @@ add_extension_to_tree_store(I7App *app, GFile *parent, GFileInfo *info, GtkTreeI
/* Helper function: add extension to tree store as a built-in extension. Makes
* sure that user-installed extensions override the built-in ones. */
static void
add_builtin_extension_to_tree_store(I7App *app, GFile *parent, GFileInfo *info, GtkTreeIter *parent_iter, GtkTreeStore *store)
add_builtin_extension_to_tree_store(GFile *parent, GFileInfo *info, GtkTreeIter *parent_iter, GtkTreeStore *store)
{
GError *error = NULL;
const char *extension_name = g_file_info_get_name(info);
Expand Down
6 changes: 2 additions & 4 deletions src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ typedef void (*I7DocumentForeachFunc)(I7Document *, gpointer);

/**
* I7AppAuthorFunc:
* @app: the application
* @info: the #GFileInfo for the author directory.
* @data: user data to pass to the callback.
*
* Callback for enumerating installed extensions, called for each author
* directory. May return a result, which is passed to #I7AppExtensionFunc for
* each extension file found in that author directory.
*/
typedef void * (*I7AppAuthorFunc)(I7App *app, GFileInfo *info, void *data);
typedef void * (*I7AppAuthorFunc)(GFileInfo *info, void *data);
/**
* I7AppExtensionFunc:
* @app: the application
* @parent: the #GFile for the extension file's parent.
* @info: the #GFileInfo for the extension file.
* @author_result: the return value of the #I7AppAuthorFunc for the parent.
Expand All @@ -59,7 +57,7 @@ typedef void * (*I7AppAuthorFunc)(I7App *app, GFileInfo *info, void *data);
* Callback for enumerating installed extensions, called for each author
* directory.
*/
typedef void (*I7AppExtensionFunc)(I7App *app, GFile *parent, GFileInfo *info, void *author_result, void *data);
typedef void (*I7AppExtensionFunc)(GFile *parent, GFileInfo *info, void *author_result, void *data);

GType i7_app_get_type(void) G_GNUC_CONST;
I7App *i7_app_new(void);
Expand Down
2 changes: 1 addition & 1 deletion src/searchwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ i7_search_window_search_project(I7SearchWindow *self)
}

static void
extension_search_result(I7App *app, GFile *parent, GFileInfo *info, gpointer unused, I7SearchWindow *self)
extension_search_result(GFile *parent, GFileInfo *info, gpointer unused, I7SearchWindow *self)
{
I7SearchWindowPrivate *priv = i7_search_window_get_instance_private(self);
GError *err = NULL;
Expand Down

0 comments on commit ee7ed5a

Please sign in to comment.