From 9009ed542849122824e2355fb71dd1db2dcad0da Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Fri, 11 Aug 2006 12:22:33 +0000 Subject: [PATCH] * small updates * modest-tny-transport-acctions.[ch] does not have to be a GObject pmo-trunk-r474 --- src/modest-main.c | 10 ++-- src/modest-tny-transport-actions.c | 105 +----------------------------------- src/modest-tny-transport-actions.h | 36 +------------ src/modest-widget-factory.c | 1 - 4 files changed, 5 insertions(+), 147 deletions(-) diff --git a/src/modest-main.c b/src/modest-main.c index 988c5c2..1f836ab 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -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; - ModestTnyTransportActions *transport = 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); - 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, @@ -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)); - 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 @@ -256,8 +254,6 @@ cleanup: 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) diff --git a/src/modest-tny-transport-actions.c b/src/modest-tny-transport-actions.c index 955ff1d..22db181 100644 --- a/src/modest-tny-transport-actions.c +++ b/src/modest-tny-transport-actions.c @@ -28,15 +28,10 @@ */ -/* modest-tny-transport-actions.c */ - #include -#include #include -#include #include #include -#include #include #include #include @@ -44,106 +39,9 @@ #include #include #include -#include -#include -#include #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) @@ -175,8 +73,7 @@ get_content_type(const gchar *s) } 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, diff --git a/src/modest-tny-transport-actions.h b/src/modest-tny-transport-actions.h index 2d9d496..f3ded53 100644 --- a/src/modest-tny-transport-actions.h +++ b/src/modest-tny-transport-actions.h @@ -33,43 +33,10 @@ #ifndef __MODEST_TNY_TRANSPORT_ACTIONS_H__ #define __MODEST_TNY_TRANSPORT_ACTIONS_H__ -#include #include 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 @@ -85,8 +52,7 @@ ModestTnyTransportActions* modest_tny_transport_actions_new (void); * * 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, diff --git a/src/modest-widget-factory.c b/src/modest-widget-factory.c index 5348fce..e6f8b27 100644 --- a/src/modest-widget-factory.c +++ b/src/modest-widget-factory.c @@ -395,7 +395,6 @@ modest_widget_factory_get_combo_box (ModestWidgetFactory *self, ModestComboBoxTy - GtkWidget* modest_widget_factory_get_online_toggle (ModestWidgetFactory *self) { -- 1.7.9.5