Revision: 826 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=826&view=rev Author: frlan Date: 2009-07-17 15:55:17 +0000 (Fri, 17 Jul 2009)
Log Message: ----------- Try to parse Dir. Some bug some where
Modified Paths: -------------- trunk/geanylatex/src/geanylatex.c trunk/geanylatex/src/latexutils.c trunk/geanylatex/src/latexutils.h trunk/geanylatex/src/reftex.c trunk/geanylatex/src/reftex.h
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2009-07-17 15:54:15 UTC (rev 825) +++ trunk/geanylatex/src/geanylatex.c 2009-07-17 15:55:17 UTC (rev 826) @@ -448,7 +448,9 @@ GtkWidget *radio1 = NULL; GtkWidget *radio2 = NULL; GtkTreeModel *model = NULL; + GeanyDocument *doc = NULL;
+ doc = document_get_current();
dialog = gtk_dialog_new_with_buttons(_("Insert Reference"), GTK_WINDOW(geany->main_widgets->window), @@ -465,7 +467,7 @@
label_ref = gtk_label_new(_("Reference name:")); textbox_ref = gtk_combo_box_entry_new_text(); - glatex_add_Labels(textbox_ref, glatex_get_aux_file()); + glatex_add_Labels(textbox_ref, glatex_get_aux_dir(doc->real_path)); model = gtk_combo_box_get_model(GTK_COMBO_BOX(textbox_ref)); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 0, GTK_SORT_ASCENDING);
Modified: trunk/geanylatex/src/latexutils.c =================================================================== --- trunk/geanylatex/src/latexutils.c 2009-07-17 15:54:15 UTC (rev 825) +++ trunk/geanylatex/src/latexutils.c 2009-07-17 15:55:17 UTC (rev 826) @@ -23,11 +23,10 @@ #include "geanylatex.h"
-GDir *glatex_get_aux_files_from_dir(const gchar *dirname) +GDir *glatex_get_aux_dir(gchar *dirname) { GDir *dir; - dir = g_dir_open (dirname, 0, NULL); - return dir; + return g_dir_open (dirname, 0, NULL); }
gchar **geanylatex_read_file_in_array(const gchar *filename)
Modified: trunk/geanylatex/src/latexutils.h =================================================================== --- trunk/geanylatex/src/latexutils.h 2009-07-17 15:54:15 UTC (rev 825) +++ trunk/geanylatex/src/latexutils.h 2009-07-17 15:55:17 UTC (rev 826) @@ -23,7 +23,7 @@
#include "geanylatex.h"
-GDir *glatex_get_aux_files_from_dir(const gchar *dirname); +GDir *glatex_get_aux_dir(gchar *dir);
gchar **geanylatex_read_file_in_array(const gchar *filename);
Modified: trunk/geanylatex/src/reftex.c =================================================================== --- trunk/geanylatex/src/reftex.c 2009-07-17 15:54:15 UTC (rev 825) +++ trunk/geanylatex/src/reftex.c 2009-07-17 15:55:17 UTC (rev 826) @@ -23,22 +23,28 @@ #include "reftex.h" #include "latexutils.h"
-void glatex_add_Labels(GtkWidget *combobox, const gchar *file) +void glatex_add_Labels(GtkWidget *combobox, GDir *dir) { gchar **aux_entries = NULL; + const gchar *file = NULL; int i = 0; LaTeXLabel tmp; - if (file != NULL) + if (dir != NULL) { - aux_entries = geanylatex_read_file_in_array(file); - if (aux_entries != NULL) + file = g_dir_read_name(dir); + ui_set_statusbar(FALSE, file); + while (file != NULL) { - for (i = 0; aux_entries[i] != NULL ; i++) + aux_entries = geanylatex_read_file_in_array(file); + if (aux_entries != NULL) { - if (g_str_has_prefix(aux_entries[i], "\newlabel")) + for (i = 0; aux_entries[i] != NULL ; i++) { - tmp = glatex_parseLine(aux_entries[i]); - gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp.label_name); + if (g_str_has_prefix(aux_entries[i], "\newlabel")) + { + tmp = glatex_parseLine(aux_entries[i]); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp.label_name); + } } } }
Modified: trunk/geanylatex/src/reftex.h =================================================================== --- trunk/geanylatex/src/reftex.h 2009-07-17 15:54:15 UTC (rev 825) +++ trunk/geanylatex/src/reftex.h 2009-07-17 15:55:17 UTC (rev 826) @@ -31,7 +31,7 @@ gchar *chapter; } LaTeXLabel;
-void glatex_add_Labels(GtkWidget *combobox, const gchar *file); +void glatex_add_Labels(GtkWidget *combobox, GDir *dir);
LaTeXLabel glatex_parseLine(const gchar *line);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org