Index: addons/kate-ctags/kate_ctags_plugin.cpp =================================================================== --- addons/kate-ctags/kate_ctags_plugin.cpp +++ addons/kate-ctags/kate_ctags_plugin.cpp @@ -129,6 +129,7 @@ nr = QStringLiteral("%1").arg(i,3); config.writeEntry(QStringLiteral("GlobalTarget_")+nr, m_confUi.targetList->item(i)->text()); } + qWarning() << "Config file:" << config.config()->name(); config.sync(); } Index: addons/kate-ctags/kate_ctags_view.h =================================================================== --- addons/kate-ctags/kate_ctags_view.h +++ addons/kate-ctags/kate_ctags_view.h @@ -98,7 +98,7 @@ void jumpToTag(const QString &file, const QString &pattern, const QString &word); - KTextEditor::MainWindow *m_mWin; + QPointer m_mWin; QWidget *m_toolView; Ui::kateCtags m_ctagsUi; Index: addons/kate-ctags/kate_ctags_view.cpp =================================================================== --- addons/kate-ctags/kate_ctags_view.cpp +++ addons/kate-ctags/kate_ctags_view.cpp @@ -20,6 +20,7 @@ */ #include "kate_ctags_view.h" +#include "kate_ctags_plugin.h" #include "kate_ctags_debug.h" #include @@ -66,6 +67,28 @@ lookup->setText(i18n("Lookup Current Text")); connect(lookup, &QAction::triggered, this, &KateCTagsView::lookupTag); + QAction *updateDB = actionCollection()->addAction(QLatin1String("ctags_update_global_db")); + updateDB->setText(i18n("Configure ...")); + connect(updateDB, &QAction::triggered, this, [plugin, mainWin] (bool) { + KateCTagsPlugin *p = dynamic_cast(plugin); + QDialog *confWin = new QDialog(mainWin->window()); + auto confPage = p->configPage(0, nullptr); + auto controls = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, Qt::Horizontal, nullptr); + connect(confWin, &QDialog::accepted, confPage, &KTextEditor::ConfigPage::apply); + connect(controls, &QDialogButtonBox::accepted, confWin, &QDialog::accept); + connect(controls, &QDialogButtonBox::rejected, confWin, &QDialog::reject); + auto layout = new QVBoxLayout; + layout->addWidget(confPage); + layout->addWidget(controls); + confWin->setLayout(layout); + confWin->show(); + confWin->exec(); + confWin->deleteLater(); + confPage->deleteLater(); + controls->deleteLater(); + layout->deleteLater(); + }); + // popup menu m_menu = new KActionMenu(i18n("CTags"), this); actionCollection()->addAction(QLatin1String("popup_ctags"), m_menu); @@ -125,7 +148,9 @@ /******************************************************************/ KateCTagsView::~KateCTagsView() { - m_mWin->guiFactory()->removeClient( this ); + if (m_mWin->guiFactory()) { + m_mWin->guiFactory()->removeClient( this ); + } delete m_toolView; } Index: addons/kate-ctags/katectagsplugin.desktop =================================================================== --- addons/kate-ctags/katectagsplugin.desktop +++ addons/kate-ctags/katectagsplugin.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Service -ServiceTypes=KTextEditor/Plugin +ServiceTypes=KTextEditor/Plugin,KDevelop/Plugin X-KDE-Library=katectagsplugin Name=CTags Name[ar]=وسوم سي Index: addons/kate-ctags/ui.rc =================================================================== --- addons/kate-ctags/ui.rc +++ addons/kate-ctags/ui.rc @@ -1,14 +1,16 @@ - + CTags + +