aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/conversations_table.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2007-12-04 23:47:30 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2007-12-04 23:47:30 +0000
commitd3c4d1b221d1db923d57e49bf36134d728d621e0 (patch)
tree1c0a92330639f15ac61c77e2115f9c3371704939 /gtk/conversations_table.c
parentf43601180cf39bcdb635a6deb2e6e7e271bde7a0 (diff)
Do not create an illegal filter when having an empty display filter and
selecting Apply/Prepare "and/or (not) Selected" in Conversations, Endpoints and Service Response Time. svn path=/trunk/; revision=23756
Diffstat (limited to 'gtk/conversations_table.c')
-rw-r--r--gtk/conversations_table.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/gtk/conversations_table.c b/gtk/conversations_table.c
index 493f17d460..efdfca1400 100644
--- a/gtk/conversations_table.c
+++ b/gtk/conversations_table.c
@@ -634,19 +634,31 @@ ct_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint callbac
break;
case 2:
/* and selected */
- g_snprintf(str, 255, "(%s) && (%s)", current_filter, dirstr);
+ if ((!current_filter) || (0 == strlen(current_filter)))
+ g_snprintf(str, 255, "%s", dirstr);
+ else
+ g_snprintf(str, 255, "(%s) && (%s)", current_filter, dirstr);
break;
case 3:
/* or selected */
- g_snprintf(str, 255, "(%s) || (%s)", current_filter, dirstr);
+ if ((!current_filter) || (0 == strlen(current_filter)))
+ g_snprintf(str, 255, "%s", dirstr);
+ else
+ g_snprintf(str, 255, "(%s) || (%s)", current_filter, dirstr);
break;
case 4:
/* and not selected */
- g_snprintf(str, 255, "(%s) && !(%s)", current_filter, dirstr);
+ if ((!current_filter) || (0 == strlen(current_filter)))
+ g_snprintf(str, 255, "!(%s)", dirstr);
+ else
+ g_snprintf(str, 255, "(%s) && !(%s)", current_filter, dirstr);
break;
case 5:
/* or not selected */
- g_snprintf(str, 255, "(%s) || !(%s)", current_filter, dirstr);
+ if ((!current_filter) || (0 == strlen(current_filter)))
+ g_snprintf(str, 255, "!(%s)", dirstr);
+ else
+ g_snprintf(str, 255, "(%s) || !(%s)", current_filter, dirstr);
break;
}