Send commitlog mailing list submissions to
        [EMAIL PROTECTED]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r1734 - trunk/src/target/OM-2007/openmoko-libs/libmokoui
      ([EMAIL PROTECTED])
   2. r1735 -
      trunk/src/target/OM-2007/applications/openmoko-rssreader/src
      ([EMAIL PROTECTED])
   3. r1736 - in trunk/src/target/OM-2007/openmoko-libs: .
      libmokojournal/src libmokojournal/tests ([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-04-12 23:55:28 +0200 (Thu, 12 Apr 2007)
New Revision: 1734

Modified:
   trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro
Log:
libmokoui: add missing files to .pro build infrastructure


Modified: trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro      
2007-04-12 21:54:34 UTC (rev 1733)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokoui/libmokoui.pro      
2007-04-12 21:55:28 UTC (rev 1734)
@@ -6,12 +6,14 @@
     moko-alignment.h \
     moko-application.h \
     moko-details-window.h \
+    moko-dialog.h \
     moko-dialog-window.h \
     moko-finger-tool-box.h \
     moko-finger-wheel.h \
     moko-finger-window.h \
     moko-fixed.h \
     moko-menu-box.h \
+    moko-message-dialog.h \
     moko-nativation-list.h \
     moko-panel-applet.h \
     moko-pixmap-button.h \
@@ -24,12 +26,14 @@
     moko-alignment.c \
     moko-application.c \
     moko-details-window.c \
+    moko-dialog.c \
     moko-dialog-window.c \
     moko-finger-tool-box.c \
     moko-finger-wheel.c \
     moko-finger-window.c \
     moko-fixed.c \
     moko-menu-box.c \
+    moko-message-dialog.c \
     moko-navigation-list.c \
     moko-panel-applet.c \
     moko-pixmap-button.c \




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-04-13 01:35:33 +0200 (Fri, 13 Apr 2007)
New Revision: 1735

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c
Log:
openmoko-rssreader: Implement as-you-type filtering on RSS articles
    Use the search bar to filter items on the fly. Fix the refcounting
    when using _get of the GtkTreeModel.


Modified: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c    
2007-04-12 21:55:28 UTC (rev 1734)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c    
2007-04-12 23:35:33 UTC (rev 1735)
@@ -208,8 +208,6 @@
     }
 
 }
-void cb_searchbox_visible( MokoToolBox *box, struct RSSReaderData *data ) {}
-void cb_searchbox_invisible( MokoToolBox *box, struct RSSReaderData *data ) {}
 
 /*
  * TODO: Update the text and make it rich text.
@@ -235,6 +233,31 @@
     }
 }
 
-gboolean cb_treeview_keypress_event( GtkWidget *entry, GdkEventKey *key, 
struct RSSReaderData *data ) { return TRUE; }
-void cb_search_entry_changed      ( GtkWidget *entry, struct RSSReaderData 
*data ) {}
+/*
+ * search functionality
+ */
+void cb_searchbox_visible( MokoToolBox *box, struct RSSReaderData *data ) {
+    cb_search_entry_changed (moko_tool_box_get_entry (box), data);
+}
 
+void cb_searchbox_invisible( MokoToolBox *box, struct RSSReaderData *data ) {
+    if ( data->current_search_text ) {
+        g_free (data->current_search_text);
+        data->current_search_text = NULL;
+    }
+
+    filter_feeds (data);
+}
+
+gboolean cb_treeview_keypress_event( GtkWidget *entry, GdkEventKey *key, 
struct RSSReaderData *data ) {
+    return TRUE;
+}
+
+void cb_search_entry_changed      ( GtkWidget *entry, struct RSSReaderData 
*data ) {
+    if ( data->current_search_text )
+        g_free (data->current_search_text);
+
+    data->current_search_text = g_strdup (gtk_entry_get_text 
(GTK_ENTRY(entry)));
+    filter_feeds (data);
+}
+

Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c 
2007-04-12 21:55:28 UTC (rev 1734)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/main.c 
2007-04-12 23:35:33 UTC (rev 1735)
@@ -23,6 +23,7 @@
  *
  *  Current Version: $Rev$ ($Date$) [$Author$]
  */
+#define _GNU_SOURCE
 #include "config.h"
 #include <glib/gi18n.h>
 
@@ -50,16 +51,42 @@
         gchar *category;
         gtk_tree_model_get (model, iter,  RSS_READER_COLUMN_CATEGORY, 
&category,  -1);
 
+        /*
+         * how does this happen?
+         */
+        if ( !category )
+            return FALSE;
 
         if ( strcmp(category, data->current_filter) != 0 )
             return FALSE;
+
+        g_free (category);
     }
 
 
     /*
      * filter the text according to the search now
      */
+    if ( data->current_search_text ) {
+        gchar *text;
 
+        #define FILTER_SEARCH(column)                                      \
+        gtk_tree_model_get (model, iter, column, &text, -1);               \
+        if ( text && strcasestr (text, data->current_search_text) != NULL ) { \
+            g_free (text);                                                 \
+            return TRUE;                                                   \
+        }
+
+        FILTER_SEARCH(RSS_READER_COLUMN_AUTHOR)
+        FILTER_SEARCH(RSS_READER_COLUMN_SUBJECT)
+        FILTER_SEARCH(RSS_READER_COLUMN_SOURCE)
+        FILTER_SEARCH(RSS_READER_COLUMN_LINK)
+        FILTER_SEARCH(RSS_READER_COLUMN_TEXT)
+
+        #undef FILTER_SEARCH
+        return FALSE;
+    }
+
     return TRUE;
 }
 
@@ -73,12 +100,20 @@
     gtk_tree_model_get (model, _left,  RSS_READER_COLUMN_DATE, &left,  -1);
     gtk_tree_model_get (model, _right, RSS_READER_COLUMN_DATE, &right, -1);
 
+    int result;
     if ( left == NULL )
-        return -1;
+        result = -1;
     else if ( right == NULL )
-        return 1;
+        result = 1;
     else
-        return rss_rfc_date_compare (left, right);
+        result = rss_rfc_date_compare (left, right);
+
+    if ( left )
+        g_object_unref (left);
+    if ( right )
+        g_object_unref (right);
+
+    return result;
 }
 
 static void
@@ -89,6 +124,7 @@
 
     g_assert (date);
     g_object_set ( G_OBJECT(renderer), "text", rss_rfc_date_as_string(date), 
NULL);
+    g_object_unref (G_OBJECT(date));
 }
 
 /*




--- End Message ---
--- Begin Message ---
Author: dodji
Date: 2007-04-13 10:37:14 +0200 (Fri, 13 Apr 2007)
New Revision: 1736

Modified:
   trunk/src/target/OM-2007/openmoko-libs/ChangeLog
   trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.c
   trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.h
   trunk/src/target/OM-2007/openmoko-libs/libmokojournal/tests/test-create.c
Log:
Better entries removal handling, renamed more moko_j_* into moko_journal_*

        * *.h,c: changed moko_j_email_info* into moko_journal_email_info*
        * openmoko-libs/libmokojournal/src/moko-journal.c:
          (moko_journal_remove_entry_at): only entries that has been
          persisted should be queued for removal from eds.
          (moko_journal_write_to_storage): do not cry too much when
          an entry queued for removal could not be removed. It can happen
          in nominal cases, for instance another process could have
          deleted it already.
        * openmoko-libs/libmokojournal/tests/test-create.c: update this
          because of the moko_j_email* into moko_journal_email renaming.


Modified: trunk/src/target/OM-2007/openmoko-libs/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/ChangeLog    2007-04-12 23:35:33 UTC 
(rev 1735)
+++ trunk/src/target/OM-2007/openmoko-libs/ChangeLog    2007-04-13 08:37:14 UTC 
(rev 1736)
@@ -1,3 +1,16 @@
+2007-04-13 Dodji Seketeli <[EMAIL PROTECTED]>
+
+       * *.h,c: changed moko_j_email_info* into moko_journal_email_info*
+       * openmoko-libs/libmokojournal/src/moko-journal.c:
+         (moko_journal_remove_entry_at): only entries that has been
+         persisted should be queued for removal from eds.
+         (moko_journal_write_to_storage): do not cry too much when
+         an entry queued for removal could not be removed. It can happen
+         in nominal cases, for instance another process could have
+         deleted it already.
+       * openmoko-libs/libmokojournal/tests/test-create.c: update this
+         because of the moko_j_email* into moko_journal_email renaming.
+
 2007-04-12 Dodji Seketeli <[EMAIL PROTECTED]>
 
        * openmoko-libs/libmokojournal/src/moko-journal.c,h:

Modified: 
trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.c    
2007-04-12 23:35:33 UTC (rev 1735)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.c    
2007-04-13 08:37:14 UTC (rev 1736)
@@ -196,13 +196,13 @@
 }
 
 MokoJournalEmailInfo*
-moko_j_email_info_new ()
+moko_journal_email_info_new ()
 {
   return g_new0 (MokoJournalEmailInfo, 1) ;
 }
 
 void
-moko_j_email_info_free (MokoJournalEmailInfo *a_info)
+moko_journal_email_info_free (MokoJournalEmailInfo *a_info)
 {
   g_return_if_fail (a_info) ;
   g_free (a_info) ;
@@ -253,7 +253,7 @@
     case EMAIL_JOURNAL_ENTRY:
       if (a_entry->extra_info.email_info)
       {
-        moko_j_email_info_free (a_entry->extra_info.email_info) ;
+        moko_journal_email_info_free (a_entry->extra_info.email_info) ;
         a_entry->extra_info.email_info = NULL ;
       }
       break ;
@@ -334,7 +334,7 @@
         MokoJournalEmailInfo *info=NULL ;
         if (!moko_journal_entry_get_email_info (a_entry, &info) || !info)
           goto out ;
-        if (moko_j_email_info_get_was_sent (info))
+        if (moko_journal_email_info_get_was_sent (info))
           prop = icalproperty_new_x ("YES") ;
         else
           prop = icalproperty_new_x ("NO") ;
@@ -451,9 +451,9 @@
                                              &prop_value))
         {
           if (prop_value && !strcmp (prop_value, "YES"))
-            moko_j_email_info_set_was_sent (info, TRUE) ;
+            moko_journal_email_info_set_was_sent (info, TRUE) ;
           else
-            moko_j_email_info_set_was_sent (info, FALSE) ;
+            moko_journal_email_info_set_was_sent (info, FALSE) ;
         }
       }
       break ;
@@ -669,17 +669,37 @@
 moko_journal_remove_entry_at (MokoJournal *a_journal,
                               guint a_index)
 {
+  MokoJournalEntry *entry = NULL ;
+
   g_return_val_if_fail (a_journal, FALSE) ;
   g_return_val_if_fail (a_journal->entries, FALSE) ;
   g_return_val_if_fail (a_index < a_journal->entries->len, FALSE) ;
 
-  if (g_array_index (a_journal->entries, MokoJournalEntry*, a_index))
+  entry = g_array_index (a_journal->entries, MokoJournalEntry*, a_index) ;
+  if (entry)
   {
-    a_journal->entries_to_delete =
-      g_list_prepend (a_journal->entries_to_delete,
-                      g_array_index (a_journal->entries,
-                                     MokoJournalEntry*, a_index));
+    /*
+     * if entry has been persisted already,
+     * queue a removal from storage
+     */
+    if (entry->uid)
+    {
+      a_journal->entries_to_delete =
+        g_list_prepend (a_journal->entries_to_delete, entry);
+    }
+    /*
+     * remove entry from memory cache
+     */
     g_array_remove_index (a_journal->entries, a_index) ;
+    /*
+     * if entry has not been pushed onto
+     * storage deletion queue,
+     * deallocate its memory
+     */
+    if (!entry->uid)
+    {
+      moko_journal_entry_free (entry) ;
+    }
     return TRUE ;
   }
   return FALSE ;
@@ -822,7 +842,10 @@
     }
   }
 
-  /*remove entries that are to be removed*/
+  /*
+   * remove entries that have been
+   * queued to be removed
+   */
   for (cur_elem = a_journal->entries_to_delete ;
        cur_elem ;
        cur_elem = cur_elem->next)
@@ -836,7 +859,12 @@
                                 ((MokoJournalEntry*)cur_elem->data)->uid,
                                 &error))
       {
-        g_warning ("failed to remove object of UID %s\n",
+        /*
+         * this can happen if another process for instance, has
+         * already deleted the entry. In that case, we just
+         * print message and continue
+         */
+        g_message ("failed to remove object with UID %s\n",
                    ((MokoJournalEntry*)cur_elem->data)->uid) ;
       }
       if (error)
@@ -1238,7 +1266,7 @@
 
   if (!a_entry->extra_info.email_info)
   {
-    a_entry->extra_info.email_info = moko_j_email_info_new () ;
+    a_entry->extra_info.email_info = moko_journal_email_info_new () ;
   }
   g_return_val_if_fail (a_entry->extra_info.email_info, FALSE) ;
 
@@ -1247,7 +1275,7 @@
 }
 
 /**
- * moko_j_email_info_get_was_sent:
+ * moko_journal_email_info_get_was_sent:
  * @info: the current instance of email info
  *
  * Get a boolean property stating if the email was sent or received.
@@ -1255,21 +1283,21 @@
  * Return value: TRUE if the email was sent, false if it was received
  */
 gboolean
-moko_j_email_info_get_was_sent (MokoJournalEmailInfo *a_info)
+moko_journal_email_info_get_was_sent (MokoJournalEmailInfo *a_info)
 {
   g_return_val_if_fail (a_info, FALSE) ;
   return a_info->was_sent ;
 }
 
 /**
- * moko_j_email_info_set_was_sent:
+ * moko_journal_email_info_set_was_sent:
  * @info: the current instance of email info
  * @was_sent: TRUE if the email was sent, FALSE if it was received
  *
  * Set a boolean property stating if the email was sent or received
  */
 void
-moko_j_email_info_set_was_sent (MokoJournalEmailInfo *a_info,
+moko_journal_email_info_set_was_sent (MokoJournalEmailInfo *a_info,
                                 gboolean a_was_sent)
 {
   g_return_if_fail (a_info) ;

Modified: 
trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.h
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.h    
2007-04-12 23:35:33 UTC (rev 1735)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokojournal/src/moko-journal.h    
2007-04-13 08:37:14 UTC (rev 1736)
@@ -300,7 +300,7 @@
  *
  * Return value: TRUE if the email was sent, false if it was received
  */
-gboolean moko_j_email_info_get_was_sent (MokoJournalEmailInfo *info) ;
+gboolean moko_journal_email_info_get_was_sent (MokoJournalEmailInfo *info) ;
 
 /**
  * moko_j_email_info_set_was_sent:
@@ -309,8 +309,8 @@
  *
  * Set a boolean property stating if the email was sent or received
  */
-void moko_j_email_info_set_was_sent (MokoJournalEmailInfo *info,
-                                     gboolean was_sent) ;
+void moko_journal_email_info_set_was_sent (MokoJournalEmailInfo *info,
+                                           gboolean was_sent) ;
 
 /*</email info>*/
 

Modified: 
trunk/src/target/OM-2007/openmoko-libs/libmokojournal/tests/test-create.c
===================================================================
--- trunk/src/target/OM-2007/openmoko-libs/libmokojournal/tests/test-create.c   
2007-04-12 23:35:33 UTC (rev 1735)
+++ trunk/src/target/OM-2007/openmoko-libs/libmokojournal/tests/test-create.c   
2007-04-13 08:37:14 UTC (rev 1736)
@@ -65,7 +65,7 @@
         g_warning ("failed to get email extra info from journal entry\n") ;
         goto out ;
     }
-    moko_j_email_info_set_was_sent (email_info, TRUE) ;
+    moko_journal_email_info_set_was_sent (email_info, TRUE) ;
     /*****************************
      * </fill the entry with data>
      *****************************/




--- End Message ---
_______________________________________________
commitlog mailing list
[EMAIL PROTECTED]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to