* Gets a comma-separated list of the categories currently selected
* in the dialog.
*
- * Returns: a comma-separated list of categories
+ * Returns: a comma-separated list of categories. Free returned
+ * pointer with g_free().
**/
-const gchar *
+gchar *
e_categories_dialog_get_categories (ECategoriesDialog *dialog)
{
- const gchar *categories;
+ gchar *categories;
g_return_val_if_fail (E_IS_CATEGORIES_DIALOG (dialog), NULL);
GType e_categories_dialog_get_type (void);
GtkWidget * e_categories_dialog_new (const gchar *categories);
-const gchar * e_categories_dialog_get_categories
+gchar * e_categories_dialog_get_categories
(ECategoriesDialog *dialog);
void e_categories_dialog_set_categories
(ECategoriesDialog *dialog,
ECategoriesEditor *editor)
{
GtkEntry *entry;
- const gchar *categories;
+ gchar *categories;
entry = GTK_ENTRY (editor->priv->categories_entry);
categories = e_categories_selector_get_checked (selector);
gtk_entry_set_text (entry, categories);
+
+ g_free (categories);
}
static void
ECategoriesEditor *editor)
{
ECategoryEditor *cat_editor = e_category_editor_new ();
- const gchar *category;
+ gchar *category;
category = e_categories_selector_get_selected (
editor->priv->categories_list);
e_category_editor_edit_category (cat_editor, category);
gtk_widget_destroy (GTK_WIDGET (cat_editor));
+ g_free (category);
}
static void
* Gets a comma-separated list of the categories currently selected
* in the editor.
*
- * Returns: a comma-separated list of categories
+ * Returns: a comma-separated list of categories. Free returned
+ * pointer with g_free().
*
* Since: 3.2
**/
-const gchar *
+gchar *
e_categories_editor_get_categories (ECategoriesEditor *editor)
{
ECategoriesSelector *categories_list;
GType e_categories_editor_get_type (void);
GtkWidget * e_categories_editor_new (void);
-const gchar * e_categories_editor_get_categories
+gchar * e_categories_editor_get_categories
(ECategoriesEditor *editor);
void e_categories_editor_set_categories
(ECategoriesEditor *editor,
/**
* e_categories_selector_get_checked:
*
+ * Free returned pointer with g_free().
+ *
* Since: 3.2
**/
-const gchar *
+gchar *
e_categories_selector_get_checked (ECategoriesSelector *selector)
{
- GString *str = g_string_new ("");
+ GString *str;
GList *list, *category;
g_return_val_if_fail (E_IS_CATEGORIES_SELECTOR (selector), NULL);
+ str = g_string_new ("");
list = g_hash_table_get_values (selector->priv->selected_categories);
/* to get them always in the same order */
/**
* e_categories_selector_get_selected:
*
+ * Free returned pointer with g_free().
+ *
* Since: 3.2
**/
-const gchar *
+gchar *
e_categories_selector_get_selected (ECategoriesSelector *selector)
{
GtkTreeModel *model;
GType e_categories_selector_get_type (void);
GtkWidget * e_categories_selector_new (void);
-const gchar * e_categories_selector_get_checked
+gchar * e_categories_selector_get_checked
(ECategoriesSelector *selector);
void e_categories_selector_set_checked
(ECategoriesSelector *selector,
gboolean checkable);
void e_categories_selector_delete_selection
(ECategoriesSelector *selector);
-const gchar * e_categories_selector_get_selected
+gchar * e_categories_selector_get_selected
(ECategoriesSelector *selector);
G_END_DECLS