Commit c88a5f30 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Remove KateMainWindow::widgetActivated

We emit viewChanged(nullptr) instead which should be enough. No need
for two signals anymore.

Fixes:
- showing WelcomeView after an untitled doc shows "Untitled" in urlbar
- item activation for widgets in the "Documents" plugin
parent dafc55ce
Pipeline #252524 canceled with stage
in 4 minutes and 54 seconds
......@@ -203,7 +203,6 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind
auto mw = mainWindow->window();
connect(mw, SIGNAL(widgetAdded(QWidget *)), this, SLOT(slotWidgetCreated(QWidget *)));
connect(mw, SIGNAL(widgetRemoved(QWidget *)), this, SLOT(slotWidgetRemoved(QWidget *)));
connect(mw, SIGNAL(widgetActivated(QWidget *)), this, SLOT(widgetActivated(QWidget *)));
connect(m_fileTree, &KateFileTree::closeWidget, this, [this](QWidget *w) {
auto mw = m_mainWindow->window();
......@@ -479,11 +478,6 @@ void KateFileTreePluginView::slotDocumentSaveAs() const
}
}
void KateFileTreePluginView::widgetActivated(QWidget *)
{
viewChanged(nullptr);
}
void KateFileTreePluginView::slotWidgetCreated(QWidget *w)
{
m_documentModel->addWidget(w);
......
......@@ -134,7 +134,6 @@ private Q_SLOTS:
void slotDocumentSave() const;
void slotDocumentSaveAs() const;
void widgetActivated(QWidget *);
void slotWidgetCreated(QWidget *);
void slotWidgetRemoved(QWidget *);
};
......
......@@ -1337,6 +1337,7 @@ bool KateMainWindow::addWidget(QWidget *widget)
auto vs = m_viewManager->activeViewSpace();
vs->addWidgetAsTab(widget);
Q_EMIT widgetAdded(widget);
m_viewManager->activateView(static_cast<KTextEditor::Document *>(nullptr));
return true;
}
......
......@@ -228,7 +228,6 @@ Q_SIGNALS:
void widgetAdded(QWidget *);
void widgetRemoved(QWidget *);
void widgetActivated(QWidget *);
public:
void openUrl(const QString &name = QString());
......
......@@ -453,7 +453,6 @@ void KateViewSpace::changeView(int idx)
}
stack->setCurrentWidget(w);
m_viewManager->activateView(static_cast<KTextEditor::Document *>(nullptr));
Q_EMIT m_viewManager->mainWindow()->widgetActivated(w);
return;
}
......
Supports Markdown
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