Remove some unused code

No more callers of _gtk_find_module.
This commit is contained in:
Matthias Clasen 2018-02-18 21:54:43 -05:00
parent b3be9868d8
commit 9ea80a7506
2 changed files with 0 additions and 78 deletions

View File

@ -112,77 +112,3 @@ _gtk_get_module_path (const gchar *type)
return result; return result;
} }
/* Like g_module_path, but use .la as the suffix
*/
static gchar*
module_build_la_path (const gchar *directory,
const gchar *module_name)
{
gchar *filename;
gchar *result;
if (strncmp (module_name, "lib", 3) == 0)
filename = (gchar *)module_name;
else
filename = g_strconcat ("lib", module_name, ".la", NULL);
if (directory && *directory)
result = g_build_filename (directory, filename, NULL);
else
result = g_strdup (filename);
if (filename != module_name)
g_free (filename);
return result;
}
/**
* _gtk_find_module:
* @name: the name of the module
* @type: the type of the module, for instance 'modules', 'engines', immodules'
*
* Looks for a dynamically module named @name of type @type in the standard GTK+
* module search path.
*
* Returns: the pathname to the found module, or %NULL if it wasnt found.
* Free with g_free().
**/
gchar *
_gtk_find_module (const gchar *name,
const gchar *type)
{
gchar **paths;
gchar **path;
gchar *module_name = NULL;
if (g_path_is_absolute (name))
return g_strdup (name);
paths = _gtk_get_module_path (type);
for (path = paths; *path; path++)
{
gchar *tmp_name;
tmp_name = g_module_build_path (*path, name);
if (g_file_test (tmp_name, G_FILE_TEST_EXISTS))
{
module_name = tmp_name;
goto found;
}
g_free(tmp_name);
tmp_name = module_build_la_path (*path, name);
if (g_file_test (tmp_name, G_FILE_TEST_EXISTS))
{
module_name = tmp_name;
goto found;
}
g_free(tmp_name);
}
found:
g_strfreev (paths);
return module_name;
}

View File

@ -27,10 +27,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#include "gtksettings.h"
gchar * _gtk_find_module (const gchar *name,
const gchar *type);
gchar ** _gtk_get_module_path (const gchar *type); gchar ** _gtk_get_module_path (const gchar *type);
G_END_DECLS G_END_DECLS