Changeset View
Changeset View
Standalone View
Standalone View
src/presentation/pagemodel.cpp
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 123 | case Presentation::QueryTreeModelBase::ContextListRole: | |||
---|---|---|---|---|---|
126 | } else { | 126 | } else { | ||
127 | const auto contexts = info->contextQueryResult->data(); | 127 | const auto contexts = info->contextQueryResult->data(); | ||
128 | auto result = QStringList(); | 128 | auto result = QStringList(); | ||
129 | std::transform(std::cbegin(contexts), std::cend(contexts), | 129 | std::transform(std::cbegin(contexts), std::cend(contexts), | ||
130 | std::back_inserter(result), | 130 | std::back_inserter(result), | ||
131 | [](const Domain::Context::Ptr &context) { return context->name(); }); | 131 | [](const Domain::Context::Ptr &context) { return context->name(); }); | ||
132 | return result; | 132 | return result; | ||
133 | } | 133 | } | ||
134 | case Presentation::QueryTreeModelBase::AdditionalInfoRole: | | |||
135 | if (!info || info->childTask) | | |||
136 | return QString(); | | |||
137 | if (info->projectQueryResult && !info->projectQueryResult->data().isEmpty()) { | | |||
138 | Domain::Project::Ptr project = info->projectQueryResult->data().at(0); | | |||
139 | return i18n("Project: %1", project->name()); | | |||
140 | } | | |||
141 | if (info->dataSourceQueryResult && !info->dataSourceQueryResult->data().isEmpty()) { | | |||
142 | Domain::DataSource::Ptr dataSource = info->dataSourceQueryResult->data().at(0); | | |||
143 | return dataSource->name(); | | |||
144 | } | | |||
145 | return i18n("Inbox"); | | |||
146 | default: | 134 | default: | ||
147 | break; | 135 | break; | ||
148 | } | 136 | } | ||
149 | return QVariant(); | 137 | return QVariant(); | ||
150 | } | 138 | } |