almanah r103 - in trunk: . src
- From: pwithnall svn gnome org
- To: svn-commits-list gnome org
- Subject: almanah r103 - in trunk: . src
- Date: Thu, 13 Nov 2008 23:17:43 +0000 (UTC)
Author: pwithnall
Date: Thu Nov 13 23:17:43 2008
New Revision: 103
URL: http://svn.gnome.org/viewvc/almanah?rev=103&view=rev
Log:
2008-11-13 Philip Withnall <philip tecnocode co uk>
* src/entry.c (almanah_entry_get_content):
* src/entry.h:
* src/main-window.c (mw_calendar_day_selected_cb):
* src/printing.c (print_entry):
* src/storage-manager.c
(almanah_storage_manager_search_entries):
Fix problems with automatically creating tags when deserialising
an
entry into a GtkTextBuffer.
* src/search-dialog.c (sd_search_button_clicked_cb): Make sure
the
result list is cleared before doing a new search.
Modified:
trunk/ChangeLog
trunk/src/entry.c
trunk/src/entry.h
trunk/src/main-window.c
trunk/src/printing.c
trunk/src/search-dialog.c
trunk/src/storage-manager.c
Modified: trunk/src/entry.c
==============================================================================
--- trunk/src/entry.c (original)
+++ trunk/src/entry.c Thu Nov 13 23:17:43 2008
@@ -171,7 +171,7 @@
}
gboolean
-almanah_entry_get_content (AlmanahEntry *self, GtkTextBuffer *text_buffer, GError **error)
+almanah_entry_get_content (AlmanahEntry *self, GtkTextBuffer *text_buffer, gboolean create_tags, GError **error)
{
GdkAtom format_atom;
GtkTextIter start_iter;
@@ -179,7 +179,7 @@
GError *deserialise_error = NULL;
format_atom = gtk_text_buffer_register_deserialize_tagset (text_buffer, PACKAGE_NAME);
- gtk_text_buffer_deserialize_set_can_create_tags (text_buffer, format_atom, TRUE);
+ gtk_text_buffer_deserialize_set_can_create_tags (text_buffer, format_atom, create_tags);
gtk_text_buffer_get_start_iter (text_buffer, &start_iter);
/* Try deserializing the (hopefully) serialized data first */
Modified: trunk/src/entry.h
==============================================================================
--- trunk/src/entry.h (original)
+++ trunk/src/entry.h Thu Nov 13 23:17:43 2008
@@ -56,7 +56,7 @@
AlmanahEntry *almanah_entry_new (GDate *date);
const guint8 *almanah_entry_get_data (AlmanahEntry *self, gsize *length);
void almanah_entry_set_data (AlmanahEntry *self, const guint8 *data, gsize length);
-gboolean almanah_entry_get_content (AlmanahEntry *self, GtkTextBuffer *text_buffer, GError **error);
+gboolean almanah_entry_get_content (AlmanahEntry *self, GtkTextBuffer *text_buffer, gboolean create_tags, GError **error);
void almanah_entry_set_content (AlmanahEntry *self, GtkTextBuffer *text_buffer);
void almanah_entry_get_date (AlmanahEntry *self, GDate *date);
AlmanahEntryEditability almanah_entry_get_editability (AlmanahEntry *self);
Modified: trunk/src/main-window.c
==============================================================================
--- trunk/src/main-window.c (original)
+++ trunk/src/main-window.c Thu Nov 13 23:17:43 2008
@@ -829,7 +829,7 @@
GError *error = NULL;
gtk_text_buffer_set_text (priv->entry_buffer, "", 0);
- if (almanah_entry_get_content (priv->current_entry, priv->entry_buffer, &error) == FALSE) {
+ if (almanah_entry_get_content (priv->current_entry, priv->entry_buffer, FALSE, &error) == FALSE) {
GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (almanah->main_window),
GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
_("Entry content could not be loaded"));
Modified: trunk/src/printing.c
==============================================================================
--- trunk/src/printing.c (original)
+++ trunk/src/printing.c Thu Nov 13 23:17:43 2008
@@ -276,7 +276,7 @@
GtkTextIter start, end;
gtk_text_buffer_set_text (almanah_operation->buffer, "", 0);
- if (almanah_entry_get_content (entry, almanah_operation->buffer, NULL) == TRUE) {
+ if (almanah_entry_get_content (entry, almanah_operation->buffer, TRUE, NULL) == TRUE) {
gtk_text_buffer_get_bounds (almanah_operation->buffer, &start, &end);
lay_out_entry (entry_layout, &start, &end);
}
Modified: trunk/src/search-dialog.c
==============================================================================
--- trunk/src/search-dialog.c (original)
+++ trunk/src/search-dialog.c Thu Nov 13 23:17:43 2008
@@ -145,6 +145,7 @@
GtkTreeIter iter;
AlmanahSearchDialogPrivate *priv = search_dialog->priv;
+ gtk_list_store_clear (search_dialog->priv->sd_results_store);
result_count = almanah_storage_manager_search_entries (almanah->storage_manager,
gtk_entry_get_text (priv->sd_search_entry), &results);
Modified: trunk/src/storage-manager.c
==============================================================================
--- trunk/src/storage-manager.c (original)
+++ trunk/src/storage-manager.c Thu Nov 13 23:17:43 2008
@@ -816,8 +816,9 @@
/* Deserialise the entry into our buffer */
gtk_text_buffer_set_text (text_buffer, "", 0);
- if (almanah_entry_get_content (entry, text_buffer, NULL) == FALSE) {
+ if (almanah_entry_get_content (entry, text_buffer, TRUE, NULL) == FALSE) {
g_object_unref (entry);
+ g_warning (_("Error deserializing entry into buffer while searching."));
continue;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]