diff --git a/duchain/phpducontext.cpp b/duchain/phpducontext.cpp index 6c8149b..b945f7f 100644 --- a/duchain/phpducontext.cpp +++ b/duchain/phpducontext.cpp @@ -1,75 +1,75 @@ /* Copyright 2008 Niko Sams This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "phpducontext.h" #include #include #include #include #include #include "navigation/navigationwidget.h" namespace Php { using namespace KDevelop; typedef PhpDUContext PhpTopDUContext; REGISTER_DUCHAIN_ITEM_WITH_DATA(PhpTopDUContext, TopDUContextData); typedef PhpDUContext PhpNormalDUContext; REGISTER_DUCHAIN_ITEM_WITH_DATA(PhpNormalDUContext, DUContextData); template<> -QWidget* PhpDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const +KDevelop::AbstractNavigationWidget* PhpDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const { if (decl == nullptr) { return nullptr; } else if ( decl->kind() == Declaration::Import ) { QUrl u( decl->identifier().toString() ); IncludeItem i; i.pathNumber = -1; i.name = u.fileName(); i.isDirectory = false; i.basePath = KIO::upUrl(u); return new NavigationWidget( i, TopDUContextPointer(topContext), hints ); } else { return new NavigationWidget(DeclarationPointer(decl), TopDUContextPointer(topContext ? topContext : this->topContext()), hints); } } template<> -QWidget* PhpDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const +KDevelop::AbstractNavigationWidget* PhpDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const { if (decl == nullptr) { if (owner()) return new NavigationWidget(DeclarationPointer(owner()), TopDUContextPointer(topContext ? topContext : this->topContext()), hints); else return nullptr; } else { return new NavigationWidget(DeclarationPointer(decl), TopDUContextPointer(topContext ? topContext : this->topContext()), hints); } } } diff --git a/duchain/phpducontext.h b/duchain/phpducontext.h index 8d3e4ec..ebe0850 100644 --- a/duchain/phpducontext.h +++ b/duchain/phpducontext.h @@ -1,71 +1,71 @@ /* Copyright 2008 Niko Sams This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PHPDUCONTEXT_H #define PHPDUCONTEXT_H #include #include class QWidget; namespace KDevelop { class Declaration; class TopDUContext; } namespace Php { /** * This is a du-context template that wraps the Php-specific logic around existing DUContext-derived classes. * In practice this means DUContext and TopDUContext. * */ template class PhpDUContext : public BaseContext { public: template PhpDUContext(Data& data) : BaseContext(data) { } ///Parameters will be reached to the base-class template PhpDUContext(const Param1& p1, const Param2& p2, bool isInstantiationContext) : BaseContext(p1, p2, isInstantiationContext) { static_cast(this)->d_func_dynamic()->setClassId(this); } ///Both parameters will be reached to the base-class. This fits TopDUContext. template PhpDUContext(const Param1& p1, const Param2& p2, const Param3& p3) : BaseContext(p1, p2, p3) { static_cast(this)->d_func_dynamic()->setClassId(this); } template PhpDUContext(const Param1& p1, const Param2& p2) : BaseContext(p1, p2) { static_cast(this)->d_func_dynamic()->setClassId(this); } - QWidget* createNavigationWidget(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, + KDevelop::AbstractNavigationWidget* createNavigationWidget(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const override; enum { Identity = BaseContext::Identity + 51 }; }; } #endif