Mailing List Archive

NessusClient/nessus/prefs_dialog prefs_report.c,1.4,1.5
Update of /usr/local/cvs/NessusClient/nessus/prefs_dialog
In directory raccoon.nessus.org:/tmp/cvs-serv71025/nessus/prefs_dialog

Modified Files:
prefs_report.c
Log Message:
Fix a problem with double clicking on an item in the report tree if
NessusClient is compiled with GTK > 2.0.


Index: prefs_report.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/prefs_dialog/prefs_report.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- prefs_report.c 10 Feb 2006 20:04:45 -0000 1.4
+++ prefs_report.c 13 Feb 2006 13:49:15 -0000 1.5
@@ -285,24 +285,37 @@
GtkTreeViewColumn *column, gpointer user_data)
{
GtkTreeModel * model = gtk_tree_view_get_model(treeview);
- GtkTreeIter iter;
+ GtkTreeIter iter, parent;
const char *keys[3];
const char *values[3];
int depth = 0;
+ int has_parent;

- gtk_tree_model_get_iter(model, &iter, path);
+ if (!gtk_tree_model_get_iter(model, &iter, path))
+ {
+ fprintf(stderr, "row_activated: could not set iter from path\n");
+ return;
+ }
do
{
gtk_tree_model_get(model, &iter, COL_NAME, values + depth,
COL_KEY, keys + depth, -1);
+
+ /* the parent iter and the child iter passed to
+ * gtk_tree_model_iter_parent must not be the same (that would work
+ * in GTK 2.0 but not in e.g. 2.6) */
+ has_parent = gtk_tree_model_iter_parent(model, &parent, &iter);
+ iter = parent;
+
depth += 1;
}
- while (depth < 4 && gtk_tree_model_iter_parent(model, &iter, &iter));
-
- if (depth == 4)
- return;
+ while (depth < 3 && has_parent);

- if (depth == 3)
+ /* the user has to click on an item on the deepest level so that all
+ * necessary parameters are defined and the tree must not be deeper
+ * than expected. This means that depth has to be 3 now and the last,
+ * i.e. topmost, node we looked must not have a parent. */
+ if (depth == 3 && !has_parent)
{
struct subset * subset;
struct subset * walk;

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs@list.nessus.org
http://mail.nessus.org/mailman/listinfo/nessus-cvs