Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geanyprj/workingdir #486

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion geanyprj/src/geanyprj.c
Expand Up @@ -74,7 +74,7 @@ static void reload_project(void)
{
if (g_current_project)
xproject_close(TRUE);
set_non_ft_build_wdir((gchar*)"");
set_non_ft_build_wdir("");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion geanyprj/src/geanyprj.h
Expand Up @@ -125,7 +125,7 @@ gchar *get_relative_path(const gchar *location, const gchar *path);
gint config_length(GKeyFile *config, const gchar *section, const gchar *name);
void save_config(GKeyFile *config, const gchar *path);
GSList *get_file_list(const gchar *path, guint *length, gboolean(*func)(const gchar *), GError **error);
void set_non_ft_build_wdir(gchar* wdir);
void set_non_ft_build_wdir(const gchar* wdir);


extern struct GeanyPrj *g_current_project;
Expand Down
2 changes: 1 addition & 1 deletion geanyprj/src/menu.c
Expand Up @@ -284,7 +284,7 @@ void on_preferences(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer
geany_project_set_name(g_current_project, gtk_entry_get_text(GTK_ENTRY(e->name)));
geany_project_set_description(g_current_project, "");
geany_project_set_run_cmd(g_current_project, "");
geany_project_set_working_dir(g_current_project, gtk_entry_get_text(GTK_ENTRY(e->working_dir)));
geany_project_set_working_dir(g_current_project, gtk_entry_get_text(GTK_ENTRY(e->working_dir)));
geany_project_set_type_int(g_current_project,
gtk_combo_box_get_active(GTK_COMBO_BOX(e->type)));
geany_project_set_regenerate(g_current_project,
Expand Down
5 changes: 3 additions & 2 deletions geanyprj/src/utils.c
Expand Up @@ -276,12 +276,13 @@ GSList *get_file_list(const gchar *path, guint * length, gboolean(*func)(const g
}

/* update Geany's non-filetype working directories in the build menu to wdir */
void set_non_ft_build_wdir(gchar* wdir) {
void set_non_ft_build_wdir(const gchar* wdir) {
gint i;
for(i = 0; i < build_get_group_count(GEANY_GBG_NON_FT); ++i)
for(i = 0; i < build_get_group_count(GEANY_GBG_NON_FT); ++i) {
build_set_menu_item(GEANY_BCS_PREF, /* medium priority */
GEANY_GBG_NON_FT, /* non-filetype build entries */
i,
GEANY_BC_WORKING_DIR, /* working dir field */
wdir);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

braces around the for would be nice for readability IMO as the body spans multiple lines (even though it's a single statement so doesn't change meaning)

}
}