Commit 6457294c authored by Ross Golder's avatar Ross Golder Committed by Ross Golder

Fix warning about ignoring return values. Fix various compiler warnings.

2006-02-02  Ross Golder  <ross@golder.org>

	* bookmark.c, history.c, message.c: Fix warning about ignoring
	return values.
	* page.c, parse, prefs.c: Fix various compiler warnings.
	* utils.c: Fixed mismatched/mistyped function declaration.
parent 682940dc
2006-02-02 Ross Golder <ross@golder.org>
* bookmark.c, history.c, message.c: Fix warning about ignoring
return values.
* page.c, parse, prefs.c: Fix various compiler warnings.
* utils.c: Fixed mismatched/mistyped function declaration.
2006-01-16 Adam Weinberger <adamw@gnome.org>
* prefs.c: Spelling and grammar fixes.
......
......@@ -373,7 +373,7 @@ gboolean gtranslator_bookmark_remove(GtrBookmark *bookmark)
GList *removeme=zuper;
GTR_ITER(zuper);
g_list_remove_link(gtranslator_bookmarks, removeme);
gtranslator_bookmarks = g_list_remove_link(gtranslator_bookmarks, removeme);
gtranslator_bookmark_free(GTR_BOOKMARK(removeme->data));
g_list_free_1(removeme);
......
......@@ -322,7 +322,7 @@ void remove_duplicate_entries(GList *list, GtrHistoryEntry *entry)
GList *r=rest;
GTR_ITER(rest);
g_list_remove_link(list, r);
list = g_list_remove_link(list, r);
gtranslator_history_entry_free(GTR_HISTORY_ENTRY(r->data));
g_list_free_1(r);
......
......@@ -155,13 +155,13 @@ void gtranslator_message_show(GtrMsg *msg)
while(g_list_length(text_vbox->children) > 0) {
GtkBoxChild *boxchild = text_vbox->children->data;
gtk_widget_destroy(boxchild->widget);
g_list_remove(text_vbox->children, boxchild);
text_vbox->children = g_list_remove(text_vbox->children, boxchild);
}
trans_vbox = GTK_BOX(current_page->trans_vbox);
while(g_list_length(trans_vbox->children) > 0) {
GtkBoxChild *boxchild = trans_vbox->children->data;
gtk_widget_destroy(boxchild->widget);
g_list_remove(trans_vbox->children, boxchild);
trans_vbox->children = g_list_remove(trans_vbox->children, boxchild);
}
/*
......
......@@ -118,7 +118,7 @@ GtrPage *gtranslator_page_new(GtrPo *po)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
page->text_vbox = gtk_vbox_new(TRUE, 1);
gtk_box_set_homogeneous(page->text_vbox, TRUE);
gtk_box_set_homogeneous(GTK_BOX(page->text_vbox), TRUE);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(original_text_scrolled_window), page->text_vbox);
/* Translation box is a vbox, containing one textview in most cases,
......@@ -129,7 +129,7 @@ GtrPage *gtranslator_page_new(GtrPo *po)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
page->trans_vbox = gtk_vbox_new(TRUE, 1);
gtk_box_set_homogeneous(page->trans_vbox, TRUE);
gtk_box_set_homogeneous(GTK_BOX(page->trans_vbox), TRUE);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(translation_text_scrolled_window), page->trans_vbox);
/*
......@@ -165,7 +165,7 @@ void gtranslator_page_hide_messages_table(GtrPage *page) {
}
gboolean gtranslator_page_autosave(GtrPage *page) {
char *folder, *filename;
char *filename;
gchar *autosave_filename;
GError *error = NULL;
......@@ -179,10 +179,12 @@ gboolean gtranslator_page_autosave(GtrPage *page) {
/*
* OK, save the file to an autosave file
*/
folder = (char *)dirname(page->po->filename);
filename = (char *)basename(page->po->filename);
filename = g_strdup(page->po->filename);
autosave_filename = g_strdup_printf("%s/.%s.autosave.%ld",
folder, filename, (long int)getpid());
dirname(filename),
basename(filename),
(long int)getpid());
g_free(filename);
gtranslator_save_file(page->po, autosave_filename, &error);
g_free(autosave_filename);
......
......@@ -189,11 +189,13 @@ struct po_error_handler gettext_error_handler = {
GtrPo *gtranslator_parse(const gchar *filename, GError **error)
{
GtrPo *po;
GtrMsg *msg;
gchar *base;
int i = 0;
po_message_iterator_t iter;
po_message_t message;
const char * const *domains;
const char *msgstr;
g_return_val_if_fail(filename!=NULL, NULL);
......@@ -246,19 +248,32 @@ GtrPo *gtranslator_parse(const gchar *filename, GError **error)
return NULL;
}
while(domains[i]) {
g_list_append(po->domains, g_strdup(domains[i]));
po->domains = g_list_append(po->domains, g_strdup(domains[i]));
i++;
}
/*
* Post-process these into a linked list of GtrMsgs.
* Determine whether first message is the header or not, and
* if so, process it seperately. Otherwise, treat as a normal
* message.
*/
po->messages = NULL;
iter = po_message_iterator(po->gettext_po_file, NULL);
message = po_next_message(iter);
msgstr = po_message_msgstr(message);
if(!strncmp(msgstr, "Project-Id-Version: ", 20)) {
/* TODO: parse into our header structure */
}
else {
/* Reset our pointer */
iter = po_message_iterator(po->gettext_po_file, NULL);
}
/*
* Post-process these into a linked list of GtrMsgs.
*/
while((message = po_next_message(iter)))
{
GtrMsg *msg;
/* Unpack into a GtrMsg */
msg = g_new0(GtrMsg, 1);
msg->message = message;
......@@ -344,7 +359,7 @@ gboolean gtranslator_open(const gchar *filename, GError **error)
* Create a page to add to our list of open files
*/
page = gtranslator_page_new(po);
g_list_append(pages, (gpointer)page);
pages = g_list_append(pages, (gpointer)page);
/*
* Make this our current page
......
......@@ -1288,6 +1288,7 @@ static void gtranslator_preferences_dialog_close(GtkWidget * widget, gint respon
static void gtranslator_preferences_dialog_changed(GtkWidget * widget, gpointer flag)
{
const gchar *locale;
gint c = 0;
G_CONST_RETURN gchar *current;
......@@ -1306,8 +1307,8 @@ static void gtranslator_preferences_dialog_changed(GtkWidget * widget, gpointer
set_text(mime_type, encoding);
set_text(encoding, bits);
set_text(lg_email, group_email);
gtranslator_preferences_plural_string_request(
gtk_entry_get_text(GTK_ENTRY(GTK_BIN(lcode)->child)));
locale = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(lcode)->child));
gtranslator_preferences_plural_string_request((char *)locale);
break;
}
c++;
......@@ -1321,8 +1322,8 @@ static void gtranslator_preferences_dialog_changed(GtkWidget * widget, gpointer
set_text(mime_type, encoding);
set_text(encoding, bits);
set_text(lg_email, group_email);
gtranslator_preferences_plural_string_request(
gtk_entry_get_text(GTK_ENTRY(GTK_BIN(lcode)->child)));
locale = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(lcode)->child));
gtranslator_preferences_plural_string_request((char *)locale);
break;
}
c++;
......
......@@ -161,6 +161,6 @@ int gtranslator_mkdir_hier (const char *path, mode_t mode);
GdkPixbuf *gtranslator_pixbuf_from_file(gchar *file);
gchar *gtranslator_config_plural_form_string(gchar *lang);
gchar *gtranslator_get_plural_form_string(gchar *lang);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment