diff --git a/duchain/pythonducontext.cpp b/duchain/pythonducontext.cpp index 0e4f48fd..db9d45ac 100644 --- a/duchain/pythonducontext.cpp +++ b/duchain/pythonducontext.cpp @@ -1,60 +1,60 @@ /***************************************************************************** * This file is part of KDevelop * * Copyright 2011-2013 Sven Brauch * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License, or (at your option) any later version. * * * * This program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************** */ #include "pythonducontext.h" #include #include #include #include #include "navigation/navigationwidget.h" #include #include "duchaindebug.h" using namespace KDevelop; namespace Python { REGISTER_DUCHAIN_ITEM_WITH_DATA(PythonTopDUContext, TopDUContextData); REGISTER_DUCHAIN_ITEM_WITH_DATA(PythonNormalDUContext, DUContextData); template<> -QWidget* PythonTopDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, +KDevelop::AbstractNavigationWidget* PythonTopDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const { if ( ! decl ) { qCDebug(KDEV_PYTHON_DUCHAIN) << "no declaration, not returning navigationwidget"; return nullptr; } return new NavigationWidget(DeclarationPointer(decl), TopDUContextPointer(topContext), hints); } template<> -QWidget* PythonNormalDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, +KDevelop::AbstractNavigationWidget* PythonNormalDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, KDevelop::AbstractNavigationWidget::DisplayHints hints) const { if ( ! decl ) { qCDebug(KDEV_PYTHON_DUCHAIN) << "no declaration, not returning navigationwidget"; return nullptr; } return new NavigationWidget(DeclarationPointer(decl), TopDUContextPointer(topContext), hints); } } diff --git a/duchain/pythonducontext.h b/duchain/pythonducontext.h index 3e0328a6..cc349f22 100644 --- a/duchain/pythonducontext.h +++ b/duchain/pythonducontext.h @@ -1,76 +1,74 @@ /*************************************************************************** * This file is part of KDevelop * * Copyright 2013 Sven Brauch * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License, or (at your option) any later version. * * * * This program 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 General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************** */ #ifndef PYTHONDUCONTEXT_H #define PYTHONDUCONTEXT_H #include #include #include -class QWidget; - namespace KDevelop { class Declaration; class TopDUContext; } namespace Python { template class PythonDUContext : public BaseContext { public: template PythonDUContext(Data& data) : BaseContext(data) { } ///Parameters will be reached to the base-class template PythonDUContext(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 PythonDUContext(const Param1& p1, const Param2& p2, const Param3& p3) : BaseContext(p1, p2, p3) { static_cast(this)->d_func_dynamic()->setClassId(this); } template PythonDUContext(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 = IdentityT }; }; typedef PythonDUContext PythonTopDUContext; typedef PythonDUContext PythonNormalDUContext; } #endif // PYTHONDUCONTEXT_H