[almanah] Compiler warning fixes



commit 0d02c20d92e3f766c44047b55d39d9481b23543c
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Apr 19 23:45:10 2009 +0100

    Compiler warning fixes
---
 src/add-definition-dialog.c       |    6 ++-
 src/add-definition-dialog.h       |    4 +-
 src/definition-manager-window.c   |    9 ++++-
 src/definition.c                  |    1 -
 src/definition.h                  |    8 ++--
 src/definitions/contact.c         |    1 -
 src/definitions/file.c            |    3 +-
 src/definitions/note.c            |    3 +-
 src/definitions/uri.c             |    3 +-
 src/entry.c                       |    1 -
 src/event-factories/calendar.c    |    3 +-
 src/event-factories/f-spot.c      |    1 -
 src/event-factory.c               |    3 +-
 src/event-manager.c               |    1 -
 src/event.c                       |    3 +-
 src/event.h                       |    8 ++--
 src/events/calendar-appointment.c |    3 +-
 src/events/calendar-task.c        |    3 +-
 src/events/f-spot-photo.c         |    1 -
 src/main-window.c                 |   35 +++++++++++++++++----
 src/main.c                        |    2 +-
 src/preferences-dialog.c          |    7 ++--
 src/printing.c                    |    5 ++-
 src/search-dialog.c               |   10 ++++--
 src/storage-manager.c             |   59 ++++++++++++++++++-------------------
 25 files changed, 100 insertions(+), 83 deletions(-)

diff --git a/src/add-definition-dialog.c b/src/add-definition-dialog.c
index 2a47b2d..fe5c746 100644
--- a/src/add-definition-dialog.c
+++ b/src/add-definition-dialog.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,13 +28,15 @@
 #include "main.h"
 #include "storage-manager.h"
 
-static void almanah_add_definition_dialog_init (AlmanahAddDefinitionDialog *self);
 static void almanah_add_definition_dialog_dispose (GObject *object);
 static void almanah_add_definition_dialog_finalize (GObject *object);
 static void almanah_add_definition_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 static void almanah_add_definition_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
 static void response_cb (GtkDialog *dialog, gint response_id, AlmanahAddDefinitionDialog *self);
 
+/* GtkBuilder callbacks */
+void add_type_combo_box_changed_cb (GtkComboBox *combo_box, AlmanahAddDefinitionDialog *self);
+
 struct _AlmanahAddDefinitionDialogPrivate {
 	GtkComboBox *type_combo_box;
 	GtkVBox *vbox;
diff --git a/src/add-definition-dialog.h b/src/add-definition-dialog.h
index 0a14ca9..a26ea71 100644
--- a/src/add-definition-dialog.h
+++ b/src/add-definition-dialog.h
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -48,7 +48,7 @@ typedef struct {
 
 GType almanah_add_definition_dialog_get_type (void);
 
-AlmanahAddDefinitionDialog *almanah_add_definition_dialog_new ();
+AlmanahAddDefinitionDialog *almanah_add_definition_dialog_new (void);
 
 const gchar *almanah_add_definition_dialog_get_text (AlmanahAddDefinitionDialog *self);
 void almanah_add_definition_dialog_set_text (AlmanahAddDefinitionDialog *self, const gchar *text);
diff --git a/src/definition-manager-window.c b/src/definition-manager-window.c
index 17b236d..05f3fd8 100644
--- a/src/definition-manager-window.c
+++ b/src/definition-manager-window.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -29,13 +29,18 @@
 #include "definition.h"
 #include "storage-manager.h"
 
-static void almanah_definition_manager_window_init (AlmanahDefinitionManagerWindow *self);
 static void almanah_definition_manager_window_dispose (GObject *object);
 static void definition_selection_changed_cb (GtkTreeSelection *tree_selection, AlmanahDefinitionManagerWindow *self);
 static void definition_added_cb (AlmanahStorageManager *storage_manager, AlmanahDefinition *definition, AlmanahDefinitionManagerWindow *self);
 static void definition_removed_cb (AlmanahStorageManager *storage_manager, const gchar *definition_text, AlmanahDefinitionManagerWindow *self);
 static void populate_definition_store (AlmanahDefinitionManagerWindow *self);
 
+/* GtkBuilder callbacks */
+void dmw_definition_tree_view_row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column,
+						AlmanahDefinitionManagerWindow *self);
+void dmw_view_button_clicked_cb (GtkButton *button, AlmanahDefinitionManagerWindow *self);
+void dmw_remove_button_clicked_cb (GtkButton *button, AlmanahDefinitionManagerWindow *self);
+
 struct _AlmanahDefinitionManagerWindowPrivate {
 	GtkLabel *name_label;
 	GtkLabel *description_label;
diff --git a/src/definition.c b/src/definition.c
index a9fede1..cb22ad0 100644
--- a/src/definition.c
+++ b/src/definition.c
@@ -44,7 +44,6 @@ const DefinitionType definition_types[] = {
 	{ ALMANAH_DEFINITION_CONTACT, almanah_contact_definition_get_type }
 };
 
-static void almanah_definition_init (AlmanahDefinition *self);
 static void almanah_definition_finalize (GObject *object);
 static void almanah_definition_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 static void almanah_definition_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
diff --git a/src/definition.h b/src/definition.h
index 3a7bbea..9d773f7 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -52,9 +52,9 @@ typedef struct {
 	GObjectClass parent;
 
 	AlmanahDefinitionType type_id;
-	gchar *name;
-	gchar *description;
-	gchar *icon_name;
+	const gchar *name;
+	const gchar *description;
+	const gchar *icon_name;
 
 	gboolean (*view) (AlmanahDefinition *definition);
 	void (*build_dialog) (AlmanahDefinition *definition, GtkVBox *parent_vbox);
diff --git a/src/definitions/contact.c b/src/definitions/contact.c
index 77a5baf..3e4da3d 100644
--- a/src/definitions/contact.c
+++ b/src/definitions/contact.c
@@ -25,7 +25,6 @@
 #include "../definition.h"
 #include "../main.h"
 
-static void almanah_contact_definition_init (AlmanahContactDefinition *self);
 static void almanah_contact_definition_dispose (GObject *object);
 static gboolean contact_view (AlmanahDefinition *definition);
 static void contact_build_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
diff --git a/src/definitions/file.c b/src/definitions/file.c
index a7f757c..4e9aea0 100644
--- a/src/definitions/file.c
+++ b/src/definitions/file.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
 #include "../definition.h"
 #include "../main.h"
 
-static void almanah_file_definition_init (AlmanahFileDefinition *self);
 static gboolean file_view (AlmanahDefinition *definition);
 static void file_build_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
 static void file_close_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
diff --git a/src/definitions/note.c b/src/definitions/note.c
index fe1ea0d..a664023 100644
--- a/src/definitions/note.c
+++ b/src/definitions/note.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
 #include "../interface.h"
 #include "../main.h"
 
-static void almanah_note_definition_init (AlmanahNoteDefinition *self);
 static gboolean note_view (AlmanahDefinition *definition);
 static void note_build_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
 static void note_close_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
diff --git a/src/definitions/uri.c b/src/definitions/uri.c
index 6466d7e..c99166b 100644
--- a/src/definitions/uri.c
+++ b/src/definitions/uri.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,7 +26,6 @@
 #include "../interface.h"
 #include "../main.h"
 
-static void almanah_uri_definition_init (AlmanahURIDefinition *self);
 static gboolean uri_view (AlmanahDefinition *definition);
 static void uri_build_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
 static void uri_close_dialog (AlmanahDefinition *definition, GtkVBox *parent_vbox);
diff --git a/src/entry.c b/src/entry.c
index f1f635c..2b35715 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -24,7 +24,6 @@
 #include "entry.h"
 #include "main.h"
 
-static void almanah_entry_init (AlmanahEntry *self);
 static void almanah_entry_finalize (GObject *object);
 static void almanah_entry_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 static void almanah_entry_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
diff --git a/src/event-factories/calendar.c b/src/event-factories/calendar.c
index 78812e1..7997350 100644
--- a/src/event-factories/calendar.c
+++ b/src/event-factories/calendar.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,7 +26,6 @@
 #include "../events/calendar-appointment.h"
 #include "../events/calendar-task.h"
 
-static void almanah_calendar_event_factory_init (AlmanahCalendarEventFactory *self);
 static void almanah_calendar_event_factory_dispose (GObject *object);
 static void query_events (AlmanahEventFactory *event_factory, GDate *date);
 static GSList *get_events (AlmanahEventFactory *event_factory, GDate *date);
diff --git a/src/event-factories/f-spot.c b/src/event-factories/f-spot.c
index f4b6937..157bc30 100644
--- a/src/event-factories/f-spot.c
+++ b/src/event-factories/f-spot.c
@@ -27,7 +27,6 @@
 #include "../event-factory.h"
 #include "../events/f-spot-photo.h"
 
-static void almanah_f_spot_event_factory_init (AlmanahFSpotEventFactory *self);
 static void almanah_f_spot_event_factory_dispose (GObject *object);
 static void almanah_f_spot_event_factory_finalize (GObject *object);
 static void query_events (AlmanahEventFactory *event_factory, GDate *date);
diff --git a/src/event-factory.c b/src/event-factory.c
index 9a16f1b..fcf02d1 100644
--- a/src/event-factory.c
+++ b/src/event-factory.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
 #include "event-factory.h"
 #include "event-factory-builtins.h"
 
-static void almanah_event_factory_init (AlmanahEventFactory *self);
 static void almanah_event_factory_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 
 struct _AlmanahEventFactoryPrivate {
diff --git a/src/event-manager.c b/src/event-manager.c
index f8ec75b..93016b6 100644
--- a/src/event-manager.c
+++ b/src/event-manager.c
@@ -39,7 +39,6 @@ const EventFactoryType event_factory_types[] = {
 	{ ALMANAH_EVENT_FACTORY_F_SPOT, almanah_f_spot_event_factory_get_type }
 };
 
-static void almanah_event_manager_init (AlmanahEventManager *self);
 static void almanah_event_manager_dispose (GObject *object);
 static void events_updated_cb (AlmanahEventFactory *factory, AlmanahEventManager *self);
 
diff --git a/src/event.c b/src/event.c
index 2fee903..42f4797 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
 #include "event.h"
 #include "main.h"
 
-static void almanah_event_init (AlmanahEvent *self);
 static void almanah_event_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 
 enum {
diff --git a/src/event.h b/src/event.h
index 73b478e..0de9a44 100644
--- a/src/event.h
+++ b/src/event.h
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -42,9 +42,9 @@ typedef struct {
 typedef struct {
 	GObjectClass parent;
 
-	gchar *name;
-	gchar *description;
-	gchar *icon_name;
+	const gchar *name;
+	const gchar *description;
+	const gchar *icon_name;
 
 	const gchar *(*format_value) (AlmanahEvent *event);
 	gboolean (*view) (AlmanahEvent *event);
diff --git a/src/events/calendar-appointment.c b/src/events/calendar-appointment.c
index a9e60c5..742f2f9 100644
--- a/src/events/calendar-appointment.c
+++ b/src/events/calendar-appointment.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
 #include "calendar-appointment.h"
 #include "main.h"
 
-static void almanah_calendar_appointment_event_init (AlmanahCalendarAppointmentEvent *self);
 static void almanah_calendar_appointment_event_finalize (GObject *object);
 static const gchar *almanah_calendar_appointment_event_format_value (AlmanahEvent *event);
 static gboolean almanah_calendar_appointment_event_view (AlmanahEvent *event);
diff --git a/src/events/calendar-task.c b/src/events/calendar-task.c
index 6564585..b88f719 100644
--- a/src/events/calendar-task.c
+++ b/src/events/calendar-task.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
 #include "calendar-task.h"
 #include "main.h"
 
-static void almanah_calendar_task_event_init (AlmanahCalendarTaskEvent *self);
 static void almanah_calendar_task_event_finalize (GObject *object);
 static const gchar *almanah_calendar_task_event_format_value (AlmanahEvent *event);
 static gboolean almanah_calendar_task_event_view (AlmanahEvent *event);
diff --git a/src/events/f-spot-photo.c b/src/events/f-spot-photo.c
index b545d0f..db9e71e 100644
--- a/src/events/f-spot-photo.c
+++ b/src/events/f-spot-photo.c
@@ -24,7 +24,6 @@
 #include "f-spot-photo.h"
 #include "main.h"
 
-static void almanah_f_spot_photo_event_init (AlmanahFSpotPhotoEvent *self);
 static void almanah_f_spot_photo_event_finalize (GObject *object);
 static const gchar *almanah_f_spot_photo_event_format_value (AlmanahEvent *event);
 static gboolean almanah_f_spot_photo_event_view (AlmanahEvent *event);
diff --git a/src/main-window.c b/src/main-window.c
index 25398db..48e7470 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -40,7 +40,6 @@
 #include "definition.h"
 #include "definition-manager-window.h"
 
-static void almanah_main_window_init (AlmanahMainWindow *self);
 static void almanah_main_window_dispose (GObject *object);
 static void save_window_state (AlmanahMainWindow *self);
 static void restore_window_state (AlmanahMainWindow *self);
@@ -54,11 +53,33 @@ static void mw_bold_toggled_cb (GtkToggleAction *action, AlmanahMainWindow *main
 static void mw_italic_toggled_cb (GtkToggleAction *action, AlmanahMainWindow *main_window);
 static void mw_underline_toggled_cb (GtkToggleAction *action, AlmanahMainWindow *main_window);
 static void mw_events_updated_cb (AlmanahEventManager *event_manager, AlmanahEventFactoryType type_id, AlmanahMainWindow *main_window);
-void mw_calendar_day_selected_cb (GtkCalendar *calendar, AlmanahMainWindow *main_window);
 static void mw_events_selection_changed_cb (GtkTreeSelection *tree_selection, AlmanahMainWindow *main_window);
 static void mw_events_value_data_cb (GtkTreeViewColumn *column, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data);
 static void mw_definition_removed_cb (AlmanahStorageManager *storage_manager, const gchar *definition_text, AlmanahMainWindow *main_window);
 
+/* GtkBuilder callbacks */
+void mw_calendar_day_selected_cb (GtkCalendar *calendar, AlmanahMainWindow *main_window);
+void mw_page_setup_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_print_preview_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_print_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_quit_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_cut_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_copy_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_paste_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_delete_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_insert_time_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_important_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_search_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_preferences_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_about_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_jump_to_today_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_add_definition_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_remove_definition_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_view_definitions_activate_cb (GtkAction *action, AlmanahMainWindow *main_window);
+void mw_events_tree_view_row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, AlmanahMainWindow *main_window);
+gboolean mw_entry_view_focus_out_event_cb (GtkWidget *entry_view, GdkEventFocus *event, AlmanahMainWindow *main_window);
+void mw_view_button_clicked_cb (GtkButton *button, AlmanahMainWindow *main_window);
+
 struct _AlmanahMainWindowPrivate {
 	GtkTextView *entry_view;
 	GtkTextBuffer *entry_buffer;
@@ -665,19 +686,19 @@ mw_delete_event_cb (GtkWindow *window, gpointer user_data)
 }
 
 void
-mw_page_setup_activate_cb (GtkAction *action, gpointer user_data)
+mw_page_setup_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
 {
 	almanah_print_page_setup ();
 }
 
 void
-mw_print_preview_activate_cb (GtkAction *action, gpointer user_data)
+mw_print_preview_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
 {
 	almanah_print_entries (TRUE);
 }
 
 void
-mw_print_activate_cb (GtkAction *action, gpointer user_data)
+mw_print_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
 {
 	almanah_print_entries (FALSE);
 }
@@ -735,7 +756,7 @@ mw_important_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
 }
 
 void
-mw_search_activate_cb (GtkAction *action, gpointer user_data)
+mw_search_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
 {
 	if (almanah->search_dialog == NULL)
 		almanah->search_dialog = GTK_WIDGET (almanah_search_dialog_new ());
@@ -745,7 +766,7 @@ mw_search_activate_cb (GtkAction *action, gpointer user_data)
 }
 
 void
-mw_preferences_activate_cb (GtkAction *action, gpointer user_data)
+mw_preferences_activate_cb (GtkAction *action, AlmanahMainWindow *main_window)
 {
 #ifdef ENABLE_ENCRYPTION
 	if (almanah->preferences_dialog == NULL)
diff --git a/src/main.c b/src/main.c
index 8f156b6..dbeaf96 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,7 +30,7 @@
 
 Almanah *almanah;
 
-static void
+static G_GNUC_NORETURN void
 storage_manager_disconnected_cb (AlmanahStorageManager *self, gpointer user_data)
 {
 	g_object_unref (almanah->storage_manager);
diff --git a/src/preferences-dialog.c b/src/preferences-dialog.c
index ae5b31a..0017e20 100644
--- a/src/preferences-dialog.c
+++ b/src/preferences-dialog.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,7 +34,6 @@
 #include "main.h"
 #include "main-window.h"
 
-static void almanah_preferences_dialog_init (AlmanahPreferencesDialog *self);
 static void almanah_preferences_dialog_dispose (GObject *object);
 #ifdef ENABLE_ENCRYPTION
 static void pd_key_combo_changed_cb (GtkComboBox *combo_box, AlmanahPreferencesDialog *preferences_dialog);
@@ -237,10 +236,10 @@ static void
 pd_new_key_button_clicked_cb (GtkButton *button, AlmanahPreferencesDialog *preferences_dialog)
 {
 	/* NOTE: pilfered from cryptui_need_to_get_keys */
-	gchar *argv[2] = { "seahorse", NULL };
+	const gchar *argv[2] = { "seahorse", NULL };
 	GError *error = NULL;
 
-	if (g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error) == FALSE) {
+	if (g_spawn_async (NULL, (gchar**) argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error) == FALSE) {
 		GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (almanah->preferences_dialog),
 							    GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
 							    _("Error opening Seahorse"));
diff --git a/src/printing.c b/src/printing.c
index 1c91808..0442598 100644
--- a/src/printing.c
+++ b/src/printing.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
 #include "storage-manager.h"
 #include "interface.h"
 #include "main.h"
+#include "printing.h"
 
 #define TITLE_MARGIN_BOTTOM 15 /* margin under the title, in pixels */
 #define ENTRY_MARGIN_BOTTOM 10 /* margin under the entry, in pixels */
@@ -314,7 +315,7 @@ print_entry (GtkPrintOperation *operation, GtkPrintContext *context, AlmanahPrin
 	entry_y = almanah_operation->y;
 
 	/* Draw the lines in the entry */
-	for (i = almanah_operation->current_line; i < pango_layout_get_line_count (entry_layout); i++) {
+	for (i = almanah_operation->current_line; (gint) i < pango_layout_get_line_count (entry_layout); i++) {
 		entry_line = pango_layout_get_line_readonly (entry_layout, i);
 		pango_layout_line_get_pixel_extents (entry_line, NULL, &logical_extents);
 
diff --git a/src/search-dialog.c b/src/search-dialog.c
index dd95d0f..f490e32 100644
--- a/src/search-dialog.c
+++ b/src/search-dialog.c
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
 /*
  * Almanah
- * Copyright (C) Philip Withnall 2008 <philip tecnocode co uk>
+ * Copyright (C) Philip Withnall 2008-2009 <philip tecnocode co uk>
  * 
  * Almanah is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,10 +27,14 @@
 #include "main.h"
 #include "main-window.h"
 
-static void almanah_search_dialog_init (AlmanahSearchDialog *self);
 static void sd_response_cb (GtkDialog *dialog, gint response_id, AlmanahSearchDialog *search_dialog);
 static void sd_results_selection_changed_cb (GtkTreeSelection *tree_selection, GtkWidget *button);
 
+/* GtkBuilder callbacks */
+void sd_search_button_clicked_cb (GtkButton *self, AlmanahSearchDialog *search_dialog);
+void sd_results_tree_view_row_activated_cb (GtkTreeView *self, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
+void sd_view_button_clicked_cb (GtkButton *self, AlmanahSearchDialog *search_dialog);
+
 struct _AlmanahSearchDialogPrivate {
 	GtkEntry *sd_search_entry;
 	GtkListStore *sd_results_store;
@@ -141,7 +145,7 @@ sd_search_button_clicked_cb (GtkButton *self, AlmanahSearchDialog *search_dialog
 {
 	GDate *results;
 	gint result_count;
-	guint i;
+	gint i;
 	GtkTreeIter iter;
 	AlmanahSearchDialogPrivate *priv = search_dialog->priv;
 
diff --git a/src/storage-manager.c b/src/storage-manager.c
index 303e9d2..b38bbb0 100644
--- a/src/storage-manager.c
+++ b/src/storage-manager.c
@@ -34,7 +34,6 @@
 #include "definition.h"
 #include "storage-manager.h"
 
-static void almanah_storage_manager_init (AlmanahStorageManager *self);
 static void almanah_storage_manager_finalize (GObject *object);
 static void almanah_storage_manager_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 static void almanah_storage_manager_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
@@ -207,23 +206,23 @@ typedef struct {
 static gboolean
 prepare_gpgme (AlmanahStorageManager *self, gboolean encrypting, CipherOperation *operation, GError **error)
 {
-	gpgme_error_t gpgme_error;
+	gpgme_error_t error_gpgme;
 
 	/* Check OpenPGP's supported */
-	gpgme_error = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
-	if (gpgme_error != GPG_ERR_NO_ERROR) {
+	error_gpgme = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
+	if (error_gpgme != GPG_ERR_NO_ERROR) {
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_UNSUPPORTED,
 			     _("GPGME doesn't support OpenPGP: %s"),
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
 	/* Set up for the operation */
-	gpgme_error = gpgme_new (&(operation->context));
-	if (gpgme_error != GPG_ERR_NO_ERROR) {
+	error_gpgme = gpgme_new (&(operation->context));
+	if (error_gpgme != GPG_ERR_NO_ERROR) {
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_CREATING_CONTEXT,
 			     _("Error creating cipher context: %s"),
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
@@ -238,7 +237,7 @@ static gboolean
 open_db_files (AlmanahStorageManager *self, gboolean encrypting, CipherOperation *operation, GError **error)
 {
 	GError *io_error = NULL;
-	gpgme_error_t gpgme_error;
+	gpgme_error_t error_gpgme;
 
 	/* Open the encrypted file */
 	operation->cipher_io_channel = g_io_channel_new_file (self->priv->filename, encrypting ? "w" : "r", &io_error);
@@ -248,12 +247,12 @@ open_db_files (AlmanahStorageManager *self, gboolean encrypting, CipherOperation
 	}
 
 	/* Pass it to GPGME */
-	gpgme_error = gpgme_data_new_from_fd (&(operation->gpgme_cipher), g_io_channel_unix_get_fd (operation->cipher_io_channel));
-	if (gpgme_error != GPG_ERR_NO_ERROR) {
+	error_gpgme = gpgme_data_new_from_fd (&(operation->gpgme_cipher), g_io_channel_unix_get_fd (operation->cipher_io_channel));
+	if (error_gpgme != GPG_ERR_NO_ERROR) {
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_OPENING_FILE,
 			     _("Error opening encrypted database file \"%s\": %s"),
 			     self->priv->filename,
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
@@ -268,12 +267,12 @@ open_db_files (AlmanahStorageManager *self, gboolean encrypting, CipherOperation
 	fchmod (g_io_channel_unix_get_fd (operation->plain_io_channel), S_IRWXU);
 
 	/* Pass it to GPGME */
-	gpgme_error = gpgme_data_new_from_fd (&(operation->gpgme_plain), g_io_channel_unix_get_fd (operation->plain_io_channel));
-	if (gpgme_error != GPG_ERR_NO_ERROR) {
+	error_gpgme = gpgme_data_new_from_fd (&(operation->gpgme_plain), g_io_channel_unix_get_fd (operation->plain_io_channel));
+	if (error_gpgme != GPG_ERR_NO_ERROR) {
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_OPENING_FILE,
 			     _("Error opening plain database file \"%s\": %s"),
 			     self->priv->plain_filename,
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
@@ -307,9 +306,9 @@ static gboolean
 database_idle_cb (CipherOperation *operation)
 {
 	AlmanahStorageManager *self = operation->storage_manager;
-	gpgme_error_t gpgme_error;
+	gpgme_error_t error_gpgme;
 
-	if (!(gpgme_wait (operation->context, &gpgme_error, FALSE) == NULL && gpgme_error == 0)) {
+	if (!(gpgme_wait (operation->context, &error_gpgme, FALSE) == NULL && error_gpgme == 0)) {
 		struct stat db_stat;
 
 		/* Check to see if the encrypted file is 0B in size, which isn't good.
@@ -341,7 +340,7 @@ decrypt_database (AlmanahStorageManager *self, GError **error)
 {
 	GError *preparation_error = NULL;
 	CipherOperation *operation;
-	gpgme_error_t gpgme_error;
+	gpgme_error_t error_gpgme;
 
 	operation = g_new0 (CipherOperation, 1);
 	operation->storage_manager = g_object_ref (self);
@@ -355,12 +354,12 @@ decrypt_database (AlmanahStorageManager *self, GError **error)
 	}
 
 	/* Decrypt and verify! */
-	gpgme_error = gpgme_op_decrypt_verify (operation->context, operation->gpgme_cipher, operation->gpgme_plain);
-	if (gpgme_error != GPG_ERR_NO_ERROR) {
+	error_gpgme = gpgme_op_decrypt_verify (operation->context, operation->gpgme_cipher, operation->gpgme_plain);
+	if (error_gpgme != GPG_ERR_NO_ERROR) {
 		cipher_operation_free (operation);
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_DECRYPTING,
 			     _("Error decrypting database: %s"),
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
@@ -375,7 +374,7 @@ encrypt_database (AlmanahStorageManager *self, const gchar *encryption_key, GErr
 {
 	GError *preparation_error = NULL;
 	CipherOperation *operation;
-	gpgme_error_t gpgme_error;
+	gpgme_error_t error_gpgme;
 	gpgme_key_t gpgme_keys[2] = { NULL, };
 
 	operation = g_new0 (CipherOperation, 1);
@@ -389,12 +388,12 @@ encrypt_database (AlmanahStorageManager *self, const gchar *encryption_key, GErr
 	}
 
 	/* Set up signing and the recipient */
-	gpgme_error = gpgme_get_key (operation->context, encryption_key, &gpgme_keys[0], FALSE);
-	if (gpgme_error != GPG_ERR_NO_ERROR || gpgme_keys[0] == NULL) {
+	error_gpgme = gpgme_get_key (operation->context, encryption_key, &gpgme_keys[0], FALSE);
+	if (error_gpgme != GPG_ERR_NO_ERROR || gpgme_keys[0] == NULL) {
 		cipher_operation_free (operation);
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_GETTING_KEY,
 			     _("Error getting encryption key: %s"),
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
@@ -407,15 +406,15 @@ encrypt_database (AlmanahStorageManager *self, const gchar *encryption_key, GErr
 	}
 
 	/* Encrypt and sign! */
-	gpgme_error = gpgme_op_encrypt_sign_start (operation->context, gpgme_keys, 0, operation->gpgme_plain, operation->gpgme_cipher);
+	error_gpgme = gpgme_op_encrypt_sign_start (operation->context, gpgme_keys, 0, operation->gpgme_plain, operation->gpgme_cipher);
 	gpgme_key_unref (gpgme_keys[0]);
 
-	if (gpgme_error != GPG_ERR_NO_ERROR) {
+	if (error_gpgme != GPG_ERR_NO_ERROR) {
 		cipher_operation_free (operation);
 
 		g_set_error (error, ALMANAH_STORAGE_MANAGER_ERROR, ALMANAH_STORAGE_MANAGER_ERROR_ENCRYPTING,
 			     _("Error encrypting database: %s"),
-			     gpgme_strerror (gpgme_error));
+			     gpgme_strerror (error_gpgme));
 		return FALSE;
 	}
 
@@ -891,7 +890,7 @@ gboolean *
 almanah_storage_manager_get_month_marked_days (AlmanahStorageManager *self, GDateYear year, GDateMonth month, guint *num_days)
 {
 	AlmanahQueryResults *results;
-	guint i;
+	gint i;
 	gboolean *days;
 
 	i = g_date_get_days_in_month (month, year);
@@ -932,7 +931,7 @@ almanah_storage_manager_get_definitions (AlmanahStorageManager *self)
 {
 	AlmanahQueryResults *results;
 	AlmanahDefinition **definitions;
-	guint i;
+	gint i;
 
 	results = almanah_storage_manager_query (self, "SELECT definition_type, definition_value, definition_value2, definition_text FROM definitions", NULL);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]