Skip to content

Commit

Permalink
Merge pull request #37 from b4n/fixes/codenav
Browse files Browse the repository at this point in the history
A few fixes for the CodeNav plugin
Didn't do any detailed check - due to trust ;)
  • Loading branch information
frlan committed Jun 9, 2012
2 parents aa4b778 + 4c69a9c commit b56fcd1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
4 changes: 2 additions & 2 deletions codenav/src/codenavigation.c
Expand Up @@ -85,10 +85,10 @@ void plugin_init(GeanyData *data)
*/
GtkWidget *plugin_configure(GtkDialog *dialog)
{
log_func();

GtkWidget *vbox;

log_func();

vbox = gtk_vbox_new(FALSE, 6);

/* Switch header/implementation widget */
Expand Down
5 changes: 2 additions & 3 deletions codenav/src/codenavigation.h
Expand Up @@ -62,11 +62,10 @@ static void log_debug(const gchar* s, ...)
va_end(l);
}

#define log_func() g_print("[CODENAV FUNC] : %s", __func__) /* NB : this needs the C99 standard, but is only
used when debugging, so no problem :) */
#define log_func() g_print("[CODENAV FUNC] : %s", G_STRFUNC)
#else
static void log_debug(const gchar* s, ...) {}
static void log_func() {}
#define log_func() {}
#endif

/* IDs for keybindings */
Expand Down
13 changes: 8 additions & 5 deletions codenav/src/goto_file.c
Expand Up @@ -45,11 +45,13 @@ menu_item_activate(guint key_id);
* ---------------------------------------------------------------------
*/
void
goto_file_init()
goto_file_init(void)
{
GtkWidget* edit_menu;

log_func();

GtkWidget* edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");
edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");

/* Add the menu item, sensitive only when a document is opened */
menu_item = gtk_menu_item_new_with_mnemonic(_("Goto file"));
Expand All @@ -75,7 +77,7 @@ goto_file_init()
* ---------------------------------------------------------------------
*/
void
goto_file_cleanup()
goto_file_cleanup(void)
{
log_func();

Expand All @@ -89,11 +91,12 @@ goto_file_cleanup()
static void
menu_item_activate(guint key_id)
{
GtkWidget *dialog;

log_func();

/* TODO */

GtkWidget *dialog = gtk_message_dialog_new(
dialog = gtk_message_dialog_new(
GTK_WINDOW(geany->main_widgets->window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
Expand Down
4 changes: 2 additions & 2 deletions codenav/src/goto_file.h
Expand Up @@ -27,10 +27,10 @@

/* Initialization */
void
goto_file_init();
goto_file_init(void);

/* Cleanup */
void
goto_file_cleanup();
goto_file_cleanup(void);

#endif /* GOTO_FILE_H */
18 changes: 11 additions & 7 deletions codenav/src/switch_head_impl.c
Expand Up @@ -54,7 +54,7 @@ static GSList* languages = NULL; /* handled languages */
/********************** Functions for the feature *********************/

static void
fill_default_languages_list();
fill_default_languages_list(void);

static void
menu_item_activate(guint key_id);
Expand All @@ -73,11 +73,13 @@ on_configure_cell_edited(GtkCellRendererText* text, gchar* arg1, gchar* arg2, gp
* ---------------------------------------------------------------------
*/
void
switch_head_impl_init()
switch_head_impl_init(void)
{
GtkWidget* edit_menu;

log_func();

GtkWidget* edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");
edit_menu = ui_lookup_widget(geany->main_widgets->window, "edit1_menu");

/* Add the menu item and make it sensitive only when a document is opened */
menu_item = gtk_menu_item_new_with_mnemonic(_("Switch header/implementation"));
Expand Down Expand Up @@ -106,7 +108,7 @@ switch_head_impl_init()
* ---------------------------------------------------------------------
*/
void
switch_head_impl_cleanup()
switch_head_impl_cleanup(void)
{
GSList* iter = NULL;

Expand Down Expand Up @@ -134,7 +136,7 @@ switch_head_impl_cleanup()
* ---------------------------------------------------------------------
*/
static void
fill_default_languages_list()
fill_default_languages_list(void)
{
Language* lang = NULL;

Expand Down Expand Up @@ -356,9 +358,11 @@ menu_item_activate(guint key_id)

/* Third : if not found, ask the user if he wants to create it or not. */
{
GtkWidget* dialog;

p_str = g_strdup_printf("%s.%s", basename_no_extension, (const gchar*)(p_extensions_to_test->data));

GtkWidget* dialog = gtk_message_dialog_new( GTK_WINDOW(geany_data->main_widgets->window),
dialog = gtk_message_dialog_new( GTK_WINDOW(geany_data->main_widgets->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_OK_CANCEL,
Expand Down Expand Up @@ -441,7 +445,7 @@ add_language(GtkListStore* list_store, Language* lang)

/* ----- Finally, the configuration widget ----- */
GtkWidget*
switch_head_impl_config_widget()
switch_head_impl_config_widget(void)
{
GtkWidget *frame, *vbox, *tree_view;
GtkWidget *hbox_buttons, *add_button, *remove_button;
Expand Down
6 changes: 3 additions & 3 deletions codenav/src/switch_head_impl.h
Expand Up @@ -27,15 +27,15 @@

/* Initialization */
void
switch_head_impl_init();
switch_head_impl_init(void);

/* Cleanup */
void
switch_head_impl_cleanup();
switch_head_impl_cleanup(void);

/* Configuration widget */
GtkWidget*
switch_head_impl_config_widget();
switch_head_impl_config_widget(void);

/* Write the configuration of the feature */
void
Expand Down

0 comments on commit b56fcd1

Please sign in to comment.