=== modified file 'src/index.cpp'
--- src/index.cpp	2011-02-15 09:48:00 +0000
+++ src/index.cpp	2011-02-21 13:53:37 +0000
@@ -40,14 +40,14 @@
 static const char * sortCriteriaNames[] = {
     "Date", "Year", "Event", "Site", "Round",
     "White", "Black", "Eco", "Result", "Length",
-    "Rating", "Country", "Month", "Deleted", "Eventdate", NULL
+    "Rating", "Country", "Month", "Deleted", "Eventdate", "Variations", "Comments", NULL
 };
 
 enum {
     SORT_date, SORT_year, SORT_event, SORT_site, SORT_round,
     SORT_white, SORT_black, SORT_eco, SORT_result, SORT_moveCount,
     SORT_avgElo, SORT_country, SORT_month,
-    SORT_deleted, SORT_eventdate, SORT_sentinel
+    SORT_deleted, SORT_eventdate, SORT_variations, SORT_comments, SORT_sentinel
 };
 
 
@@ -760,6 +760,14 @@
             }
             break;
 
+        case SORT_variations:
+            res = (int)ie->GetVariationCount() - (int)GetVariationCount();
+            break;
+
+        case SORT_comments:
+            res = (int)ie->GetCommentCount() - (int)GetCommentCount();
+            break;
+
         default:    // Should never happen:
             ASSERT(0);
             return 0;

=== modified file 'tcl/file/maint.tcl'
--- tcl/file/maint.tcl	2011-02-15 09:48:00 +0000
+++ tcl/file/maint.tcl	2011-02-21 13:53:37 +0000
@@ -1240,7 +1240,7 @@
   pack $w.f.tadd -side top
   pack [ttk::frame $w.f.add] -side top -fill x
   foreach b {Date Year Month Event Site Country Round Result Length
-    White Black Rating ECO Deleted EventDate} {
+    White Black Rating ECO Deleted EventDate Variations Comments} {
     set n [string tolower $b]
     ttk::button $w.f.add.$n -textvar ::tr($b) -command "addSortCriteria $b"
   }
@@ -1259,6 +1259,8 @@
   grid $w.f.add.eco -row 4 -column 0 -sticky we
   grid $w.f.add.deleted -row 4 -column 1 -sticky we
   grid $w.f.add.eventdate -row 4 -column 2 -sticky we
+  grid $w.f.add.variations -row 5 -column 0 -sticky we
+  grid $w.f.add.comments -row 5 -column 1 -sticky we
   
   for {set i 0} {$i < 3} {incr i} {
     grid columnconfigure $w.f.add $i -weight 1

