Revision 848

libsylph/procmsg.h (revision 848)
88 88
#define MSG_IMAP		(1U << 19)
89 89
#define MSG_NEWS		(1U << 20)
90 90
#define MSG_SIGNED		(1U << 21)
91
#define MSG_FLAG_CHANGED	(1U << 27)
91 92
#define MSG_CACHED		(1U << 28)
92 93
#define MSG_MIME		(1U << 29)
93 94
#define MSG_INVALID		(1U << 30)
libsylph/virtual.c (revision 848)
144 144
	GSList *cur;
145 145
	FilterInfo fltinfo;
146 146
	gboolean full_headers;
147
	gint count = 1, total;
148
	GTimeVal tv_prev, tv_cur;
147 149

  
148 150
	g_return_val_if_fail(rule != NULL, NULL);
149 151
	g_return_val_if_fail(item != NULL, NULL);
152
	g_return_val_if_fail(item->path != NULL, NULL);
150 153

  
151 154
	/* prevent circular reference */
152 155
	if (item->stype == F_VIRTUAL)
153 156
		return NULL;
154 157

  
158
	g_get_current_time(&tv_prev);
159
	status_print(_("Searching %s ..."), item->path);
160

  
155 161
	mlist = folder_item_get_msg_list(item, TRUE);
162
	total = g_slist_length(mlist);
156 163

  
157 164
	memset(&fltinfo, 0, sizeof(FilterInfo));
158 165

  
159
	debug_print("start query search: %s\n", item->path ? item->path : "");
166
	debug_print("start query search: %s\n", item->path);
160 167

  
161 168
	full_headers = filter_rule_requires_full_headers(rule);
162 169

  
......
164 171
		MsgInfo *msginfo = (MsgInfo *)cur->data;
165 172
		GSList *hlist;
166 173

  
174
		g_get_current_time(&tv_cur);
175
		if (tv_cur.tv_sec > tv_prev.tv_sec ||
176
		    tv_cur.tv_usec - tv_prev.tv_usec >
177
		    PROGRESS_UPDATE_INTERVAL * 1000) {
178
			status_print(_("Searching %s (%d / %d)..."),
179
				     item->path, count, total);
180
			tv_prev = tv_cur;
181
		}
182
		++count;
183

  
167 184
		fltinfo.flags = msginfo->flags;
168 185
		if (full_headers) {
169 186
			gchar *file;
libsylph/filter.c (revision 848)
543 543
		const gchar *type = NULL;
544 544
		const gchar *name = NULL;
545 545
		const gchar *value = NULL;
546
		gboolean case_sens = FALSE;
546 547
		FilterCond *cond;
547 548
		FilterCondType cond_type = FLT_COND_HEADER;
548 549
		FilterMatchType match_type = FLT_CONTAIN;
......
555 556
			XMLAttr *attr = (XMLAttr *)list->data;
556 557

  
557 558
			if (!attr || !attr->name || !attr->value) continue;
558
			if (!strcmp(attr->name, "type"))
559

  
560
			STR_SWITCH(attr->name)
561
			STR_CASE_BEGIN("type")
559 562
				type = attr->value;
560
			else if (!strcmp(attr->name, "name"))
563
			STR_CASE("name")
561 564
				name = attr->value;
562
			else if (!strcmp(attr->name, "recursive")) {
565
			STR_CASE("case")
566
				case_sens = TRUE;
567
			STR_CASE("recursive")
563 568
				if (!strcmp(attr->value, "true"))
564 569
					recursive = TRUE;
565 570
				else
566 571
					recursive = FALSE;
567
			}
572
			STR_CASE_END
568 573
		}
569 574

  
570 575
		if (type) {
571 576
			filter_rule_match_type_str_to_enum
572 577
				(type, &match_type, &match_flag);
573 578
		}
579
		if (case_sens)
580
			match_flag |= FLT_CASE_SENS;
574 581
		value = xmlnode->element;
575 582

  
576 583
		STR_SWITCH(xmlnode->tag->tag)
......
799 806
				NODE_NEW("match-header", cond->str_value);
800 807
				ADD_ATTR("type", match_type);
801 808
				ADD_ATTR("name", cond->header_name);
809
				if (FLT_IS_CASE_SENS(cond->match_flag))
810
					ADD_ATTR("case", "true");
802 811
				break;
803 812
			case FLT_COND_ANY_HEADER:
804 813
				NODE_NEW("match-any-header", cond->str_value);
805 814
				ADD_ATTR("type", match_type);
815
				if (FLT_IS_CASE_SENS(cond->match_flag))
816
					ADD_ATTR("case", "true");
806 817
				break;
807 818
			case FLT_COND_TO_OR_CC:
808 819
				NODE_NEW("match-to-or-cc", cond->str_value);
809 820
				ADD_ATTR("type", match_type);
821
				if (FLT_IS_CASE_SENS(cond->match_flag))
822
					ADD_ATTR("case", "true");
810 823
				break;
811 824
			case FLT_COND_BODY:
812 825
				NODE_NEW("match-body-text", cond->str_value);
813 826
				ADD_ATTR("type", match_type);
827
				if (FLT_IS_CASE_SENS(cond->match_flag))
828
					ADD_ATTR("case", "true");
814 829
				break;
815 830
			case FLT_COND_CMD_TEST:
816 831
				NODE_NEW("command-test", cond->str_value);
src/compose.c (revision 848)
768 768

  
769 769
	MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
770 770
	MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED);
771
	MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
771 772
	msginfo->folder->mark_dirty = TRUE;
772 773
	if (MSG_IS_IMAP(msginfo->flags))
773 774
		imap_msg_set_perm_flags(msginfo, MSG_REPLIED);
......
859 860
		msginfo = (MsgInfo *)cur->data;
860 861
		MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_REPLIED);
861 862
		MSG_SET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
863
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
862 864
		msginfo->folder->mark_dirty = TRUE;
863 865
	}
864 866
	msginfo = (MsgInfo *)mlist->data;
src/summary_search.c (revision 848)
60 60
#include "manage_window.h"
61 61
#include "alertpanel.h"
62 62
#include "foldersel.h"
63
#include "statusbar.h"
63 64
#include "procmsg.h"
64 65
#include "procheader.h"
65 66
#include "folder.h"
......
176 177
	else
177 178
		gtk_widget_hide(search_window.window);
178 179

  
179
	if (item) {
180
	if (item && item->stype != F_VIRTUAL) {
180 181
		id = folder_item_get_identifier(item);
181 182
		gtk_entry_set_text(GTK_ENTRY(search_window.folder_entry), id);
182 183
		g_free(id);
......
515 516
	gtk_button_set_label(GTK_BUTTON(search_window.search_btn),
516 517
			     GTK_STOCK_FIND);
517 518
	gtk_label_set_text(GTK_LABEL(search_window.status_label), _("Done."));
519
	statusbar_pop_all();
518 520

  
519 521
	if (search_window.cancelled)
520 522
		debug_print("* query search cancelled.\n");
......
533 535
	gint count = 1, total;
534 536
	GTimeVal tv_prev, tv_cur;
535 537

  
536
	if (!item->path)
538
	if (!item->path || item->stype == F_VIRTUAL)
537 539
		return;
538 540

  
539 541
	folder_name = g_path_get_basename(item->path);
......
729 731
	gchar *id;
730 732

  
731 733
	item = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL);
732
	if (!item)
734
	if (!item || item->stype == F_VIRTUAL)
733 735
		return;
734 736

  
735 737
	id = folder_item_get_identifier(item);
......
779 781
	gchar *id;
780 782

  
781 783
	item = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL);
782
	if (!item)
784
	if (!item || item->no_sub || item->stype == F_VIRTUAL)
783 785
		return;
784 786

  
785 787
	id = folder_item_get_identifier(item);
......
929 931

  
930 932
	item = folder_item_new(name, path);
931 933
	item->stype = F_VIRTUAL;
934
	item->no_sub = TRUE;
932 935
	folder_item_append(parent, item);
933 936

  
934 937
	g_free(path);
src/prefs_folder_item.c (revision 848)
253 253
		gtk_widget_set_sensitive(optmenu, FALSE);
254 254
		gtk_widget_set_sensitive(vbox2, FALSE);
255 255
	}
256
	if (dialog->item->stype == F_VIRTUAL)
257
		gtk_widget_set_sensitive(optmenu, FALSE);
256 258

  
257 259
	dialog->name_entry = name_entry;
258 260
	dialog->id_label = id_label;
......
527 529
	type = (SpecialFolderItemType)
528 530
		g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID);
529 531

  
530
	if (item->stype != type) {
532
	if (item->stype != type && item->stype != F_VIRTUAL) {
531 533
		switch (type) {
532 534
		case F_NORMAL:
533 535
			break;
src/summaryview.c (revision 848)
2271 2271
		    MSG_IS_UNREAD(msginfo->flags)) {
2272 2272
			MSG_UNSET_PERM_FLAGS
2273 2273
				(msginfo->flags, MSG_NEW | MSG_UNREAD);
2274
			MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2274 2275
			summaryview->folder_item->mark_dirty = TRUE;
2275 2276
			if (MSG_IS_IMAP(msginfo->flags))
2276 2277
				imap_msg_unset_perm_flags
......
2450 2451
	GET_MSG_INFO(msginfo, iter);
2451 2452

  
2452 2453
	msginfo->to_folder = NULL;
2453
	if (MSG_IS_DELETED(msginfo->flags))
2454
	if (MSG_IS_DELETED(msginfo->flags)) {
2454 2455
		summaryview->deleted--;
2456
		MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2457
	}
2455 2458
	if (MSG_IS_MOVE(msginfo->flags))
2456 2459
		summaryview->moved--;
2457 2460
	if (MSG_IS_COPY(msginfo->flags))
2458 2461
		summaryview->copied--;
2459
	MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2460 2462
	MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MOVE | MSG_COPY);
2461 2463
	MSG_SET_PERM_FLAGS(msginfo->flags, MSG_MARKED);
2464
	MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2462 2465
	summaryview->folder_item->mark_dirty = TRUE;
2463 2466
	summary_set_row(summaryview, iter, msginfo);
2464 2467

  
......
2508 2511
		summaryview->folder_item->unread--;
2509 2512
	if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
2510 2513
		MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_NEW | MSG_UNREAD);
2514
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2511 2515
		summaryview->folder_item->mark_dirty = TRUE;
2512 2516
		summary_set_row(summaryview, iter, msginfo);
2513 2517
		debug_print(_("Message %d is marked as being read\n"),
......
2597 2601
		debug_print(_("Message %d is marked as unread\n"),
2598 2602
			    msginfo->msgnum);
2599 2603
	}
2604
	MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2600 2605
	summary_set_row(summaryview, iter, msginfo);
2601 2606
}
2602 2607

  
......
2646 2651
		summaryview->copied--;
2647 2652
	MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MOVE | MSG_COPY);
2648 2653
	MSG_SET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2654
	MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2649 2655
	summaryview->deleted++;
2650 2656
	summaryview->folder_item->mark_dirty = TRUE;
2651 2657

  
......
2771 2777
		summaryview->copied--;
2772 2778
	MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_MARKED | MSG_DELETED);
2773 2779
	MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MOVE | MSG_COPY);
2780
	MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2774 2781
	summaryview->folder_item->mark_dirty = TRUE;
2775 2782
	summary_set_row(summaryview, iter, msginfo);
2776 2783

  
......
2818 2825
	GET_MSG_INFO(msginfo, iter);
2819 2826

  
2820 2827
	msginfo->to_folder = to_folder;
2821
	if (MSG_IS_DELETED(msginfo->flags))
2828
	if (MSG_IS_DELETED(msginfo->flags)) {
2822 2829
		summaryview->deleted--;
2823
	MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2830
		MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2831
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2832
	}
2824 2833
	MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_COPY);
2825 2834
	if (!MSG_IS_MOVE(msginfo->flags)) {
2826 2835
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MOVE);
......
2889 2898
	GET_MSG_INFO(msginfo, iter);
2890 2899

  
2891 2900
	msginfo->to_folder = to_folder;
2892
	if (MSG_IS_DELETED(msginfo->flags))
2901
	if (MSG_IS_DELETED(msginfo->flags)) {
2893 2902
		summaryview->deleted--;
2894
	MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2903
		MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_DELETED);
2904
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
2905
	}
2895 2906
	MSG_UNSET_TMP_FLAGS(msginfo->flags, MSG_MOVE);
2896 2907
	if (!MSG_IS_COPY(msginfo->flags)) {
2897 2908
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_COPY);
......
4254 4265

  
4255 4266
		MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_CLABEL_FLAG_MASK);
4256 4267
		MSG_SET_COLORLABEL_VALUE(msginfo->flags, labelcolor);
4268
		MSG_SET_TMP_FLAGS(msginfo->flags, MSG_FLAG_CHANGED);
4257 4269
		summary_set_row(summaryview, &iter, msginfo);
4258 4270
	}
4259 4271

  
src/folderview.c (revision 848)
1601 1601
		}
1602 1602
		if (item->stype == F_VIRTUAL) {
1603 1603
			rename_folder = delete_folder = TRUE;
1604
			search_folder = FALSE;
1604 1605
		}
1605 1606
		if (FOLDER_TYPE(folder) == F_IMAP ||
1606 1607
		    FOLDER_TYPE(folder) == F_NEWS) {
ChangeLog.ja (revision 848)
1
2005-12-21
2

  
3
	* libsylph/virtual.c
4
	  libsylph/filter.c
5
	  src/summary_search.c
6
	  src/prefs_folder_item.c
7
	  src/folderview.c: ?????ե??????򳫤????˿?Ľ??ɽ???????褦?ˤ?????
8
	  ?????Õ¥??????θ??÷¤¬¤Ç¤??ʤ??褦?ˤ?????
9
	* libsylph/procmsg.h
10
	  src/compose.c
11
	  src/summaryview.c: MSG_FLAG_CHANGED ?ե饰???ɲá?
12

  
1 13
2005-12-20
2 14

  
3 15
	* src/compose.c: compose_is_itemized(): (1), (2), 3. ... ?Τ褦??????
ChangeLog (revision 848)
1
2005-12-21
2

  
3
	* libsylph/virtual.c
4
	  libsylph/filter.c
5
	  src/summary_search.c
6
	  src/prefs_folder_item.c
7
	  src/folderview.c: show progress when opening search folder. Don't
8
	  allow the search of search folder.
9
	* libsylph/procmsg.h
10
	  src/compose.c
11
	  src/summaryview.c: added MSG_FLAG_CHANGED flag.
12

  
1 13
2005-12-20
2 14

  
3 15
	* src/compose.c: compose_is_itemized(): also check for enumerated

Also available in: Unified diff