aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/groupwise-features/ChangeLog6
-rw-r--r--plugins/groupwise-features/share-folder.c54
2 files changed, 46 insertions, 14 deletions
diff --git a/plugins/groupwise-features/ChangeLog b/plugins/groupwise-features/ChangeLog
index c192e841f7..25de91c0ac 100644
--- a/plugins/groupwise-features/ChangeLog
+++ b/plugins/groupwise-features/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-22 Vivek Jain <jvivek@novell.com>
+
+ * share-folder.c : Put back the fix I committed on
+ 2005-03-31, not sure when it got reverted.
+ **Fixes #311217
+
2005-07-20 Shreyas Srinivasan <sshreyas@novell.com>
* proxy.c: Fix #310710. Make code little smart. Stop
diff --git a/plugins/groupwise-features/share-folder.c b/plugins/groupwise-features/share-folder.c
index 1d43b2b001..b76ed73c2d 100644
--- a/plugins/groupwise-features/share-folder.c
+++ b/plugins/groupwise-features/share-folder.c
@@ -561,7 +561,6 @@ user_selected(GtkTreeSelection *selection, ShareFolder *sf)
}
}
-
static void
add_right_clicked (GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf )
{
@@ -569,14 +568,19 @@ add_right_clicked (GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf )
SharedUser *usr = NULL;
EShUsers *user = NULL;
char *email = NULL;
- GtkTreeSelection *selection = NULL;
- selection = gtk_tree_view_get_selection(GTK_TREE_VIEW (sf->user_list));
- gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
- if (! gtk_tree_selection_get_selected (selection, &(sf->model), &(sf->iter)));
+ GtkTreePath *path = NULL;
+
+ path = gtk_tree_path_new_from_string (arg1);
+ if (!gtk_tree_model_get_iter ((GtkTreeModel *) sf->model, &(sf->iter), path)){
+ gtk_tree_path_free (path);
+ return ;
+ }
gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, 1, &right , -1);
usr = find_node(sf->users_list, email);
- if (!usr)
- return ;
+ if (!usr) {
+ gtk_tree_path_free (path);
+ return;
+ }
if(! usr->flag) /* if user was already existing one change the flag to update*/
usr->flag = usr->flag | 0x2;
user = usr->user_node;
@@ -587,18 +591,29 @@ add_right_clicked (GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf )
user->rights &= 0x6;
gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 1, FALSE, -1);
}
-
+ gtk_tree_path_free (path);
}
- static void
+static void
edit_right_clicked(GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf )
{
gboolean right = FALSE;
SharedUser *usr = NULL;
EShUsers *user = NULL;
char *email = NULL;
+ GtkTreePath *path = NULL;
+
+ path = gtk_tree_path_new_from_string (arg1);
+ if (!gtk_tree_model_get_iter ((GtkTreeModel *) sf->model, &(sf->iter), path)) {
+ gtk_tree_path_free (path);
+ return;
+ }
gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, 2, &right , -1);
usr = find_node(sf->users_list, email);
+ if (!usr) {
+ gtk_tree_path_free (path);
+ return;
+ }
if(! usr->flag) /* if user was already existing one change the flag to update*/
usr->flag = usr->flag | 0x2;
user = usr->user_node;
@@ -610,29 +625,40 @@ edit_right_clicked(GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf )
user->rights &= 0x5;
gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 2, FALSE, -1);
}
-
+ gtk_tree_path_free (path);
}
- static void
+static void
delete_right_clicked(GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf )
{
gboolean right = FALSE;
SharedUser *usr = NULL;
EShUsers *user = NULL;
char *email = NULL;
+ GtkTreePath *path = NULL;
+
+ path = gtk_tree_path_new_from_string (arg1);
+ if (!gtk_tree_model_get_iter ((GtkTreeModel *) sf->model, &(sf->iter), path)) {
+ gtk_tree_path_free (path);
+ return;
+ }
gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, 3, &right , -1);
usr = find_node(sf->users_list, email);
+ if (!usr) {
+ gtk_tree_path_free (path);
+ return;
+ }
if(! usr->flag) /* if user was already existing one change the flag to update*/
usr->flag = usr->flag | 0x2;
user = usr->user_node;
if (!right) {
- user->rights |= 0x4;
- gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 3, TRUE, -1);
+ user->rights |= 0x4;
+ gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 3, TRUE, -1);
} else {
user->rights &= 0x3;
gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 3, FALSE, -1);
}
-
+ gtk_tree_path_free (path);
}
static void