Commit 3cd03f40 authored by René J.V. Bertin's avatar René J.V. Bertin

CTags plugin : missed KDevelop integration aspects

- don't crash if the toolview is deleted externally (= in KDevelop)
- add the actual CTags UI widget to the toolView widget so that it
  renders correctly in KDevelop too.
parent 7f91a5e2
......@@ -98,7 +98,7 @@ KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
connect(m_menu->menu(), &QMenu::aboutToShow, this, &KateCTagsView::aboutToShow);
QWidget *ctagsWidget = new QWidget(m_toolView);
QWidget *ctagsWidget = new QWidget(m_toolView.data());
m_ctagsUi.setupUi(ctagsWidget);
m_ctagsUi.cmdEdit->setText(DEFAULT_CTAGS_CMD);
......@@ -136,6 +136,7 @@ KateCTagsView::KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindo
connect(m_mWin, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KateCTagsView::handleEsc);
m_toolView->layout()->addWidget(ctagsWidget);
m_toolView->installEventFilter(this);
m_mWin->guiFactory()->addClient(this);
......@@ -151,7 +152,9 @@ KateCTagsView::~KateCTagsView()
m_mWin->guiFactory()->removeClient( this );
}
delete m_toolView;
if (m_toolView) {
delete m_toolView;
}
}
/******************************************************************/
......
......@@ -99,7 +99,7 @@ private:
QPointer<KTextEditor::MainWindow> m_mWin;
QWidget *m_toolView;
QPointer<QWidget> m_toolView;
Ui::kateCtags m_ctagsUi;
QPointer<KActionMenu> m_menu;
......
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