Fix an issue where empty elements were shown in the highlight list
authorJanne Koschinski <janne@kuschku.de>
Thu, 21 Dec 2017 22:48:03 +0000 (23:48 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Mar 2018 21:05:59 +0000 (23:05 +0200)
- Replace clearContents with while (rowCount()) removeRow

src/qtui/settingspages/corehighlightsettingspage.cpp

index 3a6d6eb..242c318 100644 (file)
@@ -308,7 +308,9 @@ void CoreHighlightSettingsPage::emptyHighlightTable()
     if (ui.highlightTable->rowCount() != highlightList.size()) {
         qDebug() << "something is wrong: ui.highlight and highlightList don't have the same size!";
     }
     if (ui.highlightTable->rowCount() != highlightList.size()) {
         qDebug() << "something is wrong: ui.highlight and highlightList don't have the same size!";
     }
-    ui.highlightTable->clearContents();
+    while (ui.highlightTable->rowCount()) {
+        ui.highlightTable->removeRow(0);
+    }
     highlightList.clear();
 }
 
     highlightList.clear();
 }
 
@@ -318,7 +320,9 @@ void CoreHighlightSettingsPage::emptyIgnoredTable()
     if (ui.ignoredTable->rowCount() != ignoredList.size()) {
         qDebug() << "something is wrong: ui.highlight and highlightList don't have the same size!";
     }
     if (ui.ignoredTable->rowCount() != ignoredList.size()) {
         qDebug() << "something is wrong: ui.highlight and highlightList don't have the same size!";
     }
-    ui.ignoredTable->clearContents();
+    while (ui.ignoredTable->rowCount()) {
+        ui.ignoredTable->removeRow(0);
+    }
     ignoredList.clear();
 }
 
     ignoredList.clear();
 }