#include "colorlabel.h"
#include "matcher_parser.h"
+#include "matcher.h"
static struct Filtering {
GtkWidget *window;
ACTION_MARK_AS_UNREAD = 6,
ACTION_FORWARD = 7,
ACTION_FORWARD_AS_ATTACHMENT = 8,
- ACTION_BOUNCE = 9,
+ ACTION_REDIRECT = 9,
ACTION_EXECUTE = 10,
ACTION_COLOR = 11,
ACTION_DELETE_ON_SERVER = 12,
return MATCHACTION_FORWARD;
case ACTION_FORWARD_AS_ATTACHMENT:
return MATCHACTION_FORWARD_AS_ATTACHMENT;
- case ACTION_BOUNCE:
- return MATCHACTION_BOUNCE;
+ case ACTION_REDIRECT:
+ return MATCHACTION_REDIRECT;
case ACTION_EXECUTE:
return MATCHACTION_EXECUTE;
case ACTION_COLOR:
N_("Mark as unread"),
N_("Forward"),
N_("Forward as attachment"),
- N_("Bounce"),
+ N_("Redirect"),
N_("Execute"),
N_("Color"),
N_("Delete on Server")
const gchar *header,
const gchar *key)
{
+ gchar *esckey;
+
if (prefs_rc_is_readonly(FILTERING_RC))
return;
cur_item = item;
- prefs_filtering_set_dialog(header, key);
+ esckey = matcher_escape_str(key);
+ prefs_filtering_set_dialog(header, esckey);
+ g_free(esckey);
gtk_widget_show(filtering.window);
GtkWidget *up_btn;
GtkWidget *down_btn;
- GtkWidget *dummy;
GList *combo_items;
gint i;
gchar *title[1];
- debug_print(_("Creating filtering setting window...\n"));
+ debug_print("Creating filtering setting window...\n");
window = gtk_window_new (GTK_WINDOW_DIALOG);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gchar *prefix;
gchar *suffix;
gchar *dest_path;
+ gchar *old_path_with_sep;
gint destlen;
gint prefixlen;
gint oldpathlen;
g_return_if_fail(new_path != NULL);
oldpathlen = strlen(old_path);
+ old_path_with_sep = g_strconcat(old_path,G_DIR_SEPARATOR_S,NULL);
for (cur = global_processing; cur != NULL; cur = cur->next) {
FilteringProp *filtering = (FilteringProp *)cur->data;
g_free(prefix);
g_free(action->destination);
action->destination = dest_path;
+ } else { /* for non-leaf folders */
+ /* compare with trailing slash */
+ if(!strncmp(old_path_with_sep, action->destination, oldpathlen+1)) {
+
+ suffix = action->destination + oldpathlen + 1;
+ dest_path = g_strconcat(new_path,
+ G_DIR_SEPARATOR_S,
+ suffix, NULL);
+ g_free(action->destination);
+ action->destination = dest_path;
+ }
}
}
}
FilteringProp *prop;
GSList * cur;
gchar * filtering_str;
- gchar * tmp;
GSList * prefs_filtering;
if (cur_item == NULL)
cond_str = gtk_entry_get_text(GTK_ENTRY(filtering.cond_entry));
if (*cond_str != '\0') {
- gchar * tmp;
-
- /* tmp = cond_str; */
matchers = matcher_parser_get_cond(cond_str);
if (matchers == NULL)
alertpanel_error(_("Match string is not valid."));
gchar * cond_str;
FilteringProp * prop;
FilteringAction * action;
- gchar * tmp;
gint list_id;
gint action_id;
gint action_type;
gint account_id;
gchar * destination;
- gint labelcolor;
+ gint labelcolor = 0;
cond_str = gtk_entry_get_text(GTK_ENTRY(filtering.cond_entry));
if (*cond_str == '\0') {
case ACTION_COPY:
case ACTION_FORWARD:
case ACTION_FORWARD_AS_ATTACHMENT:
- case ACTION_BOUNCE:
+ case ACTION_REDIRECT:
case ACTION_EXECUTE:
destination = gtk_entry_get_text(GTK_ENTRY(filtering.dest_entry));
if (*destination == '\0') {
gtk_list_select_item(GTK_LIST(filtering.account_list),
list_id);
break;
- case MATCHACTION_BOUNCE:
+ case MATCHACTION_REDIRECT:
list_id = get_list_id_from_account_id(action->account_id);
gtk_list_select_item(GTK_LIST(filtering.action_list),
- ACTION_BOUNCE);
+ ACTION_REDIRECT);
gtk_list_select_item(GTK_LIST(filtering.account_list),
list_id);
break;
GdkEvent *event)
{
FilteringProp * prop;
- gchar * tmp;
gchar * filtering_str;
if (row == 0) {
gtk_widget_hide(filtering.color_optmenu);
gtk_widget_hide(filtering.color_label);
break;
- case ACTION_BOUNCE:
+ case ACTION_REDIRECT:
gtk_widget_set_sensitive(filtering.account_combo, TRUE);
gtk_widget_show(filtering.dest_entry);
gtk_widget_set_sensitive(filtering.dest_entry, TRUE);