gobject_class->finalize = modest_account_view_window_finalize;
g_type_class_add_private (gobject_class, sizeof(ModestAccountViewWindowPrivate));
-
- /* 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
GtkTreeModel *model;
GtkTreeIter iter;
gboolean has_selection;
- const gchar *account_name;
+ gchar *account_name;
gchar *default_account_name;
priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
gtk_widget_set_sensitive (priv->default_button,
default_account_name == NULL || account_name == NULL ||
strcmp (default_account_name, account_name) != 0);
+ g_free (account_name);
g_free (default_account_name);
}
{
ModestAccountViewWindowPrivate *priv;
ModestAccountMgr *account_mgr;
- const gchar *account_name;
+ gchar *account_name;
priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
txt = g_strdup_printf (_("Do you really want to delete the account %s?"), account_name);
gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox),
gtk_label_new (txt), FALSE, FALSE, 0);
- gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox));
+/* gtk_widget_show_all (GTK_WIDGET(GTK_DIALOG(dialog)->vbox)); */
g_free (txt);
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
/* Show confirmation dialog ??? */
} else {
/* Show error dialog ??? */
+ g_warning ("Error removing account %s", account_name);
}
}
gtk_widget_destroy (dialog);
+ g_free (account_name);
}
}
{
ModestAccountViewWindowPrivate *priv;
ModestAccountMgr *account_mgr;
- const gchar *account_name;
+ gchar *account_name;
priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
account_name = modest_account_view_get_selected_account (priv->account_view);
modest_account_mgr_set_default_account (account_mgr, account_name);
+
+ g_free (account_name);
}
{
ModestAccountViewWindowPrivate *priv;
GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean has_selection;
- const gchar *account_name;
- gchar *default_account_name;
+ GtkTreeIter iter;
+ gboolean has_selection;
+ gchar *account_name;
+ gchar *default_account_name;
priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
gtk_widget_set_sensitive (priv->default_button,
default_account_name == NULL || account_name == NULL ||
strcmp (default_account_name, account_name) != 0);
+ g_free (account_name);
g_free (default_account_name);
}
{
ModestAccountViewWindowPrivate *priv;
ModestAccountMgr *account_mgr;
- const gchar *account_name;
+ gchar *account_name;
priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
}
}
gtk_widget_destroy (dialog);
+ g_free (account_name);
}
}
{
ModestAccountViewWindowPrivate *priv;
ModestAccountMgr *account_mgr;
- const gchar *account_name;
+ gchar *account_name;
priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
account_name = modest_account_view_get_selected_account (priv->account_view);
modest_account_mgr_set_default_account (account_mgr, account_name);
+
+ g_free (account_name);
}
GObject *obj;
ModestTnyAccountStorePrivate *priv;
- TnyList *list;
+/* TnyList *list; */
g_return_val_if_fail (account_mgr, NULL);
g_return_val_if_fail (device, NULL);
NULL);
}
-
static void
init_view (ModestAccountView *self)
{
);
gtk_tree_view_set_model (GTK_TREE_VIEW(self), GTK_TREE_MODEL(model));
+ g_object_unref (G_OBJECT (model));
toggle_renderer = gtk_cell_renderer_toggle_new ();
text_renderer = gtk_cell_renderer_text_new ();
return MODEST_ACCOUNT_VIEW(obj);
}
-const gchar *
+gchar *
modest_account_view_get_selected_account (ModestAccountView *self)
{
- const gchar *account_name = NULL;
+ gchar *account_name = NULL;
GtkTreeSelection *sel;
GtkTreeModel *model;
GtkTreeIter iter;
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (self));
if (gtk_tree_selection_get_selected (sel, &model, &iter)) {
- gtk_tree_model_get (model, &iter, MODEST_ACCOUNT_VIEW_NAME_COLUMN, &account_name,
- -1);
+ gtk_tree_model_get (model, &iter,
+ MODEST_ACCOUNT_VIEW_NAME_COLUMN,
+ &account_name, -1);
}
return account_name;
* Returns: the name of the selected account or NULL if none is
* selected
**/
-const gchar* modest_account_view_get_selected_account (ModestAccountView *account_view);
+gchar* modest_account_view_get_selected_account (ModestAccountView *account_view);
G_END_DECLS
return priv->cur_folder;
}
-static gboolean
-get_model_iter (ModestFolderView *self,
- GtkTreeModel **model,
- GtkTreeIter *iter)
-{
- GtkTreeModel *model_sort;
- GtkTreeIter iter_sort;
- GtkTreePath *path;
- ModestFolderViewPrivate *priv;
-
- priv = MODEST_FOLDER_VIEW_GET_PRIVATE(self);
-
- if (!priv->cur_folder)
- return FALSE;
-
- if (!gtk_tree_row_reference_valid (priv->cur_row))
- return FALSE;
-
- model_sort = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
- *model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model_sort));
-
- /* Get path to retrieve iter */
- path = gtk_tree_row_reference_get_path (priv->cur_row);
- if (!gtk_tree_model_get_iter (model_sort, &iter_sort, path))
- return FALSE;
-
- gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (model_sort),
- iter,
- &iter_sort);
- return TRUE;
-}
+/* static gboolean */
+/* get_model_iter (ModestFolderView *self, */
+/* GtkTreeModel **model, */
+/* GtkTreeIter *iter) */
+/* { */
+/* GtkTreeModel *model_sort; */
+/* GtkTreeIter iter_sort; */
+/* GtkTreePath *path; */
+/* ModestFolderViewPrivate *priv; */
+
+/* priv = MODEST_FOLDER_VIEW_GET_PRIVATE(self); */
+
+/* if (!priv->cur_folder) */
+/* return FALSE; */
+
+/* if (!gtk_tree_row_reference_valid (priv->cur_row)) */
+/* return FALSE; */
+
+/* model_sort = gtk_tree_view_get_model (GTK_TREE_VIEW (self)); */
+/* *model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (model_sort)); */
+
+/* /\* Get path to retrieve iter *\/ */
+/* path = gtk_tree_row_reference_get_path (priv->cur_row); */
+/* if (!gtk_tree_model_get_iter (model_sort, &iter_sort, path)) */
+/* return FALSE; */
+
+/* gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (model_sort), */
+/* iter, */
+/* &iter_sort); */
+/* return TRUE; */
+/* } */
static gint
cmp_rows (GtkTreeModel *tree_model, GtkTreeIter *iter1, GtkTreeIter *iter2,