Fix an issue where empty elements were shown in the highlight list
[quassel.git] / src / qtui / settingspages / corehighlightsettingspage.cpp
index d8eaa9f..242c318 100644 (file)
@@ -26,7 +26,7 @@
 #include "qtui.h"
 
 CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent)
-    : SettingsPage(tr("Interface"), tr("Core-Side Highlights"), parent)
+    : SettingsPage(tr("Interface"), tr("Remote Highlights"), parent)
 {
     ui.setupUi(this);
 
@@ -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!";
     }
-    ui.highlightTable->clearContents();
+    while (ui.highlightTable->rowCount()) {
+        ui.highlightTable->removeRow(0);
+    }
     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!";
     }
-    ui.ignoredTable->clearContents();
+    while (ui.ignoredTable->rowCount()) {
+        ui.ignoredTable->removeRow(0);
+    }
     ignoredList.clear();
 }
 
@@ -496,3 +500,7 @@ void CoreHighlightSettingsPage::importRules() {
     setChangedState(false);
     load();
 }
+
+bool CoreHighlightSettingsPage::isSelectable() const {
+    return Client::isConnected() && Client::isCoreFeatureEnabled(Quassel::Feature::CoreSideHighlights);
+}