{
TnyAccountStoreViewIface *klass = (TnyAccountStoreViewIface *)g;
- klass->set_account_store_func = modest_folder_view_set_account_store;
-
- return;
+ klass->set_account_store = modest_folder_view_set_account_store;
}
static void
}
static void
-on_connection_status_changed (TnyAccount *self,
- TnyConnectionStatus status,
- gpointer user_data)
-{
- /* If the account becomes online then refresh it */
- if (status == TNY_CONNECTION_STATUS_CONNECTED) {
- const gchar *acc_name;
- GtkWidget *my_window;
-
- my_window = gtk_widget_get_ancestor (GTK_WIDGET (user_data), MODEST_TYPE_WINDOW);
- acc_name = modest_tny_account_get_parent_modest_account_name_for_server_account (self);
- modest_ui_actions_do_send_receive (acc_name, FALSE, MODEST_WINDOW (my_window));
- }
-}
-
-static void
on_account_inserted (TnyAccountStore *account_store,
TnyAccount *account,
gpointer user_data)
tny_list_append (TNY_LIST (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (sort_model))),
G_OBJECT (account));
-
- /* When the store account gets online refresh it */
- g_signal_connect (account, "connection_status_changed",
- G_CALLBACK (on_connection_status_changed),
- MODEST_FOLDER_VIEW (user_data));
-
/* Refilter the model */
gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter_model));
}
gpointer user_data)
{
DndHelper *helper;
+ GtkWidget *folder_view;
helper = (DndHelper *) user_data;
+ folder_view = g_object_ref (helper->folder_view);
/* Common part */
xfer_cb (mail_op, user_data);
/* Select the folder */
if (new_folder)
- modest_folder_view_select_folder (MODEST_FOLDER_VIEW (helper->folder_view),
+ modest_folder_view_select_folder (MODEST_FOLDER_VIEW (folder_view),
new_folder, FALSE);
+ g_object_unref (folder_view);
}
forbidden = rules & MODEST_FOLDER_RULES_FOLDER_NON_WRITEABLE;
} else if (TNY_IS_FOLDER_STORE(folder)) {
/* enable local root as destination for folders */
- if (!MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (folder)
- && TNY_IS_ACCOUNT (folder))
+ if (!MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (folder) &&
+ !modest_tny_account_is_memory_card_account (TNY_ACCOUNT (folder)))
forbidden = TRUE;
}
g_object_unref (folder);
/* Expand the selected row after 1/2 second */
if (!gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), dest_row)) {
- gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), dest_row, pos);
priv->timer_expander = g_timeout_add (500, expand_row_timeout, widget);
}
+ gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), dest_row, pos);
/* Select the desired action. By default we pick MOVE */
suggested_action = GDK_ACTION_MOVE;
out:
if (folder)
g_object_unref (folder);
- if (dest_row)
+ if (dest_row) {
gtk_tree_path_free (dest_row);
+ }
g_signal_stop_emission_by_name (widget, "drag-motion");
return valid_location;