Commit 9d75f9ed authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Kurt Hindenburg

Fix invalid cast and simplify method

Part of !209
parent 2285d4ec
......@@ -176,7 +176,7 @@ void TabbedViewContainer::moveTabToWindow(int index, QWidget *window)
auto controller = splitter->activeTerminalDisplay()->sessionController();
container->currentSessionControllerChanged(controller);
forgetView(splitter);
forgetView();
}
void TabbedViewContainer::konsoleConfigChanged()
......@@ -392,17 +392,17 @@ void TabbedViewContainer::disconnectTerminalDisplay(TerminalDisplay *display)
void TabbedViewContainer::viewDestroyed(QObject *view)
{
auto widget = static_cast<ViewSplitter*>(view);
const auto idx = indexOf(widget);
QWidget *widget = qobject_cast<QWidget*>(view);
Q_ASSERT(widget);
const int idx = indexOf(widget);
removeTab(idx);
forgetView(widget);
forgetView();
_tabIconState.remove(widget);
}
void TabbedViewContainer::forgetView(ViewSplitter *view)
void TabbedViewContainer::forgetView()
{
Q_UNUSED(view)
if (count() == 0) {
emit empty(this);
}
......
......@@ -222,7 +222,7 @@ private Q_SLOTS:
void konsoleConfigChanged();
private:
void forgetView(ViewSplitter *view);
void forgetView();
struct TabIconState {
TabIconState(): readOnly(false), broadcast(false), notification(Session::NoNotification) {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment