diff -r -C3 gthumb-2.6.9/src/catalog-png-exporter.c gthumb-2.6.9-changed/src/catalog-png-exporter.c
*** gthumb-2.6.9/src/catalog-png-exporter.c	2006-02-17 09:49:30.000000000 +0100
--- gthumb-2.6.9-changed/src/catalog-png-exporter.c	2006-09-09 12:41:30.000000000 +0200
***************
*** 1213,1218 ****
--- 1213,1230 ----
  
  
  static gint
+ comp_func_comment (gconstpointer a, gconstpointer b)
+ {
+ 	ImageData *data_a, *data_b;
+ 
+ 	data_a = IMAGE_DATA (a);
+ 	data_b = IMAGE_DATA (b);
+ 
+ 	return strcasecmp (data_a->comment, data_b->comment);
+ }
+ 
+ 
+ static gint
  comp_func_time (gconstpointer a, gconstpointer b)
  {
  	ImageData *data_a, *data_b;
***************
*** 1271,1276 ****
--- 1283,1291 ----
  	case GTH_SORT_METHOD_BY_PATH:
  		func = comp_func_path;
  		break;
+ 	case GTH_SORT_METHOD_BY_COMMENT:
+ 		func = comp_func_comment;
+ 		break;
  	case GTH_SORT_METHOD_NONE:
  		func = comp_func_none;
  		break;
diff -r -C3 gthumb-2.6.9/src/catalog-web-exporter.c gthumb-2.6.9-changed/src/catalog-web-exporter.c
*** gthumb-2.6.9/src/catalog-web-exporter.c	2006-02-17 09:49:30.000000000 +0100
--- gthumb-2.6.9-changed/src/catalog-web-exporter.c	2006-09-09 12:38:09.000000000 +0200
***************
*** 566,571 ****
--- 566,583 ----
  
  
  static int
+ comp_func_comment (gconstpointer a, gconstpointer b)
+ {
+ 	ImageData *data_a, *data_b;
+ 
+ 	data_a = IMAGE_DATA (a);
+ 	data_b = IMAGE_DATA (b);
+ 
+ 	return strcasecmp (data_a->comment, data_b->comment);
+ }
+ 
+ 
+ static int
  comp_func_time (gconstpointer a, gconstpointer b)
  {
  	ImageData *data_a, *data_b;
***************
*** 624,629 ****
--- 636,644 ----
  	case GTH_SORT_METHOD_BY_PATH:
  		func = comp_func_path;
  		break;
+ 	case GTH_SORT_METHOD_BY_COMMENT:
+ 		func = comp_func_comment;
+ 		break;
  	case GTH_SORT_METHOD_NONE:
  		func = comp_func_none;
  		break;
diff -r -C3 gthumb-2.6.9/src/dlg-png-exporter.c gthumb-2.6.9-changed/src/dlg-png-exporter.c
*** gthumb-2.6.9/src/dlg-png-exporter.c	2006-02-17 09:49:30.000000000 +0100
--- gthumb-2.6.9-changed/src/dlg-png-exporter.c	2006-09-09 12:25:40.000000000 +0200
***************
*** 622,627 ****
--- 622,628 ----
  	case GTH_SORT_METHOD_BY_PATH: return 1;
  	case GTH_SORT_METHOD_BY_SIZE: return 2;
  	case GTH_SORT_METHOD_BY_TIME: return 3;
+ 	case GTH_SORT_METHOD_BY_COMMENT: return 4;
  	default: return -1;
  	}
  
***************
*** 637,642 ****
--- 638,644 ----
  	case 1: return GTH_SORT_METHOD_BY_PATH;
  	case 2: return GTH_SORT_METHOD_BY_SIZE;
  	case 3: return GTH_SORT_METHOD_BY_TIME;
+ 	case 4: return GTH_SORT_METHOD_BY_COMMENT;
  	}
  
  	return GTH_SORT_METHOD_NONE;
diff -r -C3 gthumb-2.6.9/src/dlg-web-exporter.c gthumb-2.6.9-changed/src/dlg-web-exporter.c
*** gthumb-2.6.9/src/dlg-web-exporter.c	2006-02-17 09:49:30.000000000 +0100
--- gthumb-2.6.9-changed/src/dlg-web-exporter.c	2006-09-09 12:13:08.000000000 +0200
***************
*** 50,56 ****
  static GthSortMethod idx_to_sort_method[] = { GTH_SORT_METHOD_BY_NAME, 
  					      GTH_SORT_METHOD_BY_PATH, 
  					      GTH_SORT_METHOD_BY_SIZE, 
! 					      GTH_SORT_METHOD_BY_TIME };
  static int           idx_to_resize_width[] = { 320, 640, 800, 1024, 1280 };
  static int           idx_to_resize_height[] = { 200, 480, 600, 768, 960 };
  
--- 50,57 ----
  static GthSortMethod idx_to_sort_method[] = { GTH_SORT_METHOD_BY_NAME, 
  					      GTH_SORT_METHOD_BY_PATH, 
  					      GTH_SORT_METHOD_BY_SIZE, 
! 					      GTH_SORT_METHOD_BY_TIME, 
! 					      GTH_SORT_METHOD_BY_COMMENT };
  static int           idx_to_resize_width[] = { 320, 640, 800, 1024, 1280 };
  static int           idx_to_resize_height[] = { 200, 480, 600, 768, 960 };
  
diff -r -C3 gthumb-2.6.9/src/gthumb-window.c gthumb-2.6.9-changed/src/gthumb-window.c
*** gthumb-2.6.9/src/gthumb-window.c	2006-02-17 09:49:30.000000000 +0100
--- gthumb-2.6.9-changed/src/gthumb-window.c	2006-09-09 14:20:07.000000000 +0200
***************
*** 4179,4184 ****
--- 4179,4185 ----
  	case GTH_SORT_METHOD_BY_PATH: prop = "SortByPath"; break;
  	case GTH_SORT_METHOD_BY_SIZE: prop = "SortBySize"; break;
  	case GTH_SORT_METHOD_BY_TIME: prop = "SortByTime"; break;
+ 	case GTH_SORT_METHOD_BY_COMMENT: prop = "SortByComment"; break;
  	default: prop = "X"; break;
  	}
  	set_action_active (window, prop, TRUE);
diff -r -C3 gthumb-2.6.9/src/ui.h gthumb-2.6.9-changed/src/ui.h
*** gthumb-2.6.9/src/ui.h	2006-02-17 09:49:30.000000000 +0100
--- gthumb-2.6.9-changed/src/ui.h	2006-09-09 14:19:54.000000000 +0200
***************
*** 654,660 ****
  	  N_("Sort images by file size"), GTH_SORT_METHOD_BY_SIZE },
  	{ "SortByTime", NULL,
  	  N_("by _Time"), NULL,
! 	  N_("Sort images by modification time"), GTH_SORT_METHOD_BY_TIME }
  };
  static guint n_sort_by_entries = G_N_ELEMENTS (sort_by_entries);
  
--- 654,663 ----
  	  N_("Sort images by file size"), GTH_SORT_METHOD_BY_SIZE },
  	{ "SortByTime", NULL,
  	  N_("by _Time"), NULL,
! 	  N_("Sort images by modification time"), GTH_SORT_METHOD_BY_TIME },
! 	{ "SortByComment", NULL,
! 	  N_("by _Comment"), NULL,
! 	  N_("Sort images by comment"), GTH_SORT_METHOD_BY_COMMENT }
  };
  static guint n_sort_by_entries = G_N_ELEMENTS (sort_by_entries);
  
***************
*** 745,750 ****
--- 748,754 ----
  "        <menuitem action='SortByPath'/>"
  "        <menuitem action='SortBySize'/>"
  "        <menuitem action='SortByTime'/>"
+ "        <menuitem action='SortByComment'/>"
  "        <separator/>"
  "        <menuitem action='SortReversed'/>"
  "      </menu>"
diff -r -C3 gthumb-2.6.9/libgthumb/gth-file-view-list.c gthumb-2.6.9-changed/libgthumb/gth-file-view-list.c
*** gthumb-2.6.9/libgthumb/gth-file-view-list.c	2006-02-17 09:49:26.000000000 +0100
--- gthumb-2.6.9-changed/libgthumb/gth-file-view-list.c	2006-09-09 13:19:24.000000000 +0200
***************
*** 1039,1044 ****
--- 1039,1045 ----
  	case GTH_SORT_METHOD_BY_PATH: col = COLUMN_PATH; break;
  	case GTH_SORT_METHOD_BY_SIZE: col = COLUMN_SIZE; break;
  	case GTH_SORT_METHOD_BY_TIME: col = COLUMN_TIME; break;
+ 	case GTH_SORT_METHOD_BY_COMMENT: col = COLUMN_COMMENT; break;
  	default: col = -1; break;
  	}
  
***************
*** 1477,1482 ****
--- 1478,1496 ----
  
  
  static int
+ comp_func_comment (gconstpointer  ptr1,
+ 		   gconstpointer  ptr2)
+ {
+ 	const FileData *fd1 = ptr1, *fd2 = ptr2;
+ 
+ 	if ((fd1 == NULL) || (fd2 == NULL))
+ 		return 0;
+ 
+ 	return strcmp (fd1->comment, fd2->comment);
+ }
+ 
+ 
+ static int
  comp_func_none (gconstpointer  ptr1,
  		gconstpointer  ptr2)
  {
***************
*** 1502,1507 ****
--- 1516,1524 ----
  	case GTH_SORT_METHOD_BY_PATH:
  		func = comp_func_path;
  		break;
+ 	case GTH_SORT_METHOD_BY_COMMENT:
+ 		func = comp_func_path;
+ 		break;
  	case GTH_SORT_METHOD_NONE:
  	default:
  		func = comp_func_none;
diff -r -C3 gthumb-2.6.9/libgthumb/gth-file-view-thumbs.c gthumb-2.6.9-changed/libgthumb/gth-file-view-thumbs.c
*** gthumb-2.6.9/libgthumb/gth-file-view-thumbs.c	2006-02-17 09:49:26.000000000 +0100
--- gthumb-2.6.9-changed/libgthumb/gth-file-view-thumbs.c	2006-09-09 13:04:10.000000000 +0200
***************
*** 670,675 ****
--- 670,685 ----
  
  
  static int
+ comp_func_comment (gconstpointer  ptr1,
+ 		   gconstpointer  ptr2)
+ {
+         const GthImageListItem *item1 = ptr1, *item2 = ptr2;
+ 
+ 	return strcmp (item1->comment, item2->comment);
+ }
+ 
+ 
+ static int
  comp_func_none (gconstpointer  ptr1,
  		gconstpointer  ptr2)
  {
***************
*** 695,700 ****
--- 705,713 ----
  	case GTH_SORT_METHOD_BY_PATH:
  		func = comp_func_path;
  		break;
+ 	case GTH_SORT_METHOD_BY_COMMENT:
+ 		func = comp_func_comment;
+ 		break;
  	case GTH_SORT_METHOD_NONE:
  	default:
  		func = comp_func_none;
diff -r -C3 gthumb-2.6.9/libgthumb/preferences.c gthumb-2.6.9-changed/libgthumb/preferences.c
*** gthumb-2.6.9/libgthumb/preferences.c	2006-02-17 09:49:26.000000000 +0100
--- gthumb-2.6.9-changed/libgthumb/preferences.c	2006-09-09 13:06:30.000000000 +0200
***************
*** 90,100 ****
  };
  
  static EnumStringTable arrange_type_table [] = {
! 	{ GTH_SORT_METHOD_BY_NAME, "name" },
! 	{ GTH_SORT_METHOD_NONE,    "none" },
!         { GTH_SORT_METHOD_BY_PATH, "path" },
!         { GTH_SORT_METHOD_BY_SIZE, "size" },
!         { GTH_SORT_METHOD_BY_TIME, "time" },
  	{ 0, NULL }
  };
  
--- 90,101 ----
  };
  
  static EnumStringTable arrange_type_table [] = {
! 	{ GTH_SORT_METHOD_BY_NAME,    "name" },
! 	{ GTH_SORT_METHOD_NONE,       "none" },
!         { GTH_SORT_METHOD_BY_PATH,    "path" },
!         { GTH_SORT_METHOD_BY_SIZE,    "size" },
!         { GTH_SORT_METHOD_BY_TIME,    "time" },
!         { GTH_SORT_METHOD_BY_COMMENT, "comment" },
  	{ 0, NULL }
  };
  
diff -r -C3 gthumb-2.6.9/libgthumb/typedefs.h gthumb-2.6.9-changed/libgthumb/typedefs.h
*** gthumb-2.6.9/libgthumb/typedefs.h	2006-02-17 09:49:26.000000000 +0100
--- gthumb-2.6.9-changed/libgthumb/typedefs.h	2006-09-09 13:05:43.000000000 +0200
***************
*** 125,131 ****
  	GTH_SORT_METHOD_BY_NAME,
  	GTH_SORT_METHOD_BY_PATH,
  	GTH_SORT_METHOD_BY_SIZE,
! 	GTH_SORT_METHOD_BY_TIME
  } GthSortMethod;
  
  
--- 125,132 ----
  	GTH_SORT_METHOD_BY_NAME,
  	GTH_SORT_METHOD_BY_PATH,
  	GTH_SORT_METHOD_BY_SIZE,
! 	GTH_SORT_METHOD_BY_TIME,
! 	GTH_SORT_METHOD_BY_COMMENT
  } GthSortMethod;
  
  
