mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 18:50:19 +00:00
Refactor plugingui_load to improve directory handling
This commit is contained in:
committed by
GitHub
parent
d5561a21e3
commit
91238d99ae
@@ -234,12 +234,15 @@ plugingui_load_cb (session *sess, char *file)
|
|||||||
void
|
void
|
||||||
plugingui_load (void)
|
plugingui_load (void)
|
||||||
{
|
{
|
||||||
char *sub_dir = g_build_filename (get_xdir(), "addons", NULL);
|
const char *xdir = get_xdir ();
|
||||||
|
char *sub_dir = NULL;
|
||||||
|
|
||||||
|
if (xdir && xdir[0] != '\0')
|
||||||
|
sub_dir = g_build_filename (xdir, "addons", NULL);
|
||||||
|
|
||||||
gtkutil_file_req (NULL, _("Select a Plugin or Script to load"), plugingui_load_cb, NULL,
|
gtkutil_file_req (NULL, _("Select a Plugin or Script to load"), plugingui_load_cb, NULL,
|
||||||
sub_dir, "*."PLUGIN_SUFFIX";*.lua;*.pl;*.py;*.tcl;*.js", FRF_FILTERISINITIAL|FRF_EXTENSIONS);
|
sub_dir, "*."PLUGIN_SUFFIX";*.lua;*.pl;*.py;*.tcl;*.js", FRF_FILTERISINITIAL|FRF_EXTENSIONS);
|
||||||
|
g_free (sub_dir);
|
||||||
g_free (sub_dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user