+void NickListWidget::removeBuffer(BufferId bufferId)
+{
+ if (!nickViews.contains(bufferId))
+ return;
+
+ NickView* view = nickViews.take(bufferId);
+ ui.stackedWidget->removeWidget(view);
+ QAbstractItemModel* model = view->model();
+ view->setModel(nullptr);
+ if (auto* filter = qobject_cast<QSortFilterProxyModel*>(model))
+ filter->setSourceModel(nullptr);
+ model->deleteLater();
+ view->deleteLater();
+}
+
+QSize NickListWidget::sizeHint() const
+{
+ QWidget* currentWidget = ui.stackedWidget->currentWidget();
+ if (!currentWidget || currentWidget == ui.emptyPage)
+ return {100, height()};
+ else
+ return currentWidget->sizeHint();
+}
+
+// ==============================
+// NickList Dock
+// ==============================
+NickListDock::NickListDock(const QString& title, QWidget* parent)
+ : QDockWidget(title, parent)
+{
+ // THIS STUFF IS NEEDED FOR NICKLIST AUTOHIDE...
+ // AS THIS BRINGS LOTS OF FUCKUPS WITH IT IT'S DEACTIVATED FOR NOW...
+
+ // QAction *toggleView = toggleViewAction();
+ // disconnect(toggleView, SIGNAL(triggered(bool)), this, 0);
+ // toggleView->setChecked(QtUiSettings().value("ShowNickList", QVariant(true)).toBool());
+
+ // // reconnecting the closebuttons clicked signal to the action
+ // foreach(QAbstractButton *button, findChildren<QAbstractButton *>()) {
+ // if(disconnect(button, SIGNAL(clicked()), this, SLOT(close())))
+ // connect(button, SIGNAL(clicked()), toggleView, SLOT(trigger()));
+ // }