* small updates
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 11 Aug 2006 12:22:33 +0000 (12:22 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 11 Aug 2006 12:22:33 +0000 (12:22 +0000)
* modest-tny-transport-acctions.[ch] does not have to be a GObject

pmo-trunk-r474

src/modest-main.c
src/modest-tny-transport-actions.c
src/modest-tny-transport-actions.h
src/modest-widget-factory.c

index 988c5c2..1f836ab 100644 (file)
@@ -217,7 +217,6 @@ send_mail (ModestConf *conf, const gchar* mailto, const gchar *cc, const gchar *
           const gchar* subject, const gchar *body)
 {
        ModestAccountMgr *acc_mgr = NULL;
           const gchar* subject, const gchar *body)
 {
        ModestAccountMgr *acc_mgr = NULL;
-       ModestTnyTransportActions *transport = NULL;
        ModestTnyAccountStore *acc_store = NULL;
 
        TnyListIface *accounts = NULL;
        ModestTnyAccountStore *acc_store = NULL;
 
        TnyListIface *accounts = NULL;
@@ -227,7 +226,6 @@ send_mail (ModestConf *conf, const gchar* mailto, const gchar *cc, const gchar *
        
        acc_mgr   = modest_account_mgr_new (conf);
        acc_store = modest_tny_account_store_new (acc_mgr);     
        
        acc_mgr   = modest_account_mgr_new (conf);
        acc_store = modest_tny_account_store_new (acc_mgr);     
-       transport = modest_tny_transport_actions_new ();
 
        accounts = TNY_LIST_IFACE(tny_list_new ());
        tny_account_store_iface_get_accounts (TNY_ACCOUNT_STORE_IFACE(acc_store), accounts,
 
        accounts = TNY_LIST_IFACE(tny_list_new ());
        tny_account_store_iface_get_accounts (TNY_ACCOUNT_STORE_IFACE(acc_store), accounts,
@@ -243,9 +241,9 @@ send_mail (ModestConf *conf, const gchar* mailto, const gchar *cc, const gchar *
 
        account = TNY_TRANSPORT_ACCOUNT_IFACE (tny_iterator_iface_current(iter));
 
 
        account = TNY_TRANSPORT_ACCOUNT_IFACE (tny_iterator_iface_current(iter));
 
-       if (!modest_tny_transport_actions_send_message (transport, account,
-                                                       "<>", mailto, cc, bcc, subject, body,
-                                                       NULL)) {
+       if (!modest_tny_transport_actions_send_message ( account,
+                                                        "<>", mailto, cc, bcc, subject, body,
+                                                        NULL)) {
                retval = MODEST_ERR_SEND;
                goto cleanup;
        } else
                retval = MODEST_ERR_SEND;
                goto cleanup;
        } else
@@ -256,8 +254,6 @@ cleanup:
                g_object_unref (G_OBJECT(iter));
        if (accounts)
                g_object_unref (G_OBJECT(accounts));
                g_object_unref (G_OBJECT(iter));
        if (accounts)
                g_object_unref (G_OBJECT(accounts));
-       if (transport)
-               g_object_unref (G_OBJECT(transport));
        if (acc_store)
                g_object_unref (G_OBJECT(acc_store));
        if (acc_mgr)
        if (acc_store)
                g_object_unref (G_OBJECT(acc_store));
        if (acc_mgr)
index 955ff1d..22db181 100644 (file)
  */
 
 
  */
 
 
-/* modest-tny-transport-actions.c */
-
 #include <tny-msg.h>
 #include <tny-msg.h>
-#include <tny-msg-iface.h>                     
 #include <tny-mime-part.h>
 #include <tny-mime-part.h>
-#include <tny-mime-part-iface.h>               
 #include <tny-stream-iface.h>
 #include <tny-header.h>
 #include <tny-stream-iface.h>
 #include <tny-header.h>
-#include <tny-header-iface.h>
 #include <tny-account-iface.h> 
 #include <tny-account-store-iface.h>
 #include <tny-transport-account-iface.h>       
 #include <tny-account-iface.h> 
 #include <tny-account-store-iface.h>
 #include <tny-transport-account-iface.h>       
 #include <tny-stream-camel.h>
 #include <tny-fs-stream.h>
 #include <string.h>
 #include <tny-stream-camel.h>
 #include <tny-fs-stream.h>
 #include <string.h>
-#include <camel/camel-folder.h>
-#include <camel/camel.h>
-#include <camel/camel-folder-summary.h>
 
 #include "modest-tny-transport-actions.h"
 #include "modest-tny-attachment.h"
 
 #include "modest-tny-transport-actions.h"
 #include "modest-tny-attachment.h"
-/* include other impl specific header files */
-
-/* 'private'/'protected' functions */
-static void                              modest_tny_transport_actions_class_init   (ModestTnyTransportActionsClass *klass);
-static void                              modest_tny_transport_actions_init         (ModestTnyTransportActions *obj);
-static void                              modest_tny_transport_actions_finalize     (GObject *obj);
-static gboolean                          is_ascii                                  (const gchar *s);
-static char *                            get_content_type                          (const gchar *s);
-
-/* list my signals */
-enum {
-       /* MY_SIGNAL_1, */
-       /* MY_SIGNAL_2, */
-       LAST_SIGNAL
-};
-
-typedef struct _ModestTnyTransportActionsPrivate ModestTnyTransportActionsPrivate;
-struct _ModestTnyTransportActionsPrivate {
-       /* my private members go here, eg. */
-       /* gboolean frobnicate_mode; */
-};
-#define MODEST_TNY_TRANSPORT_ACTIONS_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
-                                                          MODEST_TYPE_TNY_TRANSPORT_ACTIONS, \
-                                                          ModestTnyTransportActionsPrivate))
-/* globals */
-static GObjectClass *parent_class = NULL;
-
-/* uncomment the following if you have defined any signals */
-/* static guint signals[LAST_SIGNAL] = {0}; */
-
-GType
-modest_tny_transport_actions_get_type (void)
-{
-       static GType my_type = 0;
-       if (!my_type) {
-               static const GTypeInfo my_info = {
-                       sizeof(ModestTnyTransportActionsClass),
-                       NULL,           /* base init */
-                       NULL,           /* base finalize */
-                       (GClassInitFunc) modest_tny_transport_actions_class_init,
-                       NULL,           /* class finalize */
-                       NULL,           /* class data */
-                       sizeof(ModestTnyTransportActions),
-                       1,              /* n_preallocs */
-                       (GInstanceInitFunc) modest_tny_transport_actions_init,
-               };
-               my_type = g_type_register_static (G_TYPE_OBJECT,
-                                                 "ModestTnyTransportActions",
-                                                 &my_info, 0);
-       }
-       return my_type;
-}
-
-static void
-modest_tny_transport_actions_class_init (ModestTnyTransportActionsClass *klass)
-{
-       GObjectClass *gobject_class;
-       gobject_class = (GObjectClass*) klass;
-
-       parent_class            = g_type_class_peek_parent (klass);
-       gobject_class->finalize = modest_tny_transport_actions_finalize;
-
-       g_type_class_add_private (gobject_class, sizeof(ModestTnyTransportActionsPrivate));
-
-       /* signal definitions go here, e.g.: */
-/*     signals[MY_SIGNAL_1] = */
-/*             g_signal_new ("my_signal_1",....); */
-/*     signals[MY_SIGNAL_2] = */
-/*             g_signal_new ("my_signal_2",....); */
-/*     etc. */
-}
-
-static void
-modest_tny_transport_actions_init (ModestTnyTransportActions *obj)
-{
-/* uncomment the following if you init any of the private data */
-/*     ModestTnyTransportActionsPrivate *priv = MODEST_TNY_TRANSPORT_ACTIONS_GET_PRIVATE(obj); */
-
-/*     initialize this object, eg.: */
-/*     priv->frobnicate_mode = FALSE; */
-}
-
-static void
-modest_tny_transport_actions_finalize (GObject *obj)
-{
-/*     free/unref instance resources here */
-}
-
-ModestTnyTransportActions *
-modest_tny_transport_actions_new (void)
-{
-       return MODEST_TNY_TRANSPORT_ACTIONS(g_object_new(MODEST_TYPE_TNY_TRANSPORT_ACTIONS,
-                                                        NULL));
-}
 
 static gboolean
 is_ascii(const gchar *s)
 
 static gboolean
 is_ascii(const gchar *s)
@@ -175,8 +73,7 @@ get_content_type(const gchar *s)
 }
 
 gboolean
 }
 
 gboolean
-modest_tny_transport_actions_send_message (ModestTnyTransportActions *self,
-                                          TnyTransportAccountIface *transport_account,
+modest_tny_transport_actions_send_message (TnyTransportAccountIface *transport_account,
                                           const gchar *from,
                                           const gchar *to,
                                           const gchar *cc,
                                           const gchar *from,
                                           const gchar *to,
                                           const gchar *cc,
index 2d9d496..f3ded53 100644 (file)
 #ifndef __MODEST_TNY_TRANSPORT_ACTIONS_H__
 #define __MODEST_TNY_TRANSPORT_ACTIONS_H__
 
 #ifndef __MODEST_TNY_TRANSPORT_ACTIONS_H__
 #define __MODEST_TNY_TRANSPORT_ACTIONS_H__
 
-#include <glib-object.h>
 #include <tny-transport-account-iface.h>
 
 G_BEGIN_DECLS
 
 #include <tny-transport-account-iface.h>
 
 G_BEGIN_DECLS
 
-/* standard convenience macros */
-#define MODEST_TYPE_TNY_TRANSPORT_ACTIONS             (modest_tny_transport_actions_get_type())
-#define MODEST_TNY_TRANSPORT_ACTIONS(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_TRANSPORT_ACTIONS,ModestTnyTransportActions))
-#define MODEST_TNY_TRANSPORT_ACTIONS_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_TRANSPORT_ACTIONS,GObject))
-#define MODEST_IS_TNY_TRANSPORT_ACTIONS(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_TRANSPORT_ACTIONS))
-#define MODEST_IS_TNY_TRANSPORT_ACTIONS_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_TRANSPORT_ACTIONS))
-#define MODEST_TNY_TRANSPORT_ACTIONS_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_TRANSPORT_ACTIONS,ModestTnyTransportActionsClass))
-
-typedef struct _ModestTnyTransportActions      ModestTnyTransportActions;
-typedef struct _ModestTnyTransportActionsClass ModestTnyTransportActionsClass;
-
-struct _ModestTnyTransportActions {
-        GObject parent;
-       /* insert public members, if any */
-};
-
-struct _ModestTnyTransportActionsClass {
-       GObjectClass parent_class;
-       /* insert signal callback declarations, eg. */
-       /* void (* my_event) (ModestTnyTransportActions* obj); */
-};
-
-/* member functions */
-GType        modest_tny_transport_actions_get_type    (void) G_GNUC_CONST;
-
-/* typical parameter-less _new function */
-/* if this is a kind of GtkWidget, it should probably return at GtkWidget*, */
-/*    otherwise probably a GObject*. */
-
-ModestTnyTransportActions* modest_tny_transport_actions_new         (void);
-
-
 /**
  * modest_tny_transport_actions_send_message:
  * @self: a ModestTnyTransportActions object
 /**
  * modest_tny_transport_actions_send_message:
  * @self: a ModestTnyTransportActions object
@@ -85,8 +52,7 @@ ModestTnyTransportActions* modest_tny_transport_actions_new         (void);
  *
  * Returns: TRUE but this will change to whether sending was successful
  */
  *
  * Returns: TRUE but this will change to whether sending was successful
  */
-gboolean modest_tny_transport_actions_send_message (ModestTnyTransportActions *self,
-                                                   TnyTransportAccountIface *transport_account,
+gboolean modest_tny_transport_actions_send_message (TnyTransportAccountIface *transport_account,
                                                    const gchar *from,
                                                    const gchar *to,
                                                    const gchar *cc,
                                                    const gchar *from,
                                                    const gchar *to,
                                                    const gchar *cc,
index 5348fce..e6f8b27 100644 (file)
@@ -395,7 +395,6 @@ modest_widget_factory_get_combo_box (ModestWidgetFactory *self, ModestComboBoxTy
 
 
 
 
 
 
-
 GtkWidget*
 modest_widget_factory_get_online_toggle (ModestWidgetFactory *self)
 {
 GtkWidget*
 modest_widget_factory_get_online_toggle (ModestWidgetFactory *self)
 {