Use 'SETPTR' instead of 'setptr'
This makes it clearer we're using a macro.
This commit is contained in:
parent
ed66c2b293
commit
b287553e4a
@ -241,7 +241,7 @@ static void add_top_level_entry(void)
|
||||
return; /* ignore 'C:\' or '/' */
|
||||
|
||||
utf8_dir = g_path_get_dirname(current_dir);
|
||||
setptr(utf8_dir, utils_get_utf8_from_locale(utf8_dir));
|
||||
SETPTR(utf8_dir, utils_get_utf8_from_locale(utf8_dir));
|
||||
|
||||
gtk_list_store_prepend(file_store, &iter);
|
||||
last_dir_iter = gtk_tree_iter_copy(&iter);
|
||||
@ -305,7 +305,7 @@ static void refresh(void)
|
||||
|
||||
static void on_go_home(void)
|
||||
{
|
||||
setptr(current_dir, g_strdup(g_get_home_dir()));
|
||||
SETPTR(current_dir, g_strdup(g_get_home_dir()));
|
||||
refresh();
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ static void on_current_path(void)
|
||||
|
||||
if (doc == NULL || doc->file_name == NULL || ! g_path_is_absolute(doc->file_name))
|
||||
{
|
||||
setptr(current_dir, get_default_dir());
|
||||
SETPTR(current_dir, get_default_dir());
|
||||
refresh();
|
||||
return;
|
||||
}
|
||||
@ -345,7 +345,7 @@ static void on_current_path(void)
|
||||
dir = g_path_get_dirname(fname);
|
||||
g_free(fname);
|
||||
|
||||
setptr(current_dir, dir);
|
||||
SETPTR(current_dir, dir);
|
||||
refresh();
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ static void on_go_up(void)
|
||||
if (current_dir[len-1] == G_DIR_SEPARATOR)
|
||||
current_dir[len-1] = '\0';
|
||||
/* remove the highest directory part (which becomes the basename of current_dir) */
|
||||
setptr(current_dir, g_path_get_dirname(current_dir));
|
||||
SETPTR(current_dir, g_path_get_dirname(current_dir));
|
||||
refresh();
|
||||
}
|
||||
|
||||
@ -512,7 +512,7 @@ static void open_folder(GtkTreePath *treepath)
|
||||
{
|
||||
gchar *fname = get_tree_path_filename(treepath);
|
||||
|
||||
setptr(current_dir, fname);
|
||||
SETPTR(current_dir, fname);
|
||||
refresh();
|
||||
}
|
||||
|
||||
@ -575,7 +575,7 @@ static void on_find_in_files(GtkMenuItem *menuitem, gpointer user_data)
|
||||
g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL);
|
||||
g_list_free(list);
|
||||
|
||||
setptr(dir, utils_get_utf8_from_locale(dir));
|
||||
SETPTR(dir, utils_get_utf8_from_locale(dir));
|
||||
search_show_find_in_files_dialog(dir);
|
||||
g_free(dir);
|
||||
}
|
||||
@ -782,7 +782,7 @@ static void on_path_entry_activate(GtkEntry *entry, gpointer user_data)
|
||||
else
|
||||
new_dir = g_strdup(g_get_home_dir());
|
||||
|
||||
setptr(current_dir, new_dir);
|
||||
SETPTR(current_dir, new_dir);
|
||||
|
||||
on_clear_filter(NULL, NULL);
|
||||
}
|
||||
@ -1021,11 +1021,11 @@ static void project_change_cb(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GKeyFile
|
||||
g_free(dir);
|
||||
}
|
||||
/* get it into locale encoding */
|
||||
setptr(new_dir, utils_get_locale_from_utf8(new_dir));
|
||||
SETPTR(new_dir, utils_get_locale_from_utf8(new_dir));
|
||||
|
||||
if (! utils_str_equal(current_dir, new_dir))
|
||||
{
|
||||
setptr(current_dir, new_dir);
|
||||
SETPTR(current_dir, new_dir);
|
||||
refresh();
|
||||
}
|
||||
else
|
||||
@ -1046,11 +1046,11 @@ static void document_activate_cb(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc,
|
||||
return;
|
||||
|
||||
new_dir = g_path_get_dirname(doc->file_name);
|
||||
setptr(new_dir, utils_get_locale_from_utf8(new_dir));
|
||||
SETPTR(new_dir, utils_get_locale_from_utf8(new_dir));
|
||||
|
||||
if (! utils_str_equal(current_dir, new_dir))
|
||||
{
|
||||
setptr(current_dir, new_dir);
|
||||
SETPTR(current_dir, new_dir);
|
||||
refresh();
|
||||
}
|
||||
else
|
||||
|
@ -107,7 +107,7 @@ static gboolean backupcopy_set_backup_dir(const gchar *utf8_dir)
|
||||
}
|
||||
/** TODO add utils_is_file_writeable() to the plugin API and make use of it **/
|
||||
|
||||
setptr(backupcopy_backup_dir, tmp);
|
||||
SETPTR(backupcopy_backup_dir, tmp);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -259,7 +259,7 @@ static void instantsave_document_new_cb(GObject *obj, GeanyDocument *doc, gpoint
|
||||
|
||||
if (ft != NULL)
|
||||
/* add the filetype's default extension to the new filename */
|
||||
setptr(new_filename, g_strconcat(new_filename, ".", ft->extension, NULL));
|
||||
SETPTR(new_filename, g_strconcat(new_filename, ".", ft->extension, NULL));
|
||||
|
||||
doc->file_name = new_filename;
|
||||
|
||||
@ -454,7 +454,7 @@ static void configure_response_cb(GtkDialog *dialog, gint response, G_GNUC_UNUSE
|
||||
|
||||
g_key_file_set_integer(config, "backupcopy", "dir_levels", backupcopy_dir_levels);
|
||||
g_key_file_set_string(config, "backupcopy", "time_fmt", text_time);
|
||||
setptr(backupcopy_time_fmt, g_strdup(text_time));
|
||||
SETPTR(backupcopy_time_fmt, g_strdup(text_time));
|
||||
if (enable_backupcopy)
|
||||
{
|
||||
if (NZV(text_dir) && backupcopy_set_backup_dir(text_dir))
|
||||
|
52
src/build.c
52
src/build.c
@ -178,13 +178,13 @@ static void set_command(GeanyBuildCommand *bc, gint id, gchar *str)
|
||||
switch (id)
|
||||
{
|
||||
case GEANY_BC_LABEL:
|
||||
setptr(bc->label, str);
|
||||
SETPTR(bc->label, str);
|
||||
break;
|
||||
case GEANY_BC_COMMAND:
|
||||
setptr(bc->command, str);
|
||||
SETPTR(bc->command, str);
|
||||
break;
|
||||
case GEANY_BC_WORKING_DIR:
|
||||
setptr(bc->working_dir, str);
|
||||
SETPTR(bc->working_dir, str);
|
||||
break;
|
||||
default:
|
||||
g_assert(0);
|
||||
@ -701,7 +701,7 @@ static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *d
|
||||
}
|
||||
|
||||
clear_all_errors();
|
||||
setptr(current_dir_entered, NULL);
|
||||
SETPTR(current_dir_entered, NULL);
|
||||
|
||||
cmd_string = g_strdup(cmd);
|
||||
|
||||
@ -874,7 +874,7 @@ static GPid build_run_cmd(GeanyDocument *doc, guint cmdindex)
|
||||
|
||||
if (vc->skip_run_script)
|
||||
{
|
||||
setptr(vte_cmd_nonscript, utils_get_utf8_from_locale(vte_cmd_nonscript));
|
||||
SETPTR(vte_cmd_nonscript, utils_get_utf8_from_locale(vte_cmd_nonscript));
|
||||
vte_cmd = g_strconcat(vte_cmd_nonscript, "\n", NULL);
|
||||
g_free(vte_cmd_nonscript);
|
||||
}
|
||||
@ -1005,7 +1005,7 @@ static void process_build_output_line(const gchar *str, gint color)
|
||||
|
||||
if (build_parse_make_dir(msg, &tmp))
|
||||
{
|
||||
setptr(current_dir_entered, tmp);
|
||||
SETPTR(current_dir_entered, tmp);
|
||||
}
|
||||
msgwin_parse_compiler_error_line(msg, current_dir_entered, &filename, &line);
|
||||
|
||||
@ -1257,7 +1257,7 @@ static void on_make_custom_input_response(const gchar *input)
|
||||
{
|
||||
GeanyDocument *doc = document_get_current();
|
||||
|
||||
setptr(build_info.custom_target, g_strdup(input));
|
||||
SETPTR(build_info.custom_target, g_strdup(input));
|
||||
build_command(doc, GBO_TO_GBG(GEANY_GBO_CUSTOM), GBO_TO_CMD(GEANY_GBO_CUSTOM),
|
||||
build_info.custom_target);
|
||||
}
|
||||
@ -2182,7 +2182,7 @@ static gboolean read_regex(GtkWidget *regexentry, gchar **src, gchar **dst)
|
||||
{
|
||||
if (dst != NULL)
|
||||
{
|
||||
setptr(*dst, g_strdup(reg));
|
||||
SETPTR(*dst, g_strdup(reg));
|
||||
changed = TRUE;
|
||||
}
|
||||
}
|
||||
@ -2338,12 +2338,12 @@ static void build_load_menu_grp(GKeyFile *config, GeanyBuildCommand **dst, gint
|
||||
if (label != NULL)
|
||||
{
|
||||
dstcmd[cmd].exists = TRUE;
|
||||
setptr(dstcmd[cmd].label, label);
|
||||
SETPTR(dstcmd[cmd].label, label);
|
||||
set_key_fld(key,"CM");
|
||||
setptr(dstcmd[cmd].command,
|
||||
SETPTR(dstcmd[cmd].command,
|
||||
g_key_file_get_string(config, build_grp_name, key, NULL));
|
||||
set_key_fld(key,"WD");
|
||||
setptr(dstcmd[cmd].working_dir,
|
||||
SETPTR(dstcmd[cmd].working_dir,
|
||||
g_key_file_get_string(config, build_grp_name, key, NULL));
|
||||
}
|
||||
else dstcmd[cmd].exists = FALSE;
|
||||
@ -2373,7 +2373,7 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
build_load_menu_grp(config, &(ft->filecmds), GEANY_GBG_FT, NULL, TRUE);
|
||||
build_load_menu_grp(config, &(ft->ftdefcmds), GEANY_GBG_NON_FT, NULL, TRUE);
|
||||
build_load_menu_grp(config, &(ft->execcmds), GEANY_GBG_EXEC, NULL, TRUE);
|
||||
setptr(ft->error_regex_string,
|
||||
SETPTR(ft->error_regex_string,
|
||||
g_key_file_get_string(config, build_grp_name, "error_regex", NULL));
|
||||
break;
|
||||
case GEANY_BCS_HOME_FT:
|
||||
@ -2382,18 +2382,18 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
return;
|
||||
build_load_menu_grp(config, &(ft->homefilecmds), GEANY_GBG_FT, NULL, FALSE);
|
||||
build_load_menu_grp(config, &(ft->homeexeccmds), GEANY_GBG_EXEC, NULL, FALSE);
|
||||
setptr(ft->homeerror_regex_string,
|
||||
SETPTR(ft->homeerror_regex_string,
|
||||
g_key_file_get_string(config, build_grp_name, "error_regex", NULL));
|
||||
break;
|
||||
case GEANY_BCS_PREF:
|
||||
build_load_menu_grp(config, &non_ft_pref, GEANY_GBG_NON_FT, NULL, FALSE);
|
||||
build_load_menu_grp(config, &exec_pref, GEANY_GBG_EXEC, NULL, FALSE);
|
||||
setptr(regex_pref, g_key_file_get_string(config, build_grp_name, "error_regex", NULL));
|
||||
SETPTR(regex_pref, g_key_file_get_string(config, build_grp_name, "error_regex", NULL));
|
||||
break;
|
||||
case GEANY_BCS_PROJ:
|
||||
build_load_menu_grp(config, &non_ft_proj, GEANY_GBG_NON_FT, NULL, FALSE);
|
||||
build_load_menu_grp(config, &exec_proj, GEANY_GBG_EXEC, NULL, FALSE);
|
||||
setptr(regex_proj, g_key_file_get_string(config, build_grp_name, "error_regex", NULL));
|
||||
SETPTR(regex_proj, g_key_file_get_string(config, build_grp_name, "error_regex", NULL));
|
||||
pj = (GeanyProject*)p;
|
||||
if (p == NULL)
|
||||
return;
|
||||
@ -2411,7 +2411,7 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
{
|
||||
gchar *regkey = g_strdup_printf("%serror_regex", *ftname);
|
||||
g_ptr_array_add(pj->build_filetypes_list, ft);
|
||||
setptr(ft->projerror_regex_string,
|
||||
SETPTR(ft->projerror_regex_string,
|
||||
g_key_file_get_string(config, build_grp_name, regkey, NULL));
|
||||
g_free(regkey);
|
||||
build_load_menu_grp(config, &(ft->projfilecmds), GEANY_GBG_FT, *ftname, FALSE);
|
||||
@ -2433,9 +2433,9 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
#define ASSIGNIF(type, id, string, value) \
|
||||
if (NZV(value) && ! type[GBO_TO_CMD(id)].exists) { \
|
||||
type[GBO_TO_CMD(id)].exists = TRUE; \
|
||||
setptr(type[GBO_TO_CMD(id)].label, g_strdup(string)); \
|
||||
setptr(type[GBO_TO_CMD(id)].command, (value)); \
|
||||
setptr(type[GBO_TO_CMD(id)].working_dir, NULL); \
|
||||
SETPTR(type[GBO_TO_CMD(id)].label, g_strdup(string)); \
|
||||
SETPTR(type[GBO_TO_CMD(id)].command, (value)); \
|
||||
SETPTR(type[GBO_TO_CMD(id)].working_dir, NULL); \
|
||||
type[GBO_TO_CMD(id)].old = TRUE; \
|
||||
} else \
|
||||
g_free(value);
|
||||
@ -2480,11 +2480,11 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
else
|
||||
makebasedir = g_strdup("%d");
|
||||
if (non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].old)
|
||||
setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].working_dir, g_strdup(makebasedir));
|
||||
SETPTR(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_ALL)].working_dir, g_strdup(makebasedir));
|
||||
if (non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].old)
|
||||
setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].working_dir, g_strdup(makebasedir));
|
||||
SETPTR(non_ft_pref[GBO_TO_CMD(GEANY_GBO_CUSTOM)].working_dir, g_strdup(makebasedir));
|
||||
if (non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)].old)
|
||||
setptr(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)].working_dir, g_strdup("%d"));
|
||||
SETPTR(non_ft_pref[GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)].working_dir, g_strdup("%d"));
|
||||
value = g_key_file_get_string(config, "project", "run_cmd", NULL);
|
||||
if (NZV(value))
|
||||
{
|
||||
@ -2493,9 +2493,9 @@ void build_load_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
if (! exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].exists)
|
||||
{
|
||||
exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].exists = TRUE;
|
||||
setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].label, g_strdup(_("_Execute")));
|
||||
setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].command, value);
|
||||
setptr(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].working_dir, g_strdup(basedir));
|
||||
SETPTR(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].label, g_strdup(_("_Execute")));
|
||||
SETPTR(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].command, value);
|
||||
SETPTR(exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].working_dir, g_strdup(basedir));
|
||||
exec_proj[GBO_TO_CMD(GEANY_GBO_EXEC)].old = TRUE;
|
||||
}
|
||||
}
|
||||
@ -2675,7 +2675,7 @@ guint build_get_group_count(GeanyBuildGroup grp)
|
||||
static void on_project_close(void)
|
||||
{
|
||||
/* remove project regexen */
|
||||
setptr(regex_proj, NULL);
|
||||
SETPTR(regex_proj, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -468,8 +468,8 @@ G_MODULE_EXPORT void on_toolbutton_save_clicked(GtkAction *action, gpointer user
|
||||
/* store text, clear search flags so we can use Search->Find Next/Previous */
|
||||
static void setup_find(const gchar *text, gboolean backwards)
|
||||
{
|
||||
setptr(search_data.text, g_strdup(text));
|
||||
setptr(search_data.original_text, g_strdup(text));
|
||||
SETPTR(search_data.text, g_strdup(text));
|
||||
SETPTR(search_data.original_text, g_strdup(text));
|
||||
search_data.flags = 0;
|
||||
search_data.backwards = backwards;
|
||||
search_data.search_bar = TRUE;
|
||||
@ -1287,7 +1287,7 @@ G_MODULE_EXPORT void on_insert_date_activate(GtkMenuItem *menuitem, gpointer use
|
||||
"You can use any conversion specifiers which can be used with the ANSI C strftime function."),
|
||||
ui_prefs.custom_date_format);
|
||||
if (str)
|
||||
setptr(ui_prefs.custom_date_format, str);
|
||||
SETPTR(ui_prefs.custom_date_format, str);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1603,7 +1603,7 @@ G_MODULE_EXPORT void on_menu_open_selected_file1_activate(GtkMenuItem *menuitem,
|
||||
g_return_if_fail(doc != NULL);
|
||||
|
||||
sel = editor_get_default_selection(doc->editor, TRUE, wc);
|
||||
setptr(sel, utils_get_locale_from_utf8(sel));
|
||||
SETPTR(sel, utils_get_locale_from_utf8(sel));
|
||||
|
||||
if (sel != NULL)
|
||||
{
|
||||
@ -1616,7 +1616,7 @@ G_MODULE_EXPORT void on_menu_open_selected_file1_activate(GtkMenuItem *menuitem,
|
||||
gchar *path;
|
||||
|
||||
path = utils_get_current_file_dir_utf8();
|
||||
setptr(path, utils_get_locale_from_utf8(path));
|
||||
SETPTR(path, utils_get_locale_from_utf8(path));
|
||||
if (!path)
|
||||
path = g_get_current_dir();
|
||||
|
||||
@ -1626,17 +1626,17 @@ G_MODULE_EXPORT void on_menu_open_selected_file1_activate(GtkMenuItem *menuitem,
|
||||
app->project != NULL && NZV(app->project->base_path))
|
||||
{
|
||||
/* try the project's base path */
|
||||
setptr(path, project_get_base_path());
|
||||
setptr(path, utils_get_locale_from_utf8(path));
|
||||
setptr(filename, g_build_path(G_DIR_SEPARATOR_S, path, sel, NULL));
|
||||
SETPTR(path, project_get_base_path());
|
||||
SETPTR(path, utils_get_locale_from_utf8(path));
|
||||
SETPTR(filename, g_build_path(G_DIR_SEPARATOR_S, path, sel, NULL));
|
||||
}
|
||||
g_free(path);
|
||||
#ifdef G_OS_UNIX
|
||||
if (! g_file_test(filename, G_FILE_TEST_EXISTS))
|
||||
setptr(filename, g_build_path(G_DIR_SEPARATOR_S, "/usr/local/include", sel, NULL));
|
||||
SETPTR(filename, g_build_path(G_DIR_SEPARATOR_S, "/usr/local/include", sel, NULL));
|
||||
|
||||
if (! g_file_test(filename, G_FILE_TEST_EXISTS))
|
||||
setptr(filename, g_build_path(G_DIR_SEPARATOR_S, "/usr/include", sel, NULL));
|
||||
SETPTR(filename, g_build_path(G_DIR_SEPARATOR_S, "/usr/include", sel, NULL));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1644,7 +1644,7 @@ G_MODULE_EXPORT void on_menu_open_selected_file1_activate(GtkMenuItem *menuitem,
|
||||
document_open_file(filename, FALSE, NULL, NULL);
|
||||
else
|
||||
{
|
||||
setptr(sel, utils_get_utf8_from_locale(sel));
|
||||
SETPTR(sel, utils_get_utf8_from_locale(sel));
|
||||
ui_set_statusbar(TRUE, _("Could not open file %s (File not found)"), sel);
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,7 @@ void dialogs_show_open_file(void)
|
||||
if (! initdir)
|
||||
initdir = g_strdup(utils_get_default_dir_utf8());
|
||||
|
||||
setptr(initdir, utils_get_locale_from_utf8(initdir));
|
||||
SETPTR(initdir, utils_get_locale_from_utf8(initdir));
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
if (interface_prefs.use_native_windows_dialogs)
|
||||
|
@ -1136,7 +1136,7 @@ GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename
|
||||
g_return_val_if_fail(doc != NULL, NULL); /* really should not happen */
|
||||
|
||||
/* file exists on disk, set real_path */
|
||||
setptr(doc->real_path, tm_get_real_path(locale_filename));
|
||||
SETPTR(doc->real_path, tm_get_real_path(locale_filename));
|
||||
|
||||
doc->priv->is_remote = utils_is_remote_path(locale_filename);
|
||||
monitor_file_setup(doc);
|
||||
@ -1446,10 +1446,10 @@ gboolean document_save_file_as(GeanyDocument *doc, const gchar *utf8_fname)
|
||||
g_return_val_if_fail(doc != NULL, FALSE);
|
||||
|
||||
if (utf8_fname != NULL)
|
||||
setptr(doc->file_name, g_strdup(utf8_fname));
|
||||
SETPTR(doc->file_name, g_strdup(utf8_fname));
|
||||
|
||||
/* reset real path, it's retrieved again in document_save() */
|
||||
setptr(doc->real_path, NULL);
|
||||
SETPTR(doc->real_path, NULL);
|
||||
|
||||
/* detect filetype */
|
||||
if (doc->file_type->id == GEANY_FILETYPES_NONE)
|
||||
@ -1768,7 +1768,7 @@ gboolean document_save_file(GeanyDocument *doc, gboolean force)
|
||||
|
||||
if (!file_prefs.use_safe_file_saving)
|
||||
{
|
||||
setptr(errmsg,
|
||||
SETPTR(errmsg,
|
||||
g_strdup_printf(_("%s\n\nThe file on disk may now be truncated!"), errmsg));
|
||||
}
|
||||
dialogs_show_msgbox_with_secondary(GTK_MESSAGE_ERROR, _("Error saving file."), errmsg);
|
||||
@ -2872,7 +2872,7 @@ static gboolean monitor_resave_missing_file(GeanyDocument *doc)
|
||||
/* file is missing - set unsaved state */
|
||||
document_set_text_changed(doc, TRUE);
|
||||
/* don't prompt more than once */
|
||||
setptr(doc->real_path, NULL);
|
||||
SETPTR(doc->real_path, NULL);
|
||||
}
|
||||
|
||||
return want_reload;
|
||||
|
@ -271,7 +271,7 @@ void editor_snippets_init(void)
|
||||
|
||||
/* check for old autocomplete.conf files (backwards compatibility) */
|
||||
if (! g_file_test(userconfigfile, G_FILE_TEST_IS_REGULAR))
|
||||
setptr(userconfigfile,
|
||||
SETPTR(userconfigfile,
|
||||
g_strconcat(app->configdir, G_DIR_SEPARATOR_S, "autocomplete.conf", NULL));
|
||||
|
||||
/* load the actual config files */
|
||||
@ -2288,7 +2288,7 @@ static void fix_indentation(GeanyEditor *editor, GString *buf)
|
||||
gchar *str;
|
||||
|
||||
/* for tabs+spaces mode we want the real tab width, not indent width */
|
||||
setptr(whitespace, g_strnfill(sci_get_tab_width(editor->sci), ' '));
|
||||
SETPTR(whitespace, g_strnfill(sci_get_tab_width(editor->sci), ' '));
|
||||
str = g_strdup_printf("^\t*(%s)", whitespace);
|
||||
|
||||
regex = g_regex_new(str, cflags, 0, NULL);
|
||||
@ -2355,7 +2355,7 @@ void editor_insert_text_block(GeanyEditor *editor, const gchar *text, gint inser
|
||||
gchar *whitespace;
|
||||
|
||||
whitespace = g_strnfill(newline_indent_size, ' ');
|
||||
setptr(whitespace, g_strconcat(nl, whitespace, NULL));
|
||||
SETPTR(whitespace, g_strconcat(nl, whitespace, NULL));
|
||||
utils_string_replace_all(buf, nl, whitespace);
|
||||
g_free(whitespace);
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ static gchar *regex_match(GRegex *preg, const gchar *buffer, gsize size)
|
||||
encoding = g_match_info_fetch(minfo, 1);
|
||||
geany_debug("Detected encoding by regex search: %s", encoding);
|
||||
|
||||
setptr(encoding, g_utf8_strup(encoding, -1));
|
||||
SETPTR(encoding, g_utf8_strup(encoding, -1));
|
||||
}
|
||||
g_match_info_free(minfo);
|
||||
return encoding;
|
||||
@ -783,7 +783,7 @@ handle_forced_encoding(BufferData *buffer, const gchar *forced_enc)
|
||||
}
|
||||
else
|
||||
{
|
||||
setptr(buffer->data, converted_text);
|
||||
SETPTR(buffer->data, converted_text);
|
||||
buffer->len = strlen(converted_text);
|
||||
}
|
||||
}
|
||||
@ -821,13 +821,13 @@ handle_encoding(BufferData *buffer, GeanyEncodingIndex enc_idx)
|
||||
buffer->data, buffer->size, buffer->enc, FALSE);
|
||||
if (converted_text != NULL)
|
||||
{
|
||||
setptr(buffer->data, converted_text);
|
||||
SETPTR(buffer->data, converted_text);
|
||||
buffer->len = strlen(converted_text);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* there was a problem converting data from BOM encoding type */
|
||||
setptr(buffer->enc, NULL);
|
||||
SETPTR(buffer->enc, NULL);
|
||||
buffer->bom = FALSE;
|
||||
}
|
||||
}
|
||||
@ -855,7 +855,7 @@ handle_encoding(BufferData *buffer, GeanyEncodingIndex enc_idx)
|
||||
g_free(regex_charset);
|
||||
return FALSE;
|
||||
}
|
||||
setptr(buffer->data, converted_text);
|
||||
SETPTR(buffer->data, converted_text);
|
||||
buffer->len = strlen(converted_text);
|
||||
}
|
||||
g_free(regex_charset);
|
||||
|
@ -689,7 +689,7 @@ static void setup_config_file_menus(void)
|
||||
|
||||
f = utils_build_path(app->configdir, "filetype_extensions.conf", NULL);
|
||||
ui_add_config_file_menu_item(f, NULL, NULL);
|
||||
setptr(f, utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, "filetypes.common", NULL));
|
||||
SETPTR(f, utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, "filetypes.common", NULL));
|
||||
ui_add_config_file_menu_item(f, NULL, NULL);
|
||||
g_free(f);
|
||||
|
||||
@ -806,13 +806,13 @@ static GeanyFiletype *check_builtin_filenames(const gchar *utf8_filename)
|
||||
#else
|
||||
lfn = g_strdup(utf8_filename);
|
||||
#endif
|
||||
setptr(lfn, utils_get_locale_from_utf8(lfn));
|
||||
SETPTR(lfn, utils_get_locale_from_utf8(lfn));
|
||||
|
||||
path = utils_build_path(app->configdir, GEANY_FILEDEFS_SUBDIR, "filetypes.", NULL);
|
||||
if (g_str_has_prefix(lfn, path))
|
||||
found = TRUE;
|
||||
|
||||
setptr(path, utils_build_path(app->datadir, "filetypes.", NULL));
|
||||
SETPTR(path, utils_build_path(app->datadir, "filetypes.", NULL));
|
||||
if (g_str_has_prefix(lfn, path))
|
||||
found = TRUE;
|
||||
|
||||
@ -837,7 +837,7 @@ GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename)
|
||||
base_filename = g_path_get_basename(utf8_filename);
|
||||
#ifdef G_OS_WIN32
|
||||
/* use lower case basename */
|
||||
setptr(base_filename, g_utf8_strdown(base_filename, -1));
|
||||
SETPTR(base_filename, g_utf8_strdown(base_filename, -1));
|
||||
#endif
|
||||
|
||||
ft = filetypes_find(match_basename, base_filename);
|
||||
@ -1183,31 +1183,31 @@ static void load_settings(guint ft_id, GKeyFile *config, GKeyFile *configh)
|
||||
result = utils_get_setting(string, configh, config, "settings", "extension", NULL);
|
||||
if (result != NULL)
|
||||
{
|
||||
setptr(filetypes[ft_id]->extension, result);
|
||||
SETPTR(filetypes[ft_id]->extension, result);
|
||||
}
|
||||
|
||||
/* read comment notes */
|
||||
result = utils_get_setting(string, configh, config, "settings", "comment_open", NULL);
|
||||
if (result != NULL)
|
||||
{
|
||||
setptr(filetypes[ft_id]->comment_open, result);
|
||||
SETPTR(filetypes[ft_id]->comment_open, result);
|
||||
}
|
||||
|
||||
result = utils_get_setting(string, configh, config, "settings", "comment_close", NULL);
|
||||
if (result != NULL)
|
||||
{
|
||||
setptr(filetypes[ft_id]->comment_close, result);
|
||||
SETPTR(filetypes[ft_id]->comment_close, result);
|
||||
}
|
||||
|
||||
result = utils_get_setting(string, configh, config, "settings", "comment_single", NULL);
|
||||
if (result != NULL)
|
||||
{
|
||||
setptr(filetypes[ft_id]->comment_single, result);
|
||||
SETPTR(filetypes[ft_id]->comment_single, result);
|
||||
}
|
||||
/* import correctly filetypes that use old-style single comments */
|
||||
else if (! NZV(filetypes[ft_id]->comment_close))
|
||||
{
|
||||
setptr(filetypes[ft_id]->comment_single, filetypes[ft_id]->comment_open);
|
||||
SETPTR(filetypes[ft_id]->comment_single, filetypes[ft_id]->comment_open);
|
||||
filetypes[ft_id]->comment_open = NULL;
|
||||
}
|
||||
|
||||
@ -1218,7 +1218,7 @@ static void load_settings(guint ft_id, GKeyFile *config, GKeyFile *configh)
|
||||
result = utils_get_setting(string, configh, config, "settings", "context_action_cmd", NULL);
|
||||
if (result != NULL)
|
||||
{
|
||||
setptr(filetypes[ft_id]->context_action_cmd, result);
|
||||
SETPTR(filetypes[ft_id]->context_action_cmd, result);
|
||||
}
|
||||
|
||||
result = utils_get_setting(string, configh, config, "settings", "tag_parser", NULL);
|
||||
@ -1393,7 +1393,7 @@ void filetypes_load_config(guint ft_id, gboolean reload)
|
||||
f = filetypes_get_filename(ft, FALSE);
|
||||
load_system_keyfile(config, f, G_KEY_FILE_KEEP_COMMENTS, ft);
|
||||
|
||||
setptr(f, filetypes_get_filename(ft, TRUE));
|
||||
SETPTR(f, filetypes_get_filename(ft, TRUE));
|
||||
g_key_file_load_from_file(config_home, f, G_KEY_FILE_KEEP_COMMENTS, NULL);
|
||||
g_free(f);
|
||||
}
|
||||
@ -1621,7 +1621,7 @@ static void convert_filetype_extensions_to_lower_case(gchar **patterns, gsize le
|
||||
guint i;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
setptr(patterns[i], g_ascii_strdown(patterns[i], -1));
|
||||
SETPTR(patterns[i], g_ascii_strdown(patterns[i], -1));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1668,7 +1668,7 @@ static void read_group(GKeyFile *config, const gchar *group_name, gint group_id)
|
||||
if (ft->priv->custom &&
|
||||
(group_id == GEANY_FILETYPE_GROUP_COMPILED || group_id == GEANY_FILETYPE_GROUP_SCRIPT))
|
||||
{
|
||||
setptr(ft->title, NULL);
|
||||
SETPTR(ft->title, NULL);
|
||||
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||
}
|
||||
}
|
||||
|
@ -922,7 +922,7 @@ static void get_key_values(GKeyFile *config, const gchar *group, gchar **keys, g
|
||||
gchar *str = g_key_file_get_string(config, group, *keys, NULL);
|
||||
|
||||
if (str)
|
||||
setptr(*values, str);
|
||||
SETPTR(*values, str);
|
||||
|
||||
keys++;
|
||||
values++;
|
||||
@ -1179,12 +1179,12 @@ on_color_scheme_clicked(GtkMenuItem *menuitem, gpointer user_data)
|
||||
/* check if default item */
|
||||
if (!user_data)
|
||||
{
|
||||
setptr(editor_prefs.color_scheme, NULL);
|
||||
SETPTR(editor_prefs.color_scheme, NULL);
|
||||
filetypes_reload();
|
||||
return;
|
||||
}
|
||||
fname = g_strdup(g_object_get_data(G_OBJECT(menuitem), "colorscheme_file"));
|
||||
setptr(fname, utils_get_locale_from_utf8(fname));
|
||||
SETPTR(fname, utils_get_locale_from_utf8(fname));
|
||||
|
||||
/* fname is just the basename from the menu item, so prepend the custom files path */
|
||||
path = g_build_path(G_DIR_SEPARATOR_S, app->configdir, GEANY_COLORSCHEMES_SUBDIR, fname, NULL);
|
||||
@ -1196,13 +1196,13 @@ on_color_scheme_clicked(GtkMenuItem *menuitem, gpointer user_data)
|
||||
}
|
||||
if (g_file_test(path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
setptr(editor_prefs.color_scheme, fname);
|
||||
SETPTR(editor_prefs.color_scheme, fname);
|
||||
fname = NULL;
|
||||
filetypes_reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
setptr(fname, utils_get_utf8_from_locale(fname));
|
||||
SETPTR(fname, utils_get_utf8_from_locale(fname));
|
||||
ui_set_statusbar(TRUE, _("Could not find file '%s'."), fname);
|
||||
}
|
||||
g_free(path);
|
||||
@ -1236,7 +1236,7 @@ static void add_color_scheme_item(GtkWidget *menu, const gchar *fname)
|
||||
|
||||
path = utils_build_path(app->configdir, GEANY_COLORSCHEMES_SUBDIR, fname, NULL);
|
||||
hkeyfile = utils_key_file_new(path);
|
||||
setptr(path, utils_build_path(app->datadir, GEANY_COLORSCHEMES_SUBDIR, fname, NULL));
|
||||
SETPTR(path, utils_build_path(app->datadir, GEANY_COLORSCHEMES_SUBDIR, fname, NULL));
|
||||
skeyfile = utils_key_file_new(path);
|
||||
|
||||
theme_name = utils_get_setting(locale_string, hkeyfile, skeyfile, "theme_info", "name", theme_fn);
|
||||
|
@ -156,8 +156,8 @@ GeanyKeyBinding *keybindings_set_item(GeanyKeyGroup *group, gsize key_id,
|
||||
if (group->plugin)
|
||||
{
|
||||
/* some plugins e.g. GeanyLua need these fields duplicated */
|
||||
setptr(kb->name, g_strdup(kf_name));
|
||||
setptr(kb->label, g_strdup(label));
|
||||
SETPTR(kb->name, g_strdup(kf_name));
|
||||
SETPTR(kb->label, g_strdup(label));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -998,7 +998,7 @@ gboolean configuration_load(void)
|
||||
{ /* config file does not (yet) exist, so try to load a global config file which may be */
|
||||
/* created by distributors */
|
||||
geany_debug("No user config file found, trying to use global configuration.");
|
||||
setptr(configfile, utils_build_path(app->datadir, "geany.conf", NULL));
|
||||
SETPTR(configfile, utils_build_path(app->datadir, "geany.conf", NULL));
|
||||
}
|
||||
g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
|
||||
g_free(configfile);
|
||||
|
@ -721,7 +721,7 @@ static gint setup_config_dir(void)
|
||||
gint mkdir_result = 0;
|
||||
|
||||
/* convert configdir to locale encoding to avoid troubles */
|
||||
setptr(app->configdir, utils_get_locale_from_utf8(app->configdir));
|
||||
SETPTR(app->configdir, utils_get_locale_from_utf8(app->configdir));
|
||||
|
||||
mkdir_result = create_config_dir();
|
||||
if (mkdir_result != 0)
|
||||
@ -736,7 +736,7 @@ static gint setup_config_dir(void)
|
||||
}
|
||||
/* make configdir a real path */
|
||||
if (g_file_test(app->configdir, G_FILE_TEST_EXISTS))
|
||||
setptr(app->configdir, tm_get_real_path(app->configdir));
|
||||
SETPTR(app->configdir, tm_get_real_path(app->configdir));
|
||||
|
||||
return mkdir_result;
|
||||
}
|
||||
@ -816,7 +816,7 @@ static gboolean open_cl_files(gint argc, gchar **argv)
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
/* It seems argv elements are encoded in CP1252 on a German Windows */
|
||||
setptr(filename, g_locale_to_utf8(filename, -1, NULL, NULL, NULL));
|
||||
SETPTR(filename, g_locale_to_utf8(filename, -1, NULL, NULL, NULL));
|
||||
#endif
|
||||
if (filename && ! main_handle_filename(filename))
|
||||
{
|
||||
|
@ -641,9 +641,9 @@ static gboolean goto_compiler_file_line(const gchar *filename, gint line, gboole
|
||||
if (cur_dir)
|
||||
{
|
||||
/* we let the user know we couldn't find the parsed filename from the message window */
|
||||
setptr(cur_dir, utils_get_locale_from_utf8(cur_dir));
|
||||
SETPTR(cur_dir, utils_get_locale_from_utf8(cur_dir));
|
||||
name = g_path_get_basename(filename);
|
||||
setptr(name, g_build_path(G_DIR_SEPARATOR_S, cur_dir, name, NULL));
|
||||
SETPTR(name, g_build_path(G_DIR_SEPARATOR_S, cur_dir, name, NULL));
|
||||
g_free(cur_dir);
|
||||
|
||||
if (g_file_test(name, G_FILE_TEST_EXISTS))
|
||||
@ -744,7 +744,7 @@ static void make_absolute(gchar **filename, const gchar *dir)
|
||||
|
||||
/* add directory */
|
||||
if (! utils_is_absolute_path(*filename))
|
||||
setptr(*filename, g_strconcat(dir, G_DIR_SEPARATOR_S,
|
||||
SETPTR(*filename, g_strconcat(dir, G_DIR_SEPARATOR_S,
|
||||
*filename + skip_dot_slash, NULL));
|
||||
}
|
||||
|
||||
@ -1049,7 +1049,7 @@ static void msgwin_parse_generic_line(const gchar *string, gchar **filename, gin
|
||||
/* if we aren't sure we got a supposedly correct filename, check it */
|
||||
if (incertain && ! g_file_test(*filename, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
setptr(*filename, NULL);
|
||||
SETPTR(*filename, NULL);
|
||||
*line = -1;
|
||||
}
|
||||
}
|
||||
|
@ -238,8 +238,8 @@ static void update_filename_label(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
setptr(basename, g_markup_printf_escaped ("\n%s", basename));
|
||||
setptr(msg, g_strconcat(msg, basename, NULL));
|
||||
SETPTR(basename, g_markup_printf_escaped ("\n%s", basename));
|
||||
SETPTR(msg, g_strconcat(msg, basename, NULL));
|
||||
}
|
||||
g_free(basename);
|
||||
}
|
||||
|
@ -991,7 +991,7 @@ on_prefs_dialog_response(GtkDialog *dialog, gint response, gpointer user_data)
|
||||
|
||||
/* Editor settings */
|
||||
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "entry_toggle_mark");
|
||||
setptr(editor_prefs.comment_toggle_mark,
|
||||
SETPTR(editor_prefs.comment_toggle_mark,
|
||||
gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1));
|
||||
|
||||
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_long_line");
|
||||
@ -1262,7 +1262,7 @@ static void on_color_button_choose_cb(GtkColorButton *widget, gpointer user_data
|
||||
GdkColor color;
|
||||
|
||||
gtk_color_button_get_color(widget, &color);
|
||||
setptr(editor_prefs.long_line_color, utils_get_hex_from_color(&color));
|
||||
SETPTR(editor_prefs.long_line_color, utils_get_hex_from_color(&color));
|
||||
}
|
||||
|
||||
|
||||
@ -1278,7 +1278,7 @@ static void on_prefs_font_choosed(GtkFontButton *widget, gpointer user_data)
|
||||
if (strcmp(fontbtn, interface_prefs.tagbar_font) == 0)
|
||||
break;
|
||||
|
||||
setptr(interface_prefs.tagbar_font, g_strdup(fontbtn));
|
||||
SETPTR(interface_prefs.tagbar_font, g_strdup(fontbtn));
|
||||
for (i = 0; i < documents_array->len; i++)
|
||||
{
|
||||
GeanyDocument *doc = documents[i];
|
||||
@ -1296,7 +1296,7 @@ static void on_prefs_font_choosed(GtkFontButton *widget, gpointer user_data)
|
||||
{
|
||||
if (strcmp(fontbtn, interface_prefs.msgwin_font) == 0)
|
||||
break;
|
||||
setptr(interface_prefs.msgwin_font, g_strdup(fontbtn));
|
||||
SETPTR(interface_prefs.msgwin_font, g_strdup(fontbtn));
|
||||
ui_widget_modify_font_from_string(msgwindow.tree_compiler, interface_prefs.msgwin_font);
|
||||
ui_widget_modify_font_from_string(msgwindow.tree_msg, interface_prefs.msgwin_font);
|
||||
ui_widget_modify_font_from_string(msgwindow.tree_status, interface_prefs.msgwin_font);
|
||||
|
@ -333,9 +333,9 @@ static void remove_foreach_project_filetype(gpointer data, gpointer user_data)
|
||||
GeanyFiletype *ft = data;
|
||||
if (ft != NULL)
|
||||
{
|
||||
setptr(ft->projfilecmds, NULL);
|
||||
setptr(ft->projexeccmds, NULL);
|
||||
setptr(ft->projerror_regex_string, NULL);
|
||||
SETPTR(ft->projfilecmds, NULL);
|
||||
SETPTR(ft->projexeccmds, NULL);
|
||||
SETPTR(ft->projerror_regex_string, NULL);
|
||||
ft->project_list_entry = -1;
|
||||
}
|
||||
}
|
||||
@ -674,7 +674,7 @@ static gboolean update_config(const PropertyDialogElements *e, gboolean new_proj
|
||||
if (! g_path_is_absolute(locale_path))
|
||||
{ /* relative base path, so add base dir of project file name */
|
||||
gchar *dir = g_path_get_dirname(locale_filename);
|
||||
setptr(locale_path, g_strconcat(dir, G_DIR_SEPARATOR_S, locale_path, NULL));
|
||||
SETPTR(locale_path, g_strconcat(dir, G_DIR_SEPARATOR_S, locale_path, NULL));
|
||||
g_free(dir);
|
||||
}
|
||||
|
||||
@ -720,10 +720,10 @@ static gboolean update_config(const PropertyDialogElements *e, gboolean new_proj
|
||||
}
|
||||
p = app->project;
|
||||
|
||||
setptr(p->name, g_strdup(name));
|
||||
setptr(p->file_name, g_strdup(file_name));
|
||||
SETPTR(p->name, g_strdup(name));
|
||||
SETPTR(p->file_name, g_strdup(file_name));
|
||||
/* use "." if base_path is empty */
|
||||
setptr(p->base_path, g_strdup(NZV(base_path) ? base_path : "./"));
|
||||
SETPTR(p->base_path, g_strdup(NZV(base_path) ? base_path : "./"));
|
||||
|
||||
if (! new_project) /* save properties specific fields */
|
||||
{
|
||||
@ -741,7 +741,7 @@ static gboolean update_config(const PropertyDialogElements *e, gboolean new_proj
|
||||
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(e->description));
|
||||
gtk_text_buffer_get_start_iter(buffer, &start);
|
||||
gtk_text_buffer_get_end_iter(buffer, &end);
|
||||
setptr(p->description, g_strdup(gtk_text_buffer_get_text(buffer, &start, &end, FALSE)));
|
||||
SETPTR(p->description, g_strdup(gtk_text_buffer_get_text(buffer, &start, &end, FALSE)));
|
||||
|
||||
foreach_slist(node, stash_groups)
|
||||
stash_group_update(node->data, e->dialog);
|
||||
@ -1166,7 +1166,7 @@ void project_apply_prefs(void)
|
||||
const gchar *str;
|
||||
|
||||
str = gtk_entry_get_text(GTK_ENTRY(path_entry));
|
||||
setptr(local_prefs.project_file_path, g_strdup(str));
|
||||
SETPTR(local_prefs.project_file_path, g_strdup(str));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1877,7 +1877,7 @@ static gint find_regex(ScintillaObject *sci, guint pos, GRegex *regex)
|
||||
g_return_val_if_fail(pos <= (guint)sci_get_length(sci), FALSE);
|
||||
|
||||
/* clear old match */
|
||||
setptr(regex_match_text, NULL);
|
||||
SETPTR(regex_match_text, NULL);
|
||||
|
||||
/* Warning: any SCI calls will invalidate 'text' after calling SCI_GETCHARACTERPOINTER */
|
||||
text = (void*)scintilla_send_message(sci, SCI_GETCHARACTERPOINTER, 0, 0);
|
||||
|
@ -415,7 +415,7 @@ static gint socket_fd_open_unix(const gchar *path)
|
||||
{ /* if real_path is not writable for us, fall back to ~/.config/geany/geany_socket_*_* */
|
||||
/* instead of creating a symlink and print a warning */
|
||||
g_warning("Socket %s could not be written, using %s as fallback.", real_path, path);
|
||||
setptr(real_path, g_strdup(path));
|
||||
SETPTR(real_path, g_strdup(path));
|
||||
}
|
||||
/* create a symlink in e.g. ~/.config/geany/geany_socket_hostname__0 to /tmp/geany_socket.499602d2 */
|
||||
else if (symlink(real_path, path) != 0)
|
||||
|
@ -1068,12 +1068,12 @@ static gchar *get_symbol_tooltip(GeanyDocument *doc, const TMTag *tag)
|
||||
! utils_str_equal(doc->encoding, "UTF-8") &&
|
||||
! utils_str_equal(doc->encoding, "None"))
|
||||
{
|
||||
setptr(utf8_name,
|
||||
SETPTR(utf8_name,
|
||||
encodings_convert_to_utf8_from_charset(utf8_name, -1, doc->encoding, TRUE));
|
||||
}
|
||||
|
||||
if (utf8_name != NULL)
|
||||
setptr(utf8_name, g_markup_escape_text(utf8_name, -1));
|
||||
SETPTR(utf8_name, g_markup_escape_text(utf8_name, -1));
|
||||
|
||||
return utf8_name;
|
||||
}
|
||||
@ -1740,7 +1740,7 @@ static GHashTable *init_user_tags(void)
|
||||
}
|
||||
file_list = utils_get_file_list_full(dir, TRUE, TRUE, NULL);
|
||||
|
||||
setptr(dir, utils_build_path(app->datadir, "tags", NULL));
|
||||
SETPTR(dir, utils_build_path(app->datadir, "tags", NULL));
|
||||
list = utils_get_file_list_full(dir, TRUE, TRUE, NULL);
|
||||
g_free(dir);
|
||||
|
||||
|
@ -94,7 +94,7 @@ static void read_template(const gchar *name, gint id)
|
||||
|
||||
/* try system if user template doesn't exist */
|
||||
if (!g_file_test(fname, G_FILE_TEST_EXISTS))
|
||||
setptr(fname, g_build_path(G_DIR_SEPARATOR_S, app->datadir,
|
||||
SETPTR(fname, g_build_path(G_DIR_SEPARATOR_S, app->datadir,
|
||||
GEANY_TEMPLATES_SUBDIR, name, NULL));
|
||||
|
||||
templates[id] = read_file(fname);
|
||||
@ -199,7 +199,7 @@ on_new_with_file_template(GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_dat
|
||||
gchar *path;
|
||||
|
||||
ft = filetypes_detect_from_extension(fname);
|
||||
setptr(fname, utils_get_locale_from_utf8(fname));
|
||||
SETPTR(fname, utils_get_locale_from_utf8(fname));
|
||||
|
||||
/* fname is just the basename from the menu item, so prepend the custom files path */
|
||||
path = g_build_path(G_DIR_SEPARATOR_S, app->configdir, GEANY_TEMPLATES_SUBDIR,
|
||||
@ -220,7 +220,7 @@ on_new_with_file_template(GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_dat
|
||||
}
|
||||
else
|
||||
{
|
||||
setptr(fname, utils_get_utf8_from_locale(fname));
|
||||
SETPTR(fname, utils_get_utf8_from_locale(fname));
|
||||
ui_set_statusbar(TRUE, _("Could not find file '%s'."), fname);
|
||||
}
|
||||
g_free(template);
|
||||
@ -391,7 +391,7 @@ static void make_comment_block(GString *comment_text, gint filetype_idx, guint i
|
||||
if (NZV(frame_start) && frame_start[1] == '*')
|
||||
{
|
||||
/* prefix the string with a space */
|
||||
setptr(frame_end, g_strconcat(" ", frame_end, NULL));
|
||||
SETPTR(frame_end, g_strconcat(" ", frame_end, NULL));
|
||||
line_prefix = " *";
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ static GtkWidget *toolbar_reload(const gchar *markup)
|
||||
g_error_free(error);
|
||||
error = NULL;
|
||||
|
||||
setptr(filename, utils_build_path(app->datadir, "ui_toolbar.xml", NULL));
|
||||
SETPTR(filename, utils_build_path(app->datadir, "ui_toolbar.xml", NULL));
|
||||
merge_id = gtk_ui_manager_add_ui_from_file(uim, filename, &error);
|
||||
}
|
||||
g_free(filename);
|
||||
|
@ -960,7 +960,7 @@ static gboolean have_tango_icon_theme(void)
|
||||
gchar *theme_name;
|
||||
|
||||
g_object_get(G_OBJECT(gtk_settings_get_default()), "gtk-icon-theme-name", &theme_name, NULL);
|
||||
setptr(theme_name, g_utf8_strdown(theme_name, -1));
|
||||
SETPTR(theme_name, g_utf8_strdown(theme_name, -1));
|
||||
|
||||
result = (strstr(theme_name, "tango") != NULL);
|
||||
checked = TRUE;
|
||||
|
@ -92,7 +92,7 @@ void utils_open_browser(const gchar *uri)
|
||||
if (new_cmd == NULL) /* user canceled */
|
||||
again = FALSE;
|
||||
else
|
||||
setptr(tool_prefs.browser_cmd, new_cmd);
|
||||
SETPTR(tool_prefs.browser_cmd, new_cmd);
|
||||
}
|
||||
g_free(cmdline);
|
||||
}
|
||||
@ -454,7 +454,7 @@ static gchar *utf8_strdown(const gchar *str)
|
||||
{
|
||||
down = g_locale_to_utf8(str, -1, NULL, NULL, NULL);
|
||||
if (down)
|
||||
setptr(down, g_utf8_strdown(down, -1));
|
||||
SETPTR(down, g_utf8_strdown(down, -1));
|
||||
}
|
||||
|
||||
return down;
|
||||
@ -2000,7 +2000,7 @@ GSList *utils_get_config_files(const gchar *subdir)
|
||||
{
|
||||
utils_mkdir(path, FALSE);
|
||||
}
|
||||
setptr(path, g_build_path(G_DIR_SEPARATOR_S, app->datadir, subdir, NULL));
|
||||
SETPTR(path, g_build_path(G_DIR_SEPARATOR_S, app->datadir, subdir, NULL));
|
||||
syslist = utils_get_file_list_full(path, FALSE, FALSE, NULL);
|
||||
/* merge lists */
|
||||
list = g_slist_concat(list, syslist);
|
||||
@ -2044,7 +2044,7 @@ gchar *utils_get_help_url(const gchar *suffix)
|
||||
|
||||
if (suffix != NULL)
|
||||
{
|
||||
setptr(uri, g_strconcat(uri, suffix, NULL));
|
||||
SETPTR(uri, g_strconcat(uri, suffix, NULL));
|
||||
}
|
||||
|
||||
return uri;
|
||||
|
@ -712,7 +712,7 @@ G_MODULE_EXPORT void on_term_font_set(GtkFontButton *widget, gpointer user_data)
|
||||
|
||||
if (! utils_str_equal(fontbtn, vc->font))
|
||||
{
|
||||
setptr(vc->font, g_strdup(gtk_font_button_get_font_name(widget)));
|
||||
SETPTR(vc->font, g_strdup(gtk_font_button_get_font_name(widget)));
|
||||
vte_apply_user_settings();
|
||||
}
|
||||
}
|
||||
@ -803,7 +803,7 @@ void vte_send_selection_to_vte(void)
|
||||
this is disabled by default as it could cause all sorts of damage. */
|
||||
if (text[len-1] != '\n' && text[len-1] != '\r')
|
||||
{
|
||||
setptr(text, g_strconcat(text, "\n", NULL));
|
||||
SETPTR(text, g_strconcat(text, "\n", NULL));
|
||||
len++;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user