}
gtk_widget_show(filtering.window);
+ gtk_window_set_modal(GTK_WINDOW(filtering.window), TRUE);
start_address_completion(NULL);
}
static void prefs_filtering_size_allocate_cb(GtkWidget *widget,
GtkAllocation *allocation)
{
- g_return_if_fail(allocation != NULL);
+ cm_return_if_fail(allocation != NULL);
prefs_common.filteringwin_width = allocation->width;
prefs_common.filteringwin_height = allocation->height;
(filtering.cond_list_view)));
gtk_list_store_clear(store);
gtk_widget_hide(filtering.window);
+ gtk_window_set_modal(GTK_WINDOW(filtering.window), FALSE);
inc_unlock();
}
accounts = account_get_list();
- g_return_if_fail(accounts != NULL);
+ cm_return_if_fail(accounts != NULL);
COMBOBOX_ADD(filtering.account_combobox_list, Q_("Filtering Account Menu|All"), 0);
+ COMBOBOX_ADD(filtering.account_combobox_list, NULL, 0);
for (; accounts != NULL; accounts = accounts->next) {
PrefsAccount *ac = (PrefsAccount *)accounts->data;
window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "prefs_filtering");
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
- gtk_window_set_modal (GTK_WINDOW (window), TRUE);
gtk_window_set_resizable(GTK_WINDOW (window), TRUE);
vbox = gtk_vbox_new (FALSE, 6);
gint oldpathlen;
GSList * action_cur;
GSList * cur;
-
+ const gchar *separator=G_DIR_SEPARATOR_S;
+ gboolean matched = FALSE;
+#ifdef G_OS_WIN32
+again:
+#endif
oldpathlen = strlen(old_path);
- old_path_with_sep = g_strconcat(old_path,G_DIR_SEPARATOR_S,NULL);
+ old_path_with_sep = g_strconcat(old_path,separator,NULL);
for (cur = filters; cur != NULL; cur = cur->next) {
FilteringProp *filtering = (FilteringProp *)cur->data;
while (*base == G_DIR_SEPARATOR) base++;
if (*base == '\0')
dest_path = g_strconcat(prefix,
- G_DIR_SEPARATOR_S,
+ separator,
new_path, NULL);
else
dest_path = g_strconcat(prefix,
- G_DIR_SEPARATOR_S,
+ separator,
new_path,
- G_DIR_SEPARATOR_S,
+ separator,
base, NULL);
g_free(prefix);
g_free(action->destination);
action->destination = dest_path;
+ matched = TRUE;
} 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,
+ separator,
suffix, NULL);
g_free(action->destination);
action->destination = dest_path;
+ matched = TRUE;
}
}
} else {
dest_path = g_strdup(new_path);
g_free(action->destination);
action->destination = dest_path;
+ matched = TRUE;
}
}
}
}
+
+ g_free(old_path_with_sep);
+#ifdef G_OS_WIN32
+ if (!strcmp(separator, G_DIR_SEPARATOR_S) && !matched) {
+ separator = "/";
+ goto again;
+ }
+#endif
}
static gboolean prefs_filtering_rename_path_func(GNode *node, gpointer data)
old_path = paths[0];
new_path = paths[1];
- g_return_val_if_fail(old_path != NULL, FALSE);
- g_return_val_if_fail(new_path != NULL, FALSE);
- g_return_val_if_fail(node != NULL, FALSE);
+ cm_return_val_if_fail(old_path != NULL, FALSE);
+ cm_return_val_if_fail(new_path != NULL, FALSE);
+ cm_return_val_if_fail(node != NULL, FALSE);
item = node->data;
if (!item || !item->prefs)
old_tag = tags[0];
new_tag = tags[1];
- g_return_val_if_fail(old_tag != NULL, FALSE);
- g_return_val_if_fail(new_tag != NULL, FALSE);
- g_return_val_if_fail(node != NULL, FALSE);
+ cm_return_val_if_fail(old_tag != NULL, FALSE);
+ cm_return_val_if_fail(new_tag != NULL, FALSE);
+ cm_return_val_if_fail(node != NULL, FALSE);
item = node->data;
if (!item || !item->prefs)
FolderItem *item;
GSList ** p_filters;
- g_return_val_if_fail(path != NULL, FALSE);
- g_return_val_if_fail(node != NULL, FALSE);
+ cm_return_val_if_fail(path != NULL, FALSE);
+ cm_return_val_if_fail(node != NULL, FALSE);
item = node->data;
if (!item || !item->prefs)
static gint prefs_filtering_list_view_set_row(gint row, FilteringProp * prop)
{
GtkTreeView *list_view = GTK_TREE_VIEW(filtering.cond_list_view);
- gchar *str;
+ gchar *str = NULL;
GtkListStore *list_store;
gchar *name = NULL;
gint account_id = 0;
gchar *account_name = (gchar *)Q_("Filtering Account Menu|All");
gboolean enabled = TRUE;
- str = filteringprop_to_string(prop);
+ if (prop)
+ str = filteringprop_to_string(prop);
if (str == NULL)
return -1;