Changeset View
Changeset View
Standalone View
Standalone View
language/duchain/navigation/problemnavigationcontext.h
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | Boston, MA 02110-1301, USA. | 16 | Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H | 19 | #ifndef KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H | ||
20 | #define KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H | 20 | #define KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H | ||
21 | 21 | | |||
22 | #include <interfaces/iproblem.h> | 22 | #include <interfaces/iproblem.h> | ||
23 | #include <interfaces/iassistant.h> | ||||
24 | | ||||
23 | #include <language/duchain/navigation/abstractnavigationcontext.h> | 25 | #include <language/duchain/navigation/abstractnavigationcontext.h> | ||
24 | #include <language/languageexport.h> | 26 | #include <language/languageexport.h> | ||
25 | #include <qpointer.h> | 27 | #include <qpointer.h> | ||
26 | 28 | | |||
27 | namespace KDevelop { | 29 | namespace KDevelop { | ||
28 | 30 | | |||
29 | class KDEVPLATFORMLANGUAGE_EXPORT ProblemNavigationContext : public AbstractNavigationContext | 31 | class KDEVPLATFORMLANGUAGE_EXPORT ProblemNavigationContext : public AbstractNavigationContext | ||
30 | { | 32 | { | ||
31 | Q_OBJECT | 33 | Q_OBJECT | ||
32 | public: | 34 | public: | ||
33 | explicit ProblemNavigationContext(const IProblem::Ptr& problem); | 35 | enum Flag { | ||
36 | NoFlag = 0, | ||||
37 | ShowLocation = 1 << 0, | ||||
38 | }; | ||||
39 | Q_DECLARE_FLAGS(Flags, Flag) | ||||
40 | | ||||
41 | explicit ProblemNavigationContext(const IProblem::Ptr& problem, const Flags flags = {}); | ||||
mwolff: const& | |||||
kfunk: It's a method override -> can't change signature. Same below. | |||||
mwolff: and also make the method const, if possible | |||||
34 | ~ProblemNavigationContext() override; | 42 | ~ProblemNavigationContext() override; | ||
35 | 43 | | |||
36 | QString name() const override; | 44 | QString name() const override; | ||
37 | QString html(bool shorten = false) override; | 45 | QString html(bool shorten = false) override; | ||
38 | QWidget* widget() const override; | 46 | QWidget* widget() const override; | ||
39 | bool isWidgetMaximized() const override; | 47 | bool isWidgetMaximized() const override; | ||
40 | 48 | | |||
49 | NavigationContextPointer executeKeyAction(QString key) override; | ||||
mwolff: const& | |||||
50 | | ||||
51 | public slots: | ||||
52 | void executeAction(int index); // TODO: Add API in base class? | ||||
53 | | ||||
41 | private: | 54 | private: | ||
42 | IProblem::Ptr m_problem; | 55 | IProblem::Ptr m_problem; | ||
56 | Flags m_flags; | ||||
43 | 57 | | |||
44 | QPointer<QWidget> m_widget; | 58 | QPointer<QWidget> m_widget; | ||
59 | IAssistant::Ptr m_cachedAssistant; // cache assistant, calling IAssistant::solutionAssistant() might be expensive | ||||
45 | }; | 60 | }; | ||
46 | 61 | | |||
47 | } | 62 | } | ||
48 | 63 | | |||
49 | #endif // KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H | 64 | #endif // KDEVPLATFORM_PROBLEMNAVIGATIONCONTEXT_H |
const&