Alphabetical sorting now ignores case. Checked items now have grey text instead of...
[easylist] / src / mycheckboxcontainer.cpp
index edcab32..aaa719d 100755 (executable)
@@ -30,9 +30,25 @@ MyCheckBoxContainer * MyCheckBoxContainer::getInstance()
 void MyCheckBoxContainer::add(QString item)\r
 {\r
     QStringList list = item.split("\n");\r
+    QStringList list2;\r
     if(sortAlphabetically)\r
     {\r
-        list.sort();\r
+        int listSize = list.size();\r
+        int pos = 0;\r
+        for(int i = 0; i < listSize; ++i)\r
+        {\r
+            int list2Size = list2.size();\r
+            for(int j = 0; j < list2Size; ++j)\r
+            {\r
+                pos = j;\r
+                if(list[i].toUpper() > list2[j].toUpper())\r
+                {\r
+                    break;\r
+                }\r
+            }\r
+            list2.append(list[i]);\r
+        }\r
+        list = list2;\r
     }\r
     foreach(QString item, list)\r
     {\r
@@ -89,7 +105,7 @@ void MyCheckBoxContainer::sortCheckedToBottom()
                     int pos = 0;\r
                     for(pos = 0; pos < size; ++pos)\r
                     {\r
-                        if(tempListChecked[pos]->text() > item->text())\r
+                        if(tempListChecked[pos]->text().toUpper() > item->text().toUpper())\r
                         {\r
                             break;\r
                         }\r
@@ -109,7 +125,7 @@ void MyCheckBoxContainer::sortCheckedToBottom()
                     int pos = 0;\r
                     for(pos = 0; pos < size; ++pos)\r
                     {\r
-                        if(tempList[pos]->text() > item->text())\r
+                        if(tempList[pos]->text().toUpper() > item->text().toUpper())\r
                         {\r
                             break;\r
                         }\r