Changed changelog.
[easylist] / src / mycheckboxcontainer.cpp
index 915d277..130cd0a 100755 (executable)
@@ -30,25 +30,31 @@ MyCheckBoxContainer * MyCheckBoxContainer::getInstance()
 void MyCheckBoxContainer::add(QString item)\r
 {\r
     QStringList list = item.split("\n");\r
-    qDebug() << "add" << item;\r
     QStringList list2;\r
     if(sortAlphabetically)\r
     {\r
+        list2.append(list.takeFirst());\r
         int listSize = list.size();\r
         int pos = 0;\r
+        bool inserted = false;\r
         for(int i = 0; i < listSize; ++i)\r
         {\r
+            inserted = false;\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
+                if(list[i].toUpper() < list2[j].toUpper())\r
                 {\r
+                    list2.insert(pos, list[i]);\r
+                    inserted = true;\r
                     break;\r
                 }\r
             }\r
-            qDebug() << "append" << list[i];\r
-            list2.append(list[i]);\r
+            if(inserted == false)\r
+            {\r
+                list2.append(list[i]);\r
+            }\r
         }\r
         list = list2;\r
     }\r
@@ -77,7 +83,6 @@ void MyCheckBoxContainer::add(QString item)
 void MyCheckBoxContainer::set(QString item)\r
 {\r
     clear();\r
-    qDebug() << "set" << item;\r
     add(item);\r
 }\r
 \r