Fake groups can't be modified.
gchar *
empathy_contact_list_store_get_parent_group (GtkTreeModel *model,
GtkTreePath *path,
- gboolean *path_is_group)
+ gboolean *path_is_group,
+ gboolean *is_fake_group)
{
GtkTreeIter parent_iter, iter;
gchar *name = NULL;
gboolean is_group;
+ gboolean fake;
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
gtk_tree_model_get (model, &iter,
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
EMPATHY_CONTACT_LIST_STORE_COL_NAME, &name,
+ EMPATHY_CONTACT_LIST_STORE_COL_IS_FAKE_GROUP, &fake,
-1);
if (!is_group) {
g_free (name);
*path_is_group = TRUE;
}
+ if (is_fake_group != NULL)
+ *is_fake_group = fake;
+
return name;
}
gpointer data);
gchar * empathy_contact_list_store_get_parent_group (GtkTreeModel *model,
GtkTreePath *path,
- gboolean *path_is_group);
+ gboolean *path_is_group,
+ gboolean *is_fake_group);
gboolean empathy_contact_list_store_search_equal_func (GtkTreeModel *model,
gint column,
const gchar *key,
gchar *new_group = NULL;
gchar *old_group = NULL;
gboolean success = TRUE;
+ gboolean is_fake_group;
priv = GET_PRIV (view);
sel_data = (const gchar *) gtk_selection_data_get_data (selection);
new_group = empathy_contact_list_store_get_parent_group (model,
- path, NULL);
+ path, NULL, &is_fake_group);
+
+ if (is_fake_group)
+ /* Fake groups can't be modified */
+ return FALSE;
/* Get source group information. */
if (priv->drag_row) {
source_path = gtk_tree_row_reference_get_path (priv->drag_row);
if (source_path) {
old_group = empathy_contact_list_store_get_parent_group (
- model, source_path, NULL);
+ model, source_path, NULL, NULL);
gtk_tree_path_free (source_path);
}
}