mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-12 16:50:19 +00:00
Minor tidying up
This commit is contained in:
@@ -882,11 +882,10 @@ fe_confirm (const char *message, void (*yesproc)(void *), void (*noproc)(void *)
|
||||
{
|
||||
/* warning, assuming fe_confirm is used by DCC only! */
|
||||
struct DCC *dcc = ud;
|
||||
char *filepath;
|
||||
|
||||
if (dcc->file)
|
||||
{
|
||||
filepath = g_build_filename (prefs.hex_dcc_dir, dcc->file, NULL);
|
||||
char *filepath = g_build_filename (prefs.hex_dcc_dir, dcc->file, NULL);
|
||||
gtkutil_file_req (message, dcc_saveas_cb, ud, filepath, NULL,
|
||||
FRF_WRITE|FRF_NOASKOVERWRITE|FRF_FILTERISINITIAL);
|
||||
g_free (filepath);
|
||||
|
||||
@@ -596,7 +596,8 @@ key_dialog_save (GtkWidget *wid, gpointer userdata)
|
||||
else
|
||||
keybind_list = g_slist_append (keybind_list, kb);
|
||||
|
||||
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));
|
||||
}
|
||||
while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));
|
||||
}
|
||||
|
||||
if (key_save_kbs () == 0)
|
||||
|
||||
@@ -2287,7 +2287,7 @@ mg_word_clicked (GtkWidget *xtext, char *word, GdkEventButton *even)
|
||||
case WORD_EMAIL:
|
||||
word[end] = 0;
|
||||
word += start;
|
||||
tmp = g_strdup_printf("mailto:%s", word + (ispunct (*word)? 1: 0));
|
||||
tmp = g_strdup_printf ("mailto:%s", word + (ispunct (*word) ? 1 : 0));
|
||||
menu_urlmenu (even, tmp);
|
||||
g_free (tmp);
|
||||
break;
|
||||
|
||||
@@ -403,12 +403,11 @@ toggle_cb (GtkWidget *item, char *pref_name)
|
||||
static int
|
||||
is_in_path (char *cmd)
|
||||
{
|
||||
char *prog = g_strdup (cmd + 1); /* 1st char is "!" */
|
||||
char *path, *orig;
|
||||
char *orig = g_strdup (cmd + 1); /* 1st char is "!" */
|
||||
char *prog = orig;
|
||||
char **argv;
|
||||
int argc;
|
||||
|
||||
orig = prog; /* save for free()ing */
|
||||
/* special-case these default entries. */
|
||||
/* 123456789012345678 */
|
||||
if (strncmp (prog, "gnome-terminal -x ", 18) == 0)
|
||||
@@ -417,15 +416,14 @@ is_in_path (char *cmd)
|
||||
|
||||
if (g_shell_parse_argv (prog, &argc, &argv, NULL))
|
||||
{
|
||||
path = g_find_program_in_path (argv[0]);
|
||||
char *path = g_find_program_in_path (argv[0]);
|
||||
g_strfreev (argv);
|
||||
if (path)
|
||||
{
|
||||
g_free (path);
|
||||
g_free (orig);
|
||||
g_strfreev (argv);
|
||||
return 1;
|
||||
}
|
||||
g_strfreev (argv);
|
||||
}
|
||||
|
||||
g_free (orig);
|
||||
|
||||
@@ -87,10 +87,9 @@ pixmap_load_from_file (char *filename)
|
||||
static GdkPixbuf *
|
||||
load_pixmap (const char *filename)
|
||||
{
|
||||
gchar *path;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "icons" G_DIR_SEPARATOR_S "%s.png", get_xdir (), filename);
|
||||
gchar *path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "icons" G_DIR_SEPARATOR_S "%s.png", get_xdir (), filename);
|
||||
pixbuf = gdk_pixbuf_new_from_file (path, 0);
|
||||
g_free (path);
|
||||
|
||||
|
||||
@@ -156,9 +156,7 @@ plugingui_load_cb (session *sess, char *file)
|
||||
void
|
||||
plugingui_load (void)
|
||||
{
|
||||
char *sub_dir;
|
||||
|
||||
sub_dir = g_build_filename (get_xdir(), "addons", NULL);
|
||||
char *sub_dir = g_build_filename (get_xdir(), "addons", NULL);
|
||||
|
||||
gtkutil_file_req (_("Select a Plugin or Script to load"), plugingui_load_cb, current_sess,
|
||||
sub_dir, "*."G_MODULE_SUFFIX";*.lua;*.pl;*.py;*.tcl;*.js", FRF_FILTERISINITIAL|FRF_EXTENSIONS);
|
||||
|
||||
Reference in New Issue
Block a user