Fix some gcc warnings with '-Wall -W -ansi' enabled.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/build-system@4030 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
2f207ca919
commit
e3b1c92aa8
16
ChangeLog
16
ChangeLog
@ -1,3 +1,9 @@
|
||||
2009-07-27 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
||||
* src/build.c, src/build.h, src/project.c:
|
||||
Fix some gcc warnings with '-Wall -W -ansi' enabled.
|
||||
|
||||
|
||||
2009-07-25 Lex Trotman <elextr(at)gmail(dot)com>
|
||||
|
||||
* src/build.c
|
||||
@ -48,11 +54,11 @@
|
||||
2009-07-17 Lex Trotman <elextr(at)gmail(dot)com>
|
||||
|
||||
* src/build.c
|
||||
Fixed substitute %f etc in commands
|
||||
Fixed substitute %f etc in commands
|
||||
Fixed potential leak in build_replace_placeholder
|
||||
Fixed leak in prepare_run_script (Thanks for patch Thomas)
|
||||
Fixed build_replace_placeholder to not require document.
|
||||
|
||||
|
||||
2009-07-17 Lex Trotman <elextr(at)gmail(dot)com>
|
||||
|
||||
* src/build.c, src/build.h, src/filetypes.h, src/filetypes.c
|
||||
@ -89,13 +95,13 @@
|
||||
|
||||
2009-07-11 Lex Trotman <elextr(at)gmail(dot)com>
|
||||
|
||||
* src/filetypes.h, src/filetypes.c, src/build.c, src/build.h,
|
||||
* src/filetypes.h, src/filetypes.c, src/build.c, src/build.h,
|
||||
src/project.c
|
||||
Removal of build menu item source made redundant by the following fix
|
||||
* src/build.c
|
||||
Corrected priority oreder and loading of filetype dependent build
|
||||
menu items saved in the project file. Added print routine for
|
||||
debugging command sources and priorities set compile symbol
|
||||
menu items saved in the project file. Added print routine for
|
||||
debugging command sources and priorities set compile symbol
|
||||
PRINTBUILDCMDS true to enable
|
||||
|
||||
2009-07-10 Lex Trotman <elextr(at)gmail(dot)com>
|
||||
|
||||
99
src/build.c
99
src/build.c
@ -113,7 +113,7 @@ static gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data);
|
||||
#endif
|
||||
static gboolean build_create_shellscript(const gchar *fname, const gchar *cmd, gboolean autoclose);
|
||||
static GPid build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *dir);
|
||||
static void set_stop_button(gboolean stop);
|
||||
/* static void set_stop_button(gboolean stop); */
|
||||
static void run_exit_cb(GPid child_pid, gint status, gpointer user_data);
|
||||
static void on_set_build_commands_activate(GtkWidget *w, gpointer u);
|
||||
static void on_build_next_error(GtkWidget *menuitem, gpointer user_data);
|
||||
@ -174,9 +174,9 @@ static const gchar* config_keys[] = {
|
||||
};
|
||||
|
||||
/*-----------------------------------------------------
|
||||
*
|
||||
*
|
||||
* Execute commands and handle results
|
||||
*
|
||||
*
|
||||
*-----------------------------------------------------*/
|
||||
|
||||
/* the various groups of commands not in the filetype struct */
|
||||
@ -362,7 +362,7 @@ GeanyBuildCommand *get_build_group(GeanyBuildSource src, GeanyBuildGroup grp)
|
||||
{
|
||||
GeanyDocument *doc;
|
||||
GeanyFiletype *ft;
|
||||
|
||||
|
||||
switch(grp)
|
||||
{
|
||||
case GBG_FT:
|
||||
@ -398,7 +398,7 @@ GeanyBuildCommand *get_build_group(GeanyBuildSource src, GeanyBuildGroup grp)
|
||||
case BCS_PREF: return exec_pref;
|
||||
case BCS_PROJ: return exec_proj;
|
||||
default: return NULL;
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -524,7 +524,7 @@ static gchar* build_replace_placeholder(const GeanyDocument* doc, const gchar* s
|
||||
utils_string_replace_all(stack, "%e", replacement);
|
||||
g_free(replacement);
|
||||
}
|
||||
|
||||
|
||||
/* replace %p with the current project's (absolute) base directory */
|
||||
replacement = NULL; /* prevent double free if no replacement found */
|
||||
if (app->project)
|
||||
@ -1031,7 +1031,7 @@ static void build_exit_cb(GPid child_pid, gint status, gpointer user_data)
|
||||
static void run_exit_cb(GPid child_pid, gint status, gpointer user_data)
|
||||
{
|
||||
RunInfo *run_info_data = (RunInfo*)user_data;
|
||||
|
||||
|
||||
g_spawn_close_pid(child_pid);
|
||||
|
||||
run_info_data->pid = 0;
|
||||
@ -1077,7 +1077,7 @@ static void build_command(GeanyDocument *doc, GeanyBuildGroup grp, gint cmd, gch
|
||||
gchar *full_command, *subs_command;
|
||||
GeanyBuildCommand *buildcmd = get_build_cmd(doc, grp, cmd, NULL);
|
||||
gchar* cmdstr;
|
||||
|
||||
|
||||
if (buildcmd==NULL)
|
||||
return;
|
||||
|
||||
@ -1108,9 +1108,9 @@ static void build_command(GeanyDocument *doc, GeanyBuildGroup grp, gint cmd, gch
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
*
|
||||
*
|
||||
* Create build menu and handle callbacks (&toolbar callbacks)
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
static void on_make_custom_input_response(const gchar *input)
|
||||
@ -1190,7 +1190,7 @@ static struct build_menu_item_spec {
|
||||
const gint build_grp, build_cmd;
|
||||
const gchar *fix_label;
|
||||
callback *cb;
|
||||
} build_menu_specs[] = {
|
||||
} build_menu_specs[] = {
|
||||
{ GTK_STOCK_CONVERT, GEANY_KEYS_BUILD_COMPILE, GBO_TO_GBG(GBO_COMPILE),
|
||||
GBO_TO_CMD(GBO_COMPILE), NULL, on_build_menu_item },
|
||||
{ GEANY_STOCK_BUILD, GEANY_KEYS_BUILD_LINK, GBO_TO_GBG(GBO_BUILD),
|
||||
@ -1227,7 +1227,7 @@ static struct build_menu_item_spec {
|
||||
0, NULL, NULL }
|
||||
};
|
||||
|
||||
static void create_build_menu_item(GtkWidget *menu, GeanyKeyGroup *group, GtkAccelGroup *ag,
|
||||
static void create_build_menu_item(GtkWidget *menu, GeanyKeyGroup *group, GtkAccelGroup *ag,
|
||||
struct build_menu_item_spec *bs, gchar *lbl, gint grp, gint cmd)
|
||||
{
|
||||
GtkWidget *item = gtk_image_menu_item_new_with_mnemonic(lbl);
|
||||
@ -1235,7 +1235,7 @@ static void create_build_menu_item(GtkWidget *menu, GeanyKeyGroup *group, GtkAcc
|
||||
{
|
||||
GtkWidget *image = gtk_image_new_from_stock(bs->stock_id, GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
|
||||
|
||||
|
||||
}
|
||||
gtk_widget_show(item);
|
||||
if (bs->key_binding>0)
|
||||
@ -1260,7 +1260,7 @@ static void create_build_menu(BuildMenuItems *build_menu_items)
|
||||
build_menu_items->menu_item[GBG_NON_FT] = g_new0(GtkWidget*, build_groups_count[GBG_NON_FT]);
|
||||
build_menu_items->menu_item[GBG_EXEC] = g_new0(GtkWidget*, build_groups_count[GBG_EXEC]);
|
||||
build_menu_items->menu_item[GBG_FIXED] = g_new0(GtkWidget*, GBF_COUNT);
|
||||
|
||||
|
||||
for (i=0; build_menu_specs[i].build_grp != MENU_DONE; ++i)
|
||||
{
|
||||
struct build_menu_item_spec *bs = &(build_menu_specs[i]);
|
||||
@ -1316,7 +1316,7 @@ void build_menu_update(GeanyDocument *doc)
|
||||
gboolean have_path, build_running, exec_running, have_errors, cmd_sensitivity;
|
||||
gboolean can_compile, can_make;
|
||||
GeanyBuildCommand *bc;
|
||||
|
||||
|
||||
if (menu_items.menu==NULL)
|
||||
create_build_menu(&menu_items);
|
||||
if (doc == NULL)
|
||||
@ -1369,7 +1369,7 @@ void build_menu_update(GeanyDocument *doc)
|
||||
|
||||
if (grp < GBG_EXEC)
|
||||
{
|
||||
cmd_sensitivity =
|
||||
cmd_sensitivity =
|
||||
(grp == GBG_FT && bc!=NULL && have_path && ! build_running) ||
|
||||
(grp == GBG_NON_FT && bc!=NULL && ! build_running);
|
||||
gtk_widget_set_sensitive(menu_item, cmd_sensitivity);
|
||||
@ -1411,23 +1411,23 @@ void build_menu_update(GeanyDocument *doc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
can_compile = get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_BUILD), NULL)!=NULL
|
||||
&& have_path && ! build_running;
|
||||
if (widgets.toolitem_build != NULL)
|
||||
gtk_widget_set_sensitive(widgets.toolitem_build, can_compile);
|
||||
can_make = FALSE;
|
||||
if (widgets.toolitem_make_all != NULL)
|
||||
gtk_widget_set_sensitive(widgets.toolitem_make_all,
|
||||
(can_make |= get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_MAKE_ALL), NULL)!=NULL
|
||||
gtk_widget_set_sensitive(widgets.toolitem_make_all,
|
||||
(can_make |= get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_MAKE_ALL), NULL)!=NULL
|
||||
&& ! build_running));
|
||||
if (widgets.toolitem_make_custom != NULL)
|
||||
gtk_widget_set_sensitive(widgets.toolitem_make_custom,
|
||||
(can_make |= get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_MAKE_CUSTOM), NULL)!=NULL
|
||||
gtk_widget_set_sensitive(widgets.toolitem_make_custom,
|
||||
(can_make |= get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_MAKE_CUSTOM), NULL)!=NULL
|
||||
&& ! build_running));
|
||||
if (widgets.toolitem_make_object != NULL)
|
||||
gtk_widget_set_sensitive(widgets.toolitem_make_object,
|
||||
(can_make |= get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_MAKE_OBJECT), NULL)!=NULL
|
||||
(can_make |= get_build_cmd(doc, GBG_FT, GBO_TO_CMD(GBO_MAKE_OBJECT), NULL)!=NULL
|
||||
&& ! build_running));
|
||||
if (widgets.toolitem_set_args != NULL)
|
||||
gtk_widget_set_sensitive(widgets.toolitem_set_args, TRUE);
|
||||
@ -1436,15 +1436,16 @@ void build_menu_update(GeanyDocument *doc)
|
||||
gtk_action_set_sensitive(widgets.build_action, can_make );
|
||||
/* gtk_action_set_sensitive(widgets.run_action, can_run || can_stop); */
|
||||
|
||||
/* show the stop command if a program is running, otherwise show run command
|
||||
/* show the stop command if a program is running, otherwise show run command
|
||||
set_stop_button(can_stop); */
|
||||
|
||||
}
|
||||
|
||||
/* Call build_menu_update() instead of calling this directly. */
|
||||
#if 0
|
||||
static void set_stop_button(gboolean stop)
|
||||
{
|
||||
/* const gchar *button_stock_id = NULL;
|
||||
const gchar *button_stock_id = NULL;
|
||||
GtkStockItem sitem;
|
||||
GtkToolButton *run_button;
|
||||
GtkWidget *menuitem = build_get_menu_items(run_info.file_type_id)->item_exec;
|
||||
@ -1459,7 +1460,7 @@ static void set_stop_button(gboolean stop)
|
||||
return;
|
||||
|
||||
/* use the run button also as stop button */
|
||||
/* if (stop)
|
||||
if (stop)
|
||||
{
|
||||
if (run_button != NULL)
|
||||
gtk_tool_button_set_stock_id(run_button, "gtk-stop");
|
||||
@ -1487,8 +1488,9 @@ static void set_stop_button(gboolean stop)
|
||||
gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))),
|
||||
sitem.label);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void on_set_build_commands_activate(GtkWidget *w, gpointer u)
|
||||
{
|
||||
@ -1594,9 +1596,9 @@ void build_toolbutton_build_clicked(GtkAction *action, gpointer unused)
|
||||
}
|
||||
|
||||
/*------------------------------------------------------
|
||||
*
|
||||
*
|
||||
* Create and handle the build menu configuration dialog
|
||||
*
|
||||
*
|
||||
*-------------------------------------------------------*/
|
||||
|
||||
typedef struct RowWidgets {
|
||||
@ -1665,7 +1667,7 @@ static RowWidgets *build_add_dialog_row(GeanyDocument *doc, GtkTable *table, gin
|
||||
enum GeanyBuildCmdEntries i;
|
||||
|
||||
gint column = 0;
|
||||
|
||||
|
||||
label = gtk_label_new(g_strdup_printf("%d:", cmd+1));
|
||||
gtk_table_attach(table, label, column, column+1, row, row+1, GTK_FILL, GTK_FILL | GTK_EXPAND,
|
||||
entry_x_padding, entry_y_padding);
|
||||
@ -1880,7 +1882,7 @@ static gboolean read_row(BuildDestination *dst, TableData table_data, gint drow,
|
||||
&&
|
||||
(
|
||||
strlen(entries[BC_LABEL])>0 /* but now one field has some */
|
||||
|| strlen(entries[BC_COMMAND])>0
|
||||
|| strlen(entries[BC_COMMAND])>0
|
||||
|| strlen(entries[BC_WORKING_DIR])>0
|
||||
)
|
||||
)
|
||||
@ -1946,7 +1948,7 @@ gboolean read_build_commands(BuildDestination *dst, TableData table_data, gint r
|
||||
{
|
||||
gint cmdindex, cmd;
|
||||
gboolean changed = FALSE;
|
||||
|
||||
|
||||
if (response == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
for (cmdindex=0, cmd=0; cmd<build_groups_count[GBG_FT]; ++cmdindex, ++cmd)
|
||||
@ -1979,11 +1981,11 @@ static void show_build_commands_dialog()
|
||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
|
||||
table = build_commands_table(doc, BCS_PREF, &table_data, ft);
|
||||
vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
|
||||
gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
|
||||
gtk_widget_show_all(dialog);
|
||||
/* run modally to prevent user changing idx filetype */
|
||||
response = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
|
||||
|
||||
prefdsts.dst[GBG_NON_FT] = &non_ft_pref;
|
||||
prefdsts.dst[GBG_EXEC] = &exec_pref;
|
||||
if (ft!=NULL)
|
||||
@ -1999,7 +2001,7 @@ static void show_build_commands_dialog()
|
||||
prefdsts.nonfileregexstr = ®ex_pref;
|
||||
read_build_commands(&prefdsts, table_data, response);
|
||||
free_build_fields(table_data);
|
||||
|
||||
|
||||
build_menu_update(doc);
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
@ -2025,9 +2027,9 @@ void set_build_non_ft_wd_to_proj(TableData table_data)
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
*
|
||||
*
|
||||
* Load and store configuration
|
||||
*
|
||||
*
|
||||
* ---------------------------------------------------------*/
|
||||
|
||||
static const gchar *build_grp_name = "build-menu";
|
||||
@ -2050,7 +2052,7 @@ static void load_build_menu_grp(GKeyFile *config, GeanyBuildCommand **dst, gint
|
||||
GeanyBuildCommand *dstcmd;
|
||||
gchar *key;
|
||||
static gchar cmdbuf[3]=" ";
|
||||
|
||||
|
||||
if (*dst==NULL)*dst = g_new0(GeanyBuildCommand, build_groups_count[grp]);
|
||||
dstcmd = *dst;
|
||||
prefixlen = prefix==NULL?0:strlen(prefix);
|
||||
@ -2083,7 +2085,7 @@ static void load_build_menu_grp(GKeyFile *config, GeanyBuildCommand **dst, gint
|
||||
g_free(key);
|
||||
}
|
||||
|
||||
/* for the specified source load new format build menu items or try to make some sense of
|
||||
/* for the specified source load new format build menu items or try to make some sense of
|
||||
* old format setings, not done perfectly but better than ignoring them */
|
||||
void load_build_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
{
|
||||
@ -2093,7 +2095,6 @@ void load_build_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
gchar **ftlist;
|
||||
gchar *value;
|
||||
gboolean bvalue;
|
||||
gint cmd;
|
||||
|
||||
if (g_key_file_has_group(config, build_grp_name))
|
||||
{
|
||||
@ -2153,9 +2154,9 @@ void load_build_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* load old [build_settings] values if there is no value defined by [build-menu] */
|
||||
|
||||
|
||||
/* set GeanyBuildCommand if it doesn't already exist and there is a command */
|
||||
#define ASSIGNIF(type, id, string, value) \
|
||||
if (value!=NULL && !type[GBO_TO_CMD(id)].exists && strlen(value)>0) { \
|
||||
@ -2166,7 +2167,7 @@ void load_build_menu(GKeyFile *config, GeanyBuildSource src, gpointer p)
|
||||
type[GBO_TO_CMD(id)].old = TRUE; \
|
||||
} else \
|
||||
g_free(value);
|
||||
|
||||
|
||||
switch(src)
|
||||
{
|
||||
case BCS_FT:
|
||||
@ -2219,7 +2220,7 @@ static gint save_build_menu_grp(GKeyFile *config, GeanyBuildCommand *src, gint g
|
||||
gchar *key;
|
||||
gint count=0;
|
||||
enum GeanyBuildCmdEntries i;
|
||||
|
||||
|
||||
if (src==NULL)return 0;
|
||||
prefixlen = prefix==NULL?0:strlen(prefix);
|
||||
key = g_strconcat(prefix==NULL?"":prefix, fixedkey, NULL);
|
||||
@ -2244,7 +2245,7 @@ static gint save_build_menu_grp(GKeyFile *config, GeanyBuildCommand *src, gint g
|
||||
else
|
||||
{
|
||||
FOREACH_GEANYBUILDCMD_ENTRY(i)
|
||||
{
|
||||
{
|
||||
set_key_fld(key, config_keys[i]);
|
||||
g_key_file_remove_key(config, build_grp_name, key, NULL);
|
||||
}
|
||||
@ -2267,7 +2268,7 @@ static void foreach_project_filetype(gpointer data, gpointer user_data)
|
||||
ForEachData *d = (ForEachData*)user_data;
|
||||
gint i=0;
|
||||
gchar *regkey = g_strdup_printf("%serror_regex", ft->name);
|
||||
|
||||
|
||||
i += save_build_menu_grp(d->config, ft->projfilecmds, GBG_FT, ft->name);
|
||||
if (ft->projerror_regex_string!=NULL && strlen(ft->projerror_regex_string)>0)
|
||||
{
|
||||
@ -2286,7 +2287,7 @@ void save_build_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
|
||||
GeanyProject *pj;
|
||||
ForEachData data;
|
||||
gchar *regkey;
|
||||
|
||||
|
||||
switch(src)
|
||||
{
|
||||
case BCS_HOME_FT:
|
||||
@ -2353,9 +2354,9 @@ static struct {
|
||||
gchar *entries[BC_CMDENTRIES_COUNT];
|
||||
GeanyBuildCommand **ptr;
|
||||
gint index;
|
||||
} default_cmds[] = {
|
||||
{ {N_("_Make"), "make", NULL}, &non_ft_def, GBO_TO_CMD(GBO_MAKE_ALL)},
|
||||
{ {N_("Make Custom _Target"), "make ", NULL}, &non_ft_def, GBO_TO_CMD(GBO_MAKE_CUSTOM)},
|
||||
} default_cmds[] = {
|
||||
{ {N_("_Make"), "make", NULL}, &non_ft_def, GBO_TO_CMD(GBO_MAKE_ALL)},
|
||||
{ {N_("Make Custom _Target"), "make ", NULL}, &non_ft_def, GBO_TO_CMD(GBO_MAKE_CUSTOM)},
|
||||
{ {N_("Make _Object"), "make %e.o", NULL }, &non_ft_def, GBO_TO_CMD(GBO_MAKE_OBJECT)},
|
||||
{ {N_("_Execute"), "./%e", NULL }, &exec_def, GBO_TO_CMD(GBO_EXEC)},
|
||||
{ {NULL, NULL, NULL}, NULL, 0 }
|
||||
|
||||
48
src/build.h
48
src/build.h
@ -143,7 +143,7 @@ GtkWidget *build_commands_table( GeanyDocument *doc, GeanyBuildSource dst, Table
|
||||
|
||||
gboolean read_build_commands( BuildDestination *dst, TableData data, gint response );
|
||||
|
||||
void free_build_data( TableData data );
|
||||
void free_build_fields( TableData data );
|
||||
|
||||
void set_build_non_ft_wd_to_proj(TableData table_data);
|
||||
|
||||
@ -153,18 +153,18 @@ gboolean build_parse_make_dir(const gchar *string, gchar **prefix);
|
||||
/* build menu functions */
|
||||
|
||||
/** Update the build menu to reflect changes in configuration or status.
|
||||
*
|
||||
*
|
||||
* Sets the labels and number of visible items to match the highest
|
||||
* priority configured commands. Also sets sensitivity if build commands are
|
||||
* running and switches executes to stop when commands are running.
|
||||
*
|
||||
*
|
||||
* @param doc The current document, if available, to save looking it up.
|
||||
* If @c NULL it will be looked up.
|
||||
*
|
||||
*
|
||||
* Call this after modifying any fields of a GeanyBuildCommand structure.
|
||||
*
|
||||
*
|
||||
* @see Build Menu Configuration section of the Manual.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
void build_menu_update(GeanyDocument *doc);
|
||||
@ -173,55 +173,55 @@ void build_menu_update(GeanyDocument *doc);
|
||||
void build_toolbutton_build_clicked(GtkAction *action, gpointer user_data);
|
||||
|
||||
/** Remove the specified Build menu item.
|
||||
*
|
||||
*
|
||||
* Makes the specified menu item configuration no longer exist. This
|
||||
* is different to setting fields to blank because the menu item
|
||||
* will be deleted from the configuration file on saving
|
||||
* (except the system filetypes settings @see Build Menu Configuration
|
||||
* section of the Manual).
|
||||
*
|
||||
* will be deleted from the configuration file on saving
|
||||
* (except the system filetypes settings @see Build Menu Configuration
|
||||
* section of the Manual).
|
||||
*
|
||||
* @param src the source of the menu item to remove.
|
||||
* @param grp the group of the command to remove.
|
||||
* @param cmd the index (from 0) of the command within the group. A negative
|
||||
* @param cmd the index (from 0) of the command within the group. A negative
|
||||
* value will remove the whole group.
|
||||
*
|
||||
*
|
||||
* If any parameter is out of range does nothing.
|
||||
*
|
||||
*
|
||||
* @see build_menu_update
|
||||
**/
|
||||
|
||||
void build_remove_menu_item(GeanyBuildSource src, GeanyBuildGroup grp, gint cmd);
|
||||
|
||||
/** Get the @a GeanyBuildCommand structure for the specified Build menu item.
|
||||
*
|
||||
* Get the command for any menu item specified by @a src, @a grp and @a cmd even if it is
|
||||
*
|
||||
* Get the command for any menu item specified by @a src, @a grp and @a cmd even if it is
|
||||
* hidden by higher priority commands.
|
||||
*
|
||||
*
|
||||
* @param src the source of the specified menu item.
|
||||
* @param grp the group of the specified menu item.
|
||||
* @param cmd the index of the command within the group.
|
||||
*
|
||||
*
|
||||
* @return a pointer to the @a GeanyBuildCommand structure or @a NULL if it doesn't exist.
|
||||
* This is a pointer to an internal structure and must not be freed.
|
||||
*
|
||||
*
|
||||
* @see build_menu_update
|
||||
**/
|
||||
|
||||
GeanyBuildCommand *build_get_menu_item(GeanyBuildSource src, GeanyBuildGroup grp, gint cmd);
|
||||
|
||||
/** Get the @a GeanyBuildCommand structure for the menu item.
|
||||
*
|
||||
* Get the current highest priority command specified by @a grp and @a cmd. This is the one
|
||||
*
|
||||
* Get the current highest priority command specified by @a grp and @a cmd. This is the one
|
||||
* that the menu item will use if activated.
|
||||
*
|
||||
*
|
||||
* @param grp the group of the specified menu item.
|
||||
* @param cmd the index of the command within the group.
|
||||
* @param src pointer to @a gint to return which source provided the command. Ignored if @a NULL.
|
||||
* Values are one of @a GeanyBuildSource but returns a signed type not the enum.
|
||||
*
|
||||
*
|
||||
* @return a pointer to the @a GeanyBuildCommand structure or @a NULL if it doesn't exist.
|
||||
* This is a pointer to an internal structure and must not be freed.
|
||||
*
|
||||
*
|
||||
* @see build_menu_update
|
||||
**/
|
||||
|
||||
|
||||
@ -338,8 +338,6 @@ static void remove_foreach_project_filetype( gpointer data, gpointer user_data )
|
||||
/* open_default will make function reload default session files on close */
|
||||
void project_close(gboolean open_default)
|
||||
{
|
||||
gint i;
|
||||
|
||||
g_return_if_fail(app->project != NULL);
|
||||
|
||||
ui_set_statusbar(TRUE, _("Project \"%s\" closed."), app->project->name);
|
||||
@ -353,14 +351,14 @@ void project_close(gboolean open_default)
|
||||
g_ptr_array_foreach( app->project->build_filetypes_list, remove_foreach_project_filetype, NULL );
|
||||
g_ptr_array_free(app->project->build_filetypes_list, FALSE);
|
||||
}
|
||||
|
||||
|
||||
/* remove project non filetype build menu items */
|
||||
build_remove_menu_item( BCS_PROJ, GBG_NON_FT, -1 );
|
||||
build_remove_menu_item( BCS_PROJ, GBG_EXEC, -1 );
|
||||
|
||||
|
||||
/* remove project regexen */
|
||||
setptr(regex_proj, NULL);
|
||||
|
||||
|
||||
g_free(app->project->name);
|
||||
g_free(app->project->description);
|
||||
g_free(app->project->file_name);
|
||||
@ -398,12 +396,10 @@ static void on_set_use_base_path_clicked( GtkWidget *unused1, gpointer user_data
|
||||
static void create_properties_dialog(PropertyDialogElements *e)
|
||||
{
|
||||
GtkWidget *table, *notebook, *build_table;
|
||||
GtkWidget *image;
|
||||
GtkWidget *button;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *swin;
|
||||
gpointer data;
|
||||
GeanyDocument *doc = document_get_current();
|
||||
GeanyFiletype *ft;
|
||||
|
||||
@ -480,7 +476,7 @@ static void create_properties_dialog(PropertyDialogElements *e)
|
||||
gtk_table_attach(GTK_TABLE(table), bbox, 1, 2, 3, 4,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
|
||||
|
||||
if (doc!=NULL) ft=doc->file_type;
|
||||
build_table = build_commands_table( doc, BCS_PROJ, &(e->build_properties), ft );
|
||||
label = gtk_label_new(_("Build"));
|
||||
@ -489,7 +485,7 @@ static void create_properties_dialog(PropertyDialogElements *e)
|
||||
|
||||
label = gtk_label_new(_("Set the non-filetype working directories on build tab to use base path:"));
|
||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
||||
|
||||
|
||||
button = gtk_button_new_with_label(_("Set"));
|
||||
ui_widget_set_tooltip_text(button,
|
||||
_("Set the working directories (on the Build tab) "
|
||||
@ -738,7 +734,7 @@ static gboolean update_config(const PropertyDialogElements *e)
|
||||
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)));
|
||||
|
||||
|
||||
/* read the project build menu */
|
||||
if ( doc!=NULL )ft=doc->file_type;
|
||||
if ( ft!=NULL )
|
||||
@ -760,7 +756,7 @@ static gboolean update_config(const PropertyDialogElements *e)
|
||||
if (ft!=NULL && ft->projfilecmds!=oldvalue && ft->project_list_entry<0)
|
||||
{
|
||||
if (p->build_filetypes_list==NULL)p->build_filetypes_list = g_ptr_array_new();
|
||||
ft->project_list_entry = p->build_filetypes_list->len;
|
||||
ft->project_list_entry = p->build_filetypes_list->len;
|
||||
g_ptr_array_add(p->build_filetypes_list, ft);
|
||||
}
|
||||
build_menu_update(doc);
|
||||
@ -1111,9 +1107,9 @@ gchar *project_get_base_path(void)
|
||||
* Maybe in future this will support a separate project make path from base path. */
|
||||
gchar *project_get_make_dir(void)
|
||||
{
|
||||
GeanyProject *project = app->project;
|
||||
/* GeanyProject *project = app->project;
|
||||
|
||||
/* if (project && ! project->make_in_base_path)
|
||||
if (project && ! project->make_in_base_path)
|
||||
return NULL;
|
||||
else*/
|
||||
return project_get_base_path();
|
||||
@ -1162,7 +1158,7 @@ void project_setup_prefs(void)
|
||||
static gboolean callback_setup = FALSE;
|
||||
|
||||
g_return_if_fail(local_prefs.project_file_path != NULL);
|
||||
|
||||
|
||||
gtk_entry_set_text(GTK_ENTRY(path_entry), local_prefs.project_file_path);
|
||||
if (! callback_setup)
|
||||
{ /* connect the callback only once */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user