Changeset View
Changeset View
Standalone View
Standalone View
src/presentation/querytreenode.h
Show All 22 Lines | |||||
23 | */ | 23 | */ | ||
24 | 24 | | |||
25 | 25 | | |||
26 | #ifndef PRESENTATION_QUERYTREENODE_H | 26 | #ifndef PRESENTATION_QUERYTREENODE_H | ||
27 | #define PRESENTATION_QUERYTREENODE_H | 27 | #define PRESENTATION_QUERYTREENODE_H | ||
28 | 28 | | |||
29 | #include <functional> | 29 | #include <functional> | ||
30 | 30 | | |||
31 | // Qt5 TODO, shouldn't be needed anymore, QVariant will do the right thing | | |||
32 | #include "domain/note.h" | | |||
33 | #include "domain/task.h" | 31 | #include "domain/task.h" | ||
34 | 32 | | |||
35 | #include "domain/queryresultinterface.h" | 33 | #include "domain/queryresultinterface.h" | ||
36 | 34 | | |||
37 | #include "querytreemodelbase.h" | 35 | #include "querytreemodelbase.h" | ||
38 | 36 | | |||
39 | namespace Presentation { | 37 | namespace Presentation { | ||
40 | 38 | | |||
41 | // Qt5 TODO, shouldn't be needed anymore, QVariant will do the right thing | 39 | // Qt5 TODO, shouldn't be needed anymore, QVariant will do the right thing | ||
42 | namespace Internal { | 40 | namespace Internal { | ||
43 | template<typename T> | 41 | template<typename T> | ||
44 | QVariant variantFromValue(const T &object) | 42 | QVariant variantFromValue(const T &object) | ||
45 | { | 43 | { | ||
46 | return QVariant::fromValue(object); | 44 | return QVariant::fromValue(object); | ||
47 | } | 45 | } | ||
48 | 46 | | |||
49 | template<> | 47 | template<> | ||
50 | inline QVariant variantFromValue<Domain::Note::Ptr>(const Domain::Note::Ptr &task) | | |||
51 | { | | |||
52 | return QVariant::fromValue(task.staticCast<Domain::Artifact>()); | | |||
53 | } | | |||
54 | | ||||
55 | template<> | | |||
56 | inline QVariant variantFromValue<Domain::Task::Ptr>(const Domain::Task::Ptr ¬e) | 48 | inline QVariant variantFromValue<Domain::Task::Ptr>(const Domain::Task::Ptr ¬e) | ||
57 | { | 49 | { | ||
58 | return QVariant::fromValue(note.staticCast<Domain::Artifact>()); | 50 | return QVariant::fromValue(note.staticCast<Domain::Artifact>()); | ||
59 | } | 51 | } | ||
60 | } | 52 | } | ||
61 | 53 | | |||
62 | template<typename ItemType, typename AdditionalInfo> | 54 | template<typename ItemType, typename AdditionalInfo> | ||
63 | class QueryTreeNode : public QueryTreeNodeBase | 55 | class QueryTreeNode : public QueryTreeNodeBase | ||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |