+2007-06-08 Murray Cumming <murrayc@murrayc.com>
+
+ * src/modest-tny-send-queue.c: (modest_tny_send_queue_add),
+ (modest_tny_send_queue_class_init):
+ Do not use the priv struct because it is empty, to avoid g_warnings
+ about a non-existant priv struct.
+
+ * src/modest-tny-account-store.c:
+ (modest_tny_account_store_get_server_account),
+ (modest_tny_account_store_get_transport_account_for_open_connection
+ ): Do not try to get transport server accounts for local folders,
+ because they don't have any. This avoids a g_warning().
+
+ * src/maemo/modest-main-window.c:
+ (modest_main_window_notify_send_receive_initied),
+ (on_configuration_key_changed):
+ * src/maemo/modest-msg-edit-window.c: (on_delete_event):
+ * src/modest-defs.h:
+ * src/modest-mail-operation.c:
+ (modest_mail_operation_update_account):
+ * src/modest-tny-account-store.h:
+ * src/modest-tny-account.c:
+ (modest_tny_account_get_special_folder),
+ (modest_tny_account_new_for_local_folders),
+ (modest_tny_account_new_for_per_account_local_outbox_folder):
+ * src/modest-tny-folder.c: (modest_tny_folder_is_local_folder):
+ * src/modest-tny-local-folders-account.c:
+ (add_account_folders_to_merged_folder):
+ * src/modest-ui-actions.c: (modest_ui_actions_on_new_msg),
+ (reply_forward_cb), (modest_ui_actions_on_save_to_drafts),
+ (modest_ui_actions_on_send):
+ * src/widgets/modest-folder-view.c: (update_model):
+ Rename MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID to
+ MODEST_LOCAL_FOLDERS_ACCOUNT_ID and rename
+ modest_tny_account_store_get_tny_account_by_account() to
+ modest_tny_account_store_get_server_account() to make the code clearer.
+
2007-06-07 Marcus Bauer <marcusb@openismus.com>
* src/dbus_api/modest-dbus-api.h:
g_return_if_fail (MODEST_IS_MAIN_WINDOW (self));
- /* Tools menu options */
action = modest_window_get_action (MODEST_WINDOW(self), "/MenuBar/ToolsMenu/ToolsSendReceiveMainMenu/ToolsSendReceiveAllMenu");
gtk_action_set_sensitive (action, FALSE);
action = modest_window_get_action (MODEST_WINDOW(self), "/MenuBar/ToolsMenu/ToolsSendReceiveMainMenu/ToolsSendReceiveCancelSendingMenu");
gtk_action_set_sensitive (action, FALSE);
widget = modest_window_get_action_widget (MODEST_WINDOW(self), "/MenuBar/ToolsMenu/ToolsSendReceiveMainMenu/ToolsMenuAdditions");
gtk_widget_set_sensitive (widget, FALSE);
-
- /* Header view CSM */
- action = modest_window_get_action (MODEST_WINDOW(self), "/HeaderViewCSM/HeaderViewCSMCancelSending");
- gtk_action_set_sensitive (action, FALSE);
-
}
void
account = (TnyAccount *) modest_folder_view_get_selected (priv->folder_view);
if (TNY_IS_ACCOUNT (account) &&
- !strcmp (tny_account_get_id (account), MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID)) {
+ !strcmp (tny_account_get_id (account), MODEST_LOCAL_FOLDERS_ACCOUNT_ID)) {
GList *children;
GtkLabel *label;
const gchar *device_name;
/* /\* remove old message from drafts *\/ */
/* if (priv->draft_msg) { */
/* TnyHeader *header = tny_msg_get_header (priv->draft_msg); */
-/* TnyAccount *account = modest_tny_account_store_get_tny_account_by_account (modest_runtime_get_account_store(), */
+/* TnyAccount *account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store(), */
/* account_name, */
/* TNY_ACCOUNT_TYPE_STORE); */
/* TnyFolder *folder = modest_tny_account_get_special_folder (account, TNY_FOLDER_TYPE_DRAFTS); */
#define MODEST_DIR ".modest"
#define MODEST_CACHE_DIR "cache"
-/** Sent, Drafts, etc,
+#define MODEST_LOCAL_FOLDERS_ACCOUNT_ID "local_folders"
+#define MODEST_LOCAL_FOLDERS_ACCOUNT_NAME MODEST_LOCAL_FOLDERS_ACCOUNT_ID
+
+/** Sent, Drafts, etc, are on-disk
* but not outbox, because outbox is a virtual folder merged from the
* various outboxes/<account-name>/outbox folders.
*/
-#define MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID "local_folders"
-#define MODEST_LOCAL_FOLDERS_ACCOUNT_NAME MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID
-#define MODEST_LOCAL_FOLDERS_MAILDIR MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID
+#define MODEST_LOCAL_FOLDERS_MAILDIR MODEST_LOCAL_FOLDERS_ACCOUNT_ID
/** There is an outboxes/<account-name>/outbox/ folder for each account,
* though we merge them so that the user sees only one outbox.
/* Get the Modest account */
modest_account = (TnyStoreAccount *)
- modest_tny_account_store_get_tny_account_by_account (modest_runtime_get_account_store (),
+ modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
account_name,
TNY_ACCOUNT_TYPE_STORE);
}
TnyAccount*
-modest_tny_account_store_get_tny_account_by_account (ModestTnyAccountStore *self,
+modest_tny_account_store_get_server_account (ModestTnyAccountStore *self,
const gchar *account_name,
TnyAccountType type)
{
priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
/* Special case for the local account */
- if (!strcmp (account_name, MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID) &&
- type == TNY_ACCOUNT_TYPE_STORE) {
- id = g_strdup (MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID);
+ if (!strcmp (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID)) {
+ if(type == TNY_ACCOUNT_TYPE_STORE)
+ id = g_strdup (MODEST_LOCAL_FOLDERS_ACCOUNT_ID);
+ else {
+ /* The local folders modest account has no transport server account. */
+ return NULL;
+ }
} else {
ModestAccountData *account_data;
* just get the regular transport account: */
if (!account) {
/* printf("DEBUG: %s: using regular transport account for account %s.\n", __FUNCTION__, account_name); */
- account = modest_tny_account_store_get_tny_account_by_account (self, account_name,
+
+ /* The special local folders don't have transport accounts. */
+ if (strcmp (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) == 0)
+ account = NULL;
+ else
+ account = modest_tny_account_store_get_server_account (self, account_name,
TNY_ACCOUNT_TYPE_TRANSPORT);
}
const gchar *id);
/**
- * modest_tny_account_store_get_tny_account_by_account
+ * modest_tny_account_store_get_server_account
* @self: a ModestTnyAccountStore instance
- * @account_name: an account name
- * @type: the tny account type
+ * @account_name: a modest account name
+ * @type: the tny account type (store or transport)
*
* Get the tny account corresponding to one of the server_accounts for account with @account_name
*
* Returns: the tnyaccount for the server account or NULL in case it's not found or error,
* g_object_unref when it's no longer needed
*/
-TnyAccount* modest_tny_account_store_get_tny_account_by_account (ModestTnyAccountStore *self,
+TnyAccount* modest_tny_account_store_get_server_account (ModestTnyAccountStore *self,
const gchar *account_name,
TnyAccountType type);
} else {
/* Other local folders are all in one on-disk directory: */
local_account = modest_tny_account_store_get_tny_account_by_id (modest_runtime_get_account_store(),
- MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID);
+ MODEST_LOCAL_FOLDERS_ACCOUNT_ID);
}
if (!local_account) {
const gchar* id = is_mmc ? MODEST_MMC_ACCOUNT_ID :
- MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID;
+ MODEST_LOCAL_FOLDERS_ACCOUNT_ID;
tny_account_set_id (TNY_ACCOUNT(tny_account), id);
tny_account_set_forget_pass_func (TNY_ACCOUNT(tny_account), forget_pass_dummy);
tny_account_set_pass_func (TNY_ACCOUNT(tny_account), get_pass_dummy);
modest_tny_account_set_parent_modest_account_name_for_server_account (
- TNY_ACCOUNT (tny_account), MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID);
+ TNY_ACCOUNT (tny_account), id);
camel_url_free (url);
g_free (maildir);
/* Make this think that it belongs to the modest local-folders parent account: */
modest_tny_account_set_parent_modest_account_name_for_server_account (
- TNY_ACCOUNT (tny_account), MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID);
+ TNY_ACCOUNT (tny_account), MODEST_LOCAL_FOLDERS_ACCOUNT_ID);
return TNY_ACCOUNT(tny_account);
}
g_object_unref (G_OBJECT(account));
- return (strcmp (account_id, MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID) == 0);
+ return (strcmp (account_id, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) == 0);
}
{
const gchar* account_id = tny_account_get_id (account);
const gboolean is_actual_local_folders_account = account_id &&
- (strcmp (account_id, MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID) == 0);
+ (strcmp (account_id, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) == 0);
TnyList *list_outbox_folders = tny_simple_list_new ();
tny_folder_store_get_folders (TNY_FOLDER_STORE (account),
LAST_SIGNAL
};
+#if 0
typedef struct _ModestTnySendQueuePrivate ModestTnySendQueuePrivate;
struct _ModestTnySendQueuePrivate {
/* empty */
#define MODEST_TNY_SEND_QUEUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
MODEST_TYPE_TNY_SEND_QUEUE, \
ModestTnySendQueuePrivate))
+#endif
+
/* globals */
static TnyCamelSendQueueClass *parent_class = NULL;
static void
modest_tny_send_queue_add (TnySendQueue *self, TnyMsg *msg, GError **err)
{
- ModestTnySendQueuePrivate *priv;
-
g_return_if_fail (TNY_IS_SEND_QUEUE(self));
g_return_if_fail (TNY_IS_CAMEL_MSG(msg));
- priv = MODEST_TNY_SEND_QUEUE_GET_PRIVATE (self);
-
/* FIXME: do something smart here... */
TNY_CAMEL_SEND_QUEUE_CLASS(parent_class)->add_func (self, msg, err); /* FIXME */
TNY_CAMEL_SEND_QUEUE_CLASS(klass)->get_sentbox_func = modest_tny_send_queue_get_sentbox;
TNY_CAMEL_SEND_QUEUE_CLASS(klass)->cancel_func = modest_tny_send_queue_cancel;
- g_type_class_add_private (gobject_class, sizeof(ModestTnySendQueuePrivate));
+ /* g_type_class_add_private (gobject_class, sizeof(ModestTnySendQueuePrivate)); */
}
static void
goto cleanup;
}
- account = modest_tny_account_store_get_tny_account_by_account (modest_runtime_get_account_store(),
+ account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store(),
account_name,
TNY_ACCOUNT_TYPE_STORE);
if (!account) {
goto cleanup;
}
- account = modest_tny_account_store_get_tny_account_by_account (modest_runtime_get_account_store(),
+ account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store(),
rf_helper->account_name,
TNY_ACCOUNT_TYPE_STORE);
if (!account) {
return;
}
- if (!strcmp (account_name, MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID)) {
+ if (!strcmp (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID)) {
account_name = g_strdup (data->account_name);
}
transport_account =
- TNY_TRANSPORT_ACCOUNT(modest_tny_account_store_get_tny_account_by_account
+ TNY_TRANSPORT_ACCOUNT(modest_tny_account_store_get_server_account
(modest_runtime_get_account_store(),
account_name,
TNY_ACCOUNT_TYPE_TRANSPORT));
}
MsgData *data = modest_msg_edit_window_get_msg_data (edit_window);
- if (!strcmp (account_name, MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID)) {
+ if (!strcmp (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID)) {
account_name = g_strdup (data->account_name);
}
/* Remove the old model as observer of the local folder account */
#if 0 /* Commented out until Sergio fixes the crash. */
local_account =
- modest_tny_account_store_get_tny_account_by_account (modest_runtime_get_account_store (),
- MODEST_ACTUAL_LOCAL_FOLDERS_ACCOUNT_ID,
+ modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
+ MODEST_LOCAL_FOLDERS_ACCOUNT_ID,
TNY_ACCOUNT_TYPE_STORE);
old_model = gtk_tree_view_get_model (GTK_TREE_VIEW (self));