On Tue, 2002-04-16 at 10:40, Ettore Perazzoli wrote:
> On Tue, 2002-04-16 at 06:22, Alec Edworthy wrote:
> > Hi,
> > 
> > Would it be possible to allow the adding of IMAP folders onto the
> > Summary page like you can add normal folders now?
> 
> This is implemented on the unstable version on CVS.
> 

Um, it may be implemented, but right now the mail summary doesn't work
at all for me. Even local folders don't show up. I'm attaching a patch
to the shell and summary which gets things kinda-sorta working, but
there are still issues:

        * Folders with counts of -1/-1 show up
        * The folder selector shows noselect folders wrong
        * I need to change the sort style of the folder selector in order to
see any folders there
        * Folder names are weird
        * Probably other stuff that I forget or haven't realized.

Peter

-- 
Peter Williams     [EMAIL PROTECTED] / [EMAIL PROTECTED]

"Why should I have to change my name? He's the one who 
sucks!"                              -- Michael Bolton
Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.904
diff -u -r1.904 ChangeLog
--- shell/ChangeLog     10 Apr 2002 19:01:08 -0000      1.904
+++ shell/ChangeLog     16 Apr 2002 23:29:29 -0000
@@ -1,3 +1,8 @@
+2002-04-16  Peter Williams  <[EMAIL PROTECTED]>
+
+       * e-corba-storage-registry.c (impl_StorageRegistry_addStorage): Notify
+       listeners when a storage is added.
+
 2002-04-10  Dan Winship  <[EMAIL PROTECTED]>
 
        * e-shell-config.c: Shell config page routines. Right now
Index: shell/e-corba-storage-registry.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-corba-storage-registry.c,v
retrieving revision 1.17
diff -u -r1.17 e-corba-storage-registry.c
--- shell/e-corba-storage-registry.c    9 Apr 2002 14:59:26 -0000       1.17
+++ shell/e-corba-storage-registry.c    16 Apr 2002 23:29:29 -0000
@@ -107,6 +107,7 @@
        ECorbaStorageRegistryPrivate *priv;
        EStorage *storage;
        GNOME_Evolution_StorageListener listener_interface;
+       GSList *iter;
 
        bonobo_object = bonobo_object_from_servant (servant);
        storage_registry = E_CORBA_STORAGE_REGISTRY (bonobo_object);
@@ -123,6 +124,12 @@
        }
 
        gtk_object_unref (GTK_OBJECT (storage));
+
+       /* FIXME: if we remove a listener while looping through the list we can
+        * crash. Yay CORBA reentrancy. */
+
+       for (iter = priv->listeners; iter; iter = iter->next)
+               listener_notify (iter->data, 
+GNOME_Evolution_StorageRegistry_STORAGE_CREATED, name);
 
        listener_interface = CORBA_Object_duplicate 
(e_corba_storage_get_StorageListener
                                                     (E_CORBA_STORAGE (storage)), ev);
Index: my-evolution/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/my-evolution/ChangeLog,v
retrieving revision 1.180
diff -u -r1.180 ChangeLog
--- my-evolution/ChangeLog      9 Apr 2002 15:06:10 -0000       1.180
+++ my-evolution/ChangeLog      16 Apr 2002 23:29:29 -0000
@@ -1,3 +1,15 @@
+2002-04-16  Peter Williams  <[EMAIL PROTECTED]>
+
+       * e-summary-mail.c (e_summary_folder_register_storage): Use
+       correct signal names: new-folder -> new_folder, same for
+       removed_folder.
+       (e_summary_mail_generate_html): Loop through folder_store->shown,
+       not mail->shown.
+       (struct _ESummaryMail): the shown member is unused.
+       (new_folder_cb): Don't restrict ourselves to vfolders and locally
+       stored folders. Try to guess the toplevel URI of the storage
+       if possible.
+
 2002-04-08  Dan Winship  <[EMAIL PROTECTED]>
 
        * component-factory.c (create_view): Add view_info arg but don't
Index: my-evolution/e-summary-mail.c
===================================================================
RCS file: /cvs/gnome/evolution/my-evolution/e-summary-mail.c,v
retrieving revision 1.37
diff -u -r1.37 e-summary-mail.c
--- my-evolution/e-summary-mail.c       4 Apr 2002 12:10:36 -0000       1.37
+++ my-evolution/e-summary-mail.c       16 Apr 2002 23:29:29 -0000
@@ -70,7 +70,7 @@
        
        GHashTable *folders;
 #endif 
-       GList *shown;
+       /*GList *shown;*/
        ESummaryMailMode mode;
 
        char *html;
@@ -154,7 +154,7 @@
        g_free (s);
        g_string_append (string, "</a></b></dt><dd><table numcols=\"2\" 
width=\"100%\">");
        
-       for (p = mail->shown; p; p = p->next) {
+       for (p = folder_store->shown; p; p = p->next) {
                folder_gen_html (summary, p->data, string);
        }
 
@@ -173,7 +173,7 @@
 {
        /* Only regenerate HTML when it's needed */
        e_summary_mail_generate_html (summary);
-       
+
        if (summary->mail == NULL) {
                return NULL;
        }
@@ -216,11 +216,8 @@
        GList *p;
 
        /* Don't care about non mail */
-       if (strcmp (folder->type, "mail") != 0 ||
-           (strncmp (folder->physicalUri, "file://", 7) != 0 &&
-           strncmp (folder->physicalUri, "vfolder", 7) != 0)) {
+       if (strcmp (folder->type, "mail") != 0)
                return;
-       }
 
        mail_folder = g_new (ESummaryMailFolder, 1);
        mail_folder->si = si;
@@ -233,6 +230,18 @@
        g_hash_table_insert (folder_store->folders, mail_folder->path, mail_folder);
        si->folders = g_list_prepend (si->folders, mail_folder);
 
+       /* see if we can get the toplevel */
+       if (si->toplevel == NULL) {
+               size_t plen, slen;
+
+               plen = strlen (mail_folder->path);
+               slen = strlen (path);
+
+               /* need the strncmp to not be caught by URL parameters */
+               if (strncmp (mail_folder->path + (plen - slen), path, plen) == 0)
+                       si->toplevel = g_strndup (mail_folder->path, plen - slen);
+       }
+
        global_preferences = e_summary_preferences_get_global ();
        for (p = global_preferences->display_folders; p; p = p->next) {
                if (strcmp (p->data, folder->physicalUri) == 0) {
@@ -356,9 +365,9 @@
 
        folder_store->storage_list = g_slist_prepend (folder_store->storage_list, si);
        
-       gtk_signal_connect (GTK_OBJECT (si->listener), "new-folder",
+       gtk_signal_connect (GTK_OBJECT (si->listener), "new_folder",
                            GTK_SIGNAL_FUNC (new_folder_cb), si);
-       gtk_signal_connect (GTK_OBJECT (si->listener), "removed-folder",
+       gtk_signal_connect (GTK_OBJECT (si->listener), "removed_folder",
                            GTK_SIGNAL_FUNC (remove_folder_cb), si);
        gtk_signal_connect (GTK_OBJECT (si->listener), "update_folder",
                            GTK_SIGNAL_FUNC (update_folder_cb), si);

Reply via email to