Fixed sort a-z bug which caused list to disappear when option Checked to Bottom was...
[easylist] / src / mycheckboxcontainer.cpp
index aaa719d..915d277 100755 (executable)
@@ -30,6 +30,7 @@ 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
@@ -46,10 +47,12 @@ void MyCheckBoxContainer::add(QString item)
                     break;\r
                 }\r
             }\r
+            qDebug() << "append" << list[i];\r
             list2.append(list[i]);\r
         }\r
         list = list2;\r
     }\r
+    qDebug() << "list" << list;\r
     foreach(QString item, list)\r
     {\r
         if(item.length() > 0)\r
@@ -73,8 +76,8 @@ void MyCheckBoxContainer::add(QString item)
 \r
 void MyCheckBoxContainer::set(QString item)\r
 {\r
-    qDebug() << item;\r
     clear();\r
+    qDebug() << "set" << item;\r
     add(item);\r
 }\r
 \r
@@ -141,8 +144,8 @@ void MyCheckBoxContainer::sortCheckedToBottom()
         checkBoxes.clear();\r
         checkBoxes.append(tempList);\r
         checkBoxes.append(tempListChecked);\r
-        emit signalSorted();\r
     }\r
+    emit signalSorted();\r
 }\r
 \r
 QList<MyCheckBox * > const & MyCheckBoxContainer::getCheckBoxes()\r